Skip to content

BB516 RPG36

The RPG program BB516.rpg36.txt is called by the BB516.ocl36.txt OCL program within the invoice posting workflow (related to BB600P.ocl36.txt). Its primary function is to copy records from a batch-specific EDI (Electronic Data Interchange) warehouse shipping advice file (EDWSA) to a permanent EDI 945 file (EDI945) 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 BB516 RPG Program

The BB516 program is a simple RPG program that performs a straightforward file copy operation, reading records from EDWSA and writing them to EDI945. It operates using the RPG cycle for sequential processing.

Process Steps:

  1. File Initialization:
  2. The program opens two files:
    • EDWSA: Secondary input file (IS), containing batch-specific EDI warehouse shipping advice records (128 bytes per record). The file label is ?9?EDWSA?20? (as specified in BB516.ocl36.txt), where ?20? represents the batch number.
    • EDI945: Output file (O) with add capability (A), used to store EDI 945 warehouse shipping advice records (128 bytes per record).
  3. Both files are disk-based and fixed-length (128 bytes per record).

  4. Record Processing:

  5. The program reads each record from EDWSA sequentially using the RPG cycle (NS 01 indicates non-sequential input, but as the only input file, it is processed sequentially).
  6. For each record read, the entire 128-byte record (RECORD field, positions 1–128) is written to the EDI945 file using an add operation (DADD 01).
  7. The output specification (OEDI945 DADD 01) writes the RECORD field to EDI945 without modification.

  8. Cycle Completion:

  9. The RPG cycle processes all records in EDWSA until the end of the file is reached.
  10. Once all records are copied to EDI945, the program terminates, closing both files.

Business Rules

  1. Direct Record Copy:
  2. The program performs a one-to-one copy of records from EDWSA to EDI945 without any transformation or validation of the record content.
  3. Each record in EDWSA is assumed to be correctly formatted as EDI 945 warehouse shipping advice data, ready for transmission.

  4. Sequential Processing:

  5. Records are processed sequentially, and all records in EDWSA are copied to EDI945.
  6. The program does not filter, modify, or skip records, ensuring all data is transferred to the permanent file.

  7. Purpose for Transmission:

  8. The EDI945 file is created to store warehouse shipping advice data for transmission to a third-party EDI service provider, such as Kleinschmidt (as noted in the BB516.ocl36.txt comments).
  9. The program supports the EDI workflow by preparing batch-specific data 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 EDWSA exists, is accessible, and contains valid records, and that EDI945 can be written to without issues.

Tables (Files) Used

  1. EDWSA:
  2. Description: Batch-specific EDI warehouse shipping advice file.
  3. Attributes: 128 bytes per record, secondary input file (IS), disk-based.
  4. Fields Used:
    • RECORD (128 bytes, positions 1–128): The entire record content.
  5. Purpose: Contains EDI 945 warehouse shipping advice data for a specific batch (indicated by ?20? in the file label ?9?EDWSA?20?).
  6. Usage: Read sequentially and copied to EDI945. Cleared after processing (as per CLRPFM ?9?EDWSA?20? in BB516.ocl36.txt).

  7. EDI945:

  8. Description: Permanent EDI 945 warehouse shipping advice file.
  9. Attributes: 128 bytes per record, output file (O) with add capability (A), disk-based.
  10. Fields Used:
    • RECORD (128 bytes, positions 1–128): The entire record content copied from EDWSA.
  11. Purpose: Stores EDI 945 data for transmission to a third-party EDI service provider (e.g., Kleinschmidt).
  12. Usage: Records are added to this file from EDWSA. Copied to BBVA01 for archiving (as per BB516.ocl36.txt).

External Programs Called

The BB516 RPG program does not explicitly call any external programs. It is a self-contained program that performs a simple file copy operation, reading from EDWSA and writing to EDI945.


Summary

The BB516 RPG program, called by BB516.ocl36.txt, supports the EDI workflow by: - Reading all records from the batch-specific EDWSA file (EDI 945 warehouse shipping advice). - Writing each record unchanged to the EDI945 file using an add operation. - Terminating after processing all records, producing a permanent file for EDI transmission.

Tables Used: EDWSA (batch-specific EDI 945 input), EDI945 (permanent EDI 945 output). External Programs Called: None.

This program ensures that batch-specific EDI 945 warehouse shipping advice data is copied to a permanent file for transmission to a third-party EDI service provider, such as Kleinschmidt, as part of the invoice posting process.