Skip to content

EDI811 OCL

The provided document, EDI811.ocl36.txt, is an Operation Control Language (OCL) program used on IBM midrange systems (e.g., AS/400 or IBM i) to control the execution of the EDI811 program, which handles outbound Bill of Lading (BOL) tracking maintenance for EDI (Electronic Data Interchange). This OCL program is called as part of the workflow initiated by the EDI811P programs (OCL and RPG, as previously analyzed). Below, I’ll explain the process steps, business rules, tables (files) used, and external programs called, integrating context from the related EDI811P programs where relevant.


Process Steps of the EDI811 OCL Program

The EDI811 OCL program sets up the environment, loads and runs the EDI811 program, and optionally triggers an FTP process for EDI data transmission. Here’s a step-by-step breakdown:

  1. Header and Initial Setup:
  2. The program begins with a comment indicating it is for "EDI OUTBOUND BILL OF LADING TRACKING MAINTENANCE."
  3. // GSY2K: Likely a directive to set up the environment, possibly for Y2K-compliant date handling or system-specific configurations. This ensures the program operates in the correct system context.

  4. Local Variable Initialization:

  5. // LOCAL OFFSET-200,DATA-' ': Initializes a local variable at offset 200 with 8 blanks. This could be used to clear a specific data area or parameter field.
  6. // IF SWITCH2-1 LOCAL BLANK-*ALL: If switch 2 is set to 1, clears all local variables to blanks, resetting the environment.
  7. // IF SWITCH2-1 GOTO END: If switch 2 is set to 1, jumps to the END tag, terminating the program. This indicates a cancellation or error condition (possibly set by the calling program or user action).

  8. Additional Variable Setup:

  9. // LOCAL OFFSET-202,DATA-' ': Initializes another local variable at offset 202 with 6 blanks, likely clearing another parameter or data area.
  10. // SWITCH XX00XXX0: Sets the switch configuration, where:

    • X indicates no change to the switch state (retains existing value).
    • Switches 3–4 are set to 0.
    • Switch 7 is set to 0.
    • Other switches (1, 2, 5, 6, 8) retain their prior state.
    • This configuration may control conditional logic in the EDI811 program or subsequent steps.
  11. Load and Run Program:

  12. // LOAD EDI811: Loads the EDI811 program (likely an RPG program) into memory for execution.
  13. File Definitions:
    • // FILE NAME-EDIBOL,LABEL-EDI,DISP-SHR: Defines the EDIBOL file (label EDI) in shared mode (DISP-SHR), used as input (likely containing validated BOL records from EDI811P).
    • // FILE NAME-EDIBOLTX,LABEL-?9?EDIBOLX,DISP-SHR: Defines the EDIBOLTX file with a label including a placeholder (?9?, typically a library or prefix) in shared mode, used for BOL transaction data.
    • // FILE NAME-EDIOUT,LABEL-?9?EDI404,RECORDS-999000,RETAIN-T: Defines the EDIOUT file (label ?9?EDI404) as a temporary output file (RETAIN-T) with a capacity of 999,000 records, likely for storing formatted EDI output (e.g., EDI 404 transaction sets).
    • // FILE NAME-EDIRSI,LABEL-?9?EDIRSI,DISP-SHR: Defines the EDIRSI file in shared mode, possibly containing routing or shipment information for EDI processing.
  14. // RUN: Executes the loaded EDI811 program, which processes the input files (EDIBOL, EDIBOLTX, EDIRSI) to generate EDI output in EDIOUT.

  15. FTP Process Execution:

  16. EDI404SD ,,,,,,,,?9?: Calls the EDI404SD program/procedure with a parameter (?9?, likely a library or system prefix). A comment indicates this runs an FTP process immediately, bypassing the need to navigate to a different menu.
  17. Purpose: This step likely transmits the EDIOUT file (containing EDI 404 BOL data) to an external trading partner via FTP.

  18. Program Termination:

  19. // TAG END: Marks the END label, reached if switch 2 is set or after normal processing.
  20. // SWITCH 00000000: Resets all eight control switches to 0, clearing any conditional flags.
  21. // LOCAL BLANK-*ALL: Clears all local variables, ensuring a clean exit.

Business Rules

The OCL program enforces the following business rules: 1. Cancellation Handling: - If switch 2 is set (SWITCH2-1), the program clears all local variables and terminates immediately, indicating a cancellation or error condition (possibly set by EDI811P or user action). 2. File Access: - Input files (EDIBOL, EDIBOLTX, EDIRSI) are opened in shared mode to allow concurrent access by other processes. - The output file (EDIOUT) is temporary and retained for the job’s duration, with a large capacity (999,000 records) to handle extensive EDI data. 3. EDI Processing Workflow: - The EDI811 program processes BOL data from EDIBOL (generated by EDI811P), validates or enriches it using EDIBOLTX and EDIRSI, and produces EDI 404-compliant output in EDIOUT. - The EDI404SD program handles immediate FTP transmission of the EDIOUT file, streamlining the EDI process. 4. Environment Management: - Local variables and switches are cleared at the start (if canceled) and end to prevent data leakage or conflicts in subsequent runs. - The GSY2K directive ensures proper system context (e.g., date formats).


Tables (Files) Used

The OCL program defines the following files: 1. EDIBOL: - Label: EDI. - Disposition: SHR (shared access). - Purpose: Input file containing validated BOL records, likely generated by EDI811P. It holds company numbers (KYCO) and BOL numbers. 2. EDIBOLTX: - Label: ?9?EDIBOLX (with ?9? as a placeholder for a library/prefix). - Disposition: SHR (shared access). - Purpose: Input file containing BOL transaction data (e.g., purchase orders, routing details) used for validation or enrichment. 3. EDIOUT: - Label: ?9?EDI404. - Attributes: Temporary (RETAIN-T), 999,000 records. - Purpose: Output file storing EDI 404-compliant BOL data generated by EDI811 for transmission. 4. EDIRSI: - Label: ?9?EDIRSI. - Disposition: SHR (shared access). - Purpose: Input file likely containing routing or shipment information used to format EDI output.


External Programs Called

The OCL program explicitly calls the following external programs/procedures: 1. EDI811: - Loaded and executed via // LOAD EDI811 and // RUN. - Purpose: Processes BOL data from EDIBOL and EDIBOLTX, uses EDIRSI for additional data, and generates EDI output in EDIOUT. 2. EDI404SD: - Called via EDI404SD ,,,,,,,,?9?. - Purpose: Executes an FTP process to transmit the EDIOUT file (EDI 404 data) to an external trading partner, bypassing manual menu navigation.


Integration with EDI811P Programs

The EDI811 OCL program is a continuation of the workflow started by EDI811P (OCL and RPG): - Input from EDI811P: The EDIBOL file, generated by EDI811P.rpg36, contains validated company numbers (KYCO) and BOL numbers. EDI811 uses this as input to create EDI 404-compliant output. - Shared Files: Both programs use EDIBOL and EDIBOLTX, ensuring continuity. EDI811P validates BOLs against EDIBOLTX, while EDI811 likely formats them for EDI transmission. - Cancellation: The OCL for EDI811P checks switch 8 (SWITCH8-1) for cancellation, while EDI811 checks switch 2 (SWITCH2-1), suggesting different cancellation triggers (e.g., user exit in EDI811P, processing error in EDI811). - FTP Automation: The EDI404SD call automates the transmission of EDI data, completing the outbound BOL process.


Summary

  • Process Overview: The EDI811 OCL program initializes the environment, checks for cancellation (switch 2), loads and runs the EDI811 program to process BOL data into EDI 404 format, and calls EDI404SD for immediate FTP transmission. It uses four files (EDIBOL, EDIBOLTX, EDIOUT, EDIRSI) and ensures a clean exit.
  • Business Rules: Handles cancellation, uses shared input files and a temporary output file, processes BOL data for EDI 404 compliance, and automates FTP transmission.
  • Tables/Files: EDIBOL (input), EDIBOLTX (input), EDIOUT (output), EDIRSI (input).
  • External Programs: EDI811 (main processing), EDI404SD (FTP transmission).

If you need further details, such as the RPG code for EDI811 or specifics of EDI404SD, please provide additional files or context.