Skip to content

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:

  1. File Initialization:
  2. 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).
  3. All files are disk-based and fixed-length (128 bytes per record).

  4. Record Processing for FIL855:

  5. 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).
  6. For each record read, the entire 128-byte record (RECORD field, positions 1–128) is written to the EDISEND file using an add operation (DADD 01).
  7. The output specification (OEDISEND DADD 01) writes the RECORD field to EDISEND without modification.

  8. Record Processing for EDI810:

  9. After processing all records in FIL855, the program reads each record from EDI810 sequentially (NS 02 indicates non-sequential input for the secondary file).
  10. For each record read, the entire 128-byte record (RECORD field, positions 1–128) is written to the EDISEND file using an add operation (DADD 02).
  11. The output specification (OEDISEND DADD 02) writes the RECORD field to EDISEND without modification.

  12. Cycle Completion:

  13. The RPG cycle processes all records in FIL855 first, followed by all records in EDI810.
  14. Once all records from both files are written to EDISEND, the program terminates, closing all files.

Business Rules

  1. Combine EDI Files:
  2. The program copies all records from FIL855 (EDI 855 purchase order acknowledgments) and EDI810 (EDI 810 invoices) into a single EDISEND file.
  3. Records are appended to EDISEND in the order they are read: first all FIL855 records, then all EDI810 records.

  4. No Transformation or Validation:

  5. The program performs a direct copy of the 128-byte records without modifying or validating their content.
  6. It assumes that the input files (FIL855 and EDI810) contain correctly formatted EDI data ready for transmission.

  7. Purpose for Transmission:

  8. 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 the BB514.ocl36.txt comments).
  9. The program supports the workflow where EDI data is prepared for external communication.

  10. No Error Handling:

  11. The program does not include explicit error handling for file access, record validation, or I/O errors. It assumes that FIL855 and EDI810 exist, are accessible, and contain valid records, and that EDISEND can be written to without issues.

Tables (Files) Used

  1. FIL855:
  2. Description: EDI purchase order acknowledgment file (EDI 855).
  3. Attributes: 128 bytes per record, primary input file (IP), disk-based.
  4. Fields Used:
    • RECORD (128 bytes, positions 1–128): The entire record content.
  5. Purpose: Contains EDI 855 purchase order acknowledgment data to be copied to EDISEND.
  6. Usage: Read sequentially and written to EDISEND. Cleared after processing (as per BB514.ocl36.txt).

  7. EDI810:

  8. Description: EDI invoice file (EDI 810).
  9. Attributes: 128 bytes per record, secondary input file (IS), disk-based.
  10. Fields Used:
    • RECORD (128 bytes, positions 1–128): The entire record content.
  11. Purpose: Contains EDI 810 invoice data (likely populated by BB513.rpg36.txt) to be copied to EDISEND.
  12. Usage: Read sequentially and written to EDISEND. Cleared after processing (as per BB514.ocl36.txt).

  13. EDISEND:

  14. Description: EDI send file for transmission to a third-party service (e.g., Kleinschmidt).
  15. Attributes: 128 bytes per record, output file (O) with add capability (A), disk-based.
  16. Fields Used:
    • RECORD (128 bytes, positions 1–128): The entire record content copied from FIL855 or EDI810.
  17. Purpose: Consolidates EDI 855 and EDI 810 records for transmission to an external EDI service provider.
  18. 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.