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
FIL855sequentially using the RPG cycle (NS 01indicates non-sequential input, but as the primary file, it is processed first). - For each record read, the entire 128-byte record (
RECORDfield, positions 1–128) is written to theEDISENDfile using an add operation (DADD 01). -
The output specification (
OEDISEND DADD 01) writes theRECORDfield toEDISENDwithout modification. -
Record Processing for EDI810:
- After processing all records in
FIL855, the program reads each record fromEDI810sequentially (NS 02indicates non-sequential input for the secondary file). - For each record read, the entire 128-byte record (
RECORDfield, positions 1–128) is written to theEDISENDfile using an add operation (DADD 02). -
The output specification (
OEDISEND DADD 02) writes theRECORDfield toEDISENDwithout modification. -
Cycle Completion:
- The RPG cycle processes all records in
FIL855first, 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 singleEDISENDfile. -
Records are appended to
EDISENDin the order they are read: first allFIL855records, then allEDI810records. -
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 (
FIL855andEDI810) contain correctly formatted EDI data ready for transmission. -
Purpose for Transmission:
- The
EDISENDfile 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.txtcomments). -
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
FIL855andEDI810exist, are accessible, and contain valid records, and thatEDISENDcan 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 fromFIL855orEDI810.
- 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.