BB514 RPG36
The RPG program BB514.rpg36.txt
is called by the BB514.ocl36.txt
OCL program within the invoice posting workflow (related to BB600P.ocl36.txt
). Its primary function is to combine records from two EDI (Electronic Data Interchange) files—FIL855
(purchase order acknowledgments) and EDI810
(invoices)—into a single output file, EDISEND
, for transmission to a third-party EDI service provider, such as Kleinschmidt. Below is a detailed explanation of the process steps, business rules, tables used, and external programs called.
Process Steps of the BB514 RPG Program¶
The BB514
program is a straightforward RPG program that reads records from two input files and writes them to a single output file. It operates using the RPG cycle to process records sequentially.
Process Steps:¶
- File Initialization:
- The program opens three files:
FIL855
: Primary input file (IP
), containing EDI 855 purchase order acknowledgment records (128 bytes per record).EDI810
: Secondary input file (IS
), containing EDI 810 invoice records (128 bytes per record).EDISEND
: Output file (O
) with add capability (A
), used to store combined EDI records for transmission (128 bytes per record).
-
All files are disk-based and fixed-length (128 bytes per record).
-
Record Processing for FIL855:
- The program reads each record from
FIL855
sequentially using the RPG cycle (NS 01
indicates non-sequential input, but as the primary file, it is processed first). - For each record read, the entire 128-byte record (
RECORD
field, positions 1–128) is written to theEDISEND
file using an add operation (DADD 01
). -
The output specification (
OEDISEND DADD 01
) writes theRECORD
field toEDISEND
without modification. -
Record Processing for EDI810:
- After processing all records in
FIL855
, the program reads each record fromEDI810
sequentially (NS 02
indicates non-sequential input for the secondary file). - For each record read, the entire 128-byte record (
RECORD
field, positions 1–128) is written to theEDISEND
file using an add operation (DADD 02
). -
The output specification (
OEDISEND DADD 02
) writes theRECORD
field toEDISEND
without modification. -
Cycle Completion:
- The RPG cycle processes all records in
FIL855
first, followed by all records inEDI810
. - Once all records from both files are written to
EDISEND
, the program terminates, closing all files.
Business Rules¶
- Combine EDI Files:
- The program copies all records from
FIL855
(EDI 855 purchase order acknowledgments) andEDI810
(EDI 810 invoices) into a singleEDISEND
file. -
Records are appended to
EDISEND
in the order they are read: first allFIL855
records, then allEDI810
records. -
No Transformation or Validation:
- The program performs a direct copy of the 128-byte records without modifying or validating their content.
-
It assumes that the input files (
FIL855
andEDI810
) contain correctly formatted EDI data ready for transmission. -
Purpose for Transmission:
- The
EDISEND
file is created to consolidate EDI 855 and EDI 810 records for transmission to a third-party EDI service provider, such as Kleinschmidt (as noted in theBB514.ocl36.txt
comments). -
The program supports the workflow where EDI data is prepared for external communication.
-
No Error Handling:
- The program does not include explicit error handling for file access, record validation, or I/O errors. It assumes that
FIL855
andEDI810
exist, are accessible, and contain valid records, and thatEDISEND
can be written to without issues.
Tables (Files) Used¶
- FIL855:
- Description: EDI purchase order acknowledgment file (EDI 855).
- Attributes: 128 bytes per record, primary input file (
IP
), disk-based. - Fields Used:
RECORD
(128 bytes, positions 1–128): The entire record content.
- Purpose: Contains EDI 855 purchase order acknowledgment data to be copied to
EDISEND
. -
Usage: Read sequentially and written to
EDISEND
. Cleared after processing (as perBB514.ocl36.txt
). -
EDI810:
- Description: EDI invoice file (EDI 810).
- Attributes: 128 bytes per record, secondary input file (
IS
), disk-based. - Fields Used:
RECORD
(128 bytes, positions 1–128): The entire record content.
- Purpose: Contains EDI 810 invoice data (likely populated by
BB513.rpg36.txt
) to be copied toEDISEND
. -
Usage: Read sequentially and written to
EDISEND
. Cleared after processing (as perBB514.ocl36.txt
). -
EDISEND:
- Description: EDI send file for transmission to a third-party service (e.g., Kleinschmidt).
- Attributes: 128 bytes per record, output file (
O
) with add capability (A
), disk-based. - Fields Used:
RECORD
(128 bytes, positions 1–128): The entire record content copied fromFIL855
orEDI810
.
- Purpose: Consolidates EDI 855 and EDI 810 records for transmission to an external EDI service provider.
- Usage: Records are added to this file from both input files.
External Programs Called¶
The BB514
RPG program does not explicitly call any external programs. It is a self-contained program that performs a simple operation of combining records from FIL855
and EDI810
into EDISEND
.
Summary¶
The BB514
RPG program, called by BB514.ocl36.txt
, consolidates EDI data by:
- Reading all records from FIL855
(EDI 855 purchase order acknowledgments) and writing them to EDISEND
.
- Reading all records from EDI810
(EDI 810 invoices) and writing them to EDISEND
.
- Terminating after processing both files, producing a single EDISEND
file for EDI transmission.
Tables Used: FIL855
(EDI 855 input), EDI810
(EDI 810 input), EDISEND
(combined EDI output).
External Programs Called: None.
This program is part of the EDI workflow, ensuring that purchase order acknowledgments and invoices are combined into a single file for transmission to a third-party EDI service provider, such as Kleinschmidt, as noted in the OCL program.