Skip to content

BB750 OCL

The document BB750.ocl36.txt is an Open Control Language (OCL) program for the IBM System/36 or AS/400, responsible for generating a Detailed Open Railcar Bill of Lading (BOL) Listing by Order. It is called from the main OCL program (BB750P.ocl36.txt) when a detailed report is requested (based on the KYDETL flag set to 'Y'). Below, I’ll explain the process steps, business rules, tables/files used, and external programs called.


Process Steps of the OCL Program

The BB750 OCL program performs two main tasks: sorting the BOL data and generating the detailed report. It involves a sort operation using the #GSORT utility and then executes the BB750 program to produce the report. Here’s a step-by-step breakdown:

  1. Initialization and Environment Setup:
  2. // GSY2K: Likely a system or environment setup command, possibly related to Y2K compliance or system configuration.

  3. Conditional Local Variable Setup:

  4. // IF ?L'103,3'?/SEL LOCAL OFFSET-1,DATA-'O COAC'
    • Checks if the parameter at position 103 (length 3) equals 'SEL'.
    • If true, sets a local variable at offset 1 to 'O COAC' (likely indicating a specific company or selection criteria).
  5. // ELSE LOCAL OFFSET-1,DATA-'O*CO*C'

    • If false, sets the local variable to 'O*CO*C' (likely a wildcard or default company selection).
  6. Sort Operation:

  7. // LOAD #GSORT:
    • Loads the #GSORT utility, a system program for sorting data files.
  8. File Definitions for Sort:
    • // FILE NAME-INPUT,LABEL-?9?BBBOL,DISP-SHR:
    • Input file is BBBOL (Bill of Lading file), with label ?9?BBBOL (where ?9? is a system-specific prefix or library) and opened in shared mode (DISP-SHR).
    • // FILE NAME-OUTPUT,LABEL-?9?BB750S,RECORDS-999000,EXTEND-999000,RETAIN-J:
    • Output file is BB750S, a temporary sorted file with a capacity of 999,000 records, extendable by another 999,000, and retained as a job file (RETAIN-J).
  9. // RUN:
    • Executes the #GSORT utility with the following sort specifications:
    • HSORTR 11A 3X 512 N:
      • Defines a sort operation with a header (H), sorting records (SORTR), 11 ascending keys (11A), 3 extension records (3X), 512-byte record length, and no summary (N).
    • Sort Keys (Multiple Lines: ?L'1,3'? 4 9NEC?L'106,6'?, etc.):
      • Sorts on multiple fields, each starting with a 3-byte field (?L'1,3'?) and a 6-byte field from positions 106, 112, 118, 124, 130, 136, 142, 148, 154, and 160.
      • 4 9NEC indicates sorting on positions 4-9 (likely order number) with no equal comparison (NEC).
    • Inclusion Criteria:
      • I C 1 1NECD: Includes records where position 1 is not equal to 'D' (likely excluding deleted records, as BCDEL = 'D' indicates deletion in BICONT).
      • IAC 2 3EQC?L'101,2'?: Includes records where positions 2-3 (likely company code) equal the 2-byte parameter at position 101.
    • Field Specifications for Output:
      • FNC 2 3 COMPANY: Maps positions 2-3 to a field named COMPANY.
      • FNC 4 9 ORDER: Maps positions 4-9 to a field named ORDER.
      • FNC 10 12 SEQUENCE: Maps positions 10-12 to a field named SEQUENCE.
      • FDC 1 512: Copies the entire 512-byte record from position 1.
  10. // END: Completes the sort operation, producing the sorted file BB750S.

  11. Report Generation:

  12. // LOAD BB750:
    • Loads the BB750 program (likely an RPG or CL program) to generate the detailed BOL listing.
  13. File Definitions for Report:
    • // FILE NAME-BBBOL,LABEL-?9?BB750S,DISP-SHR:
    • Uses the sorted file BB750S (output from #GSORT) as the input BOL file, renamed as BBBOL.
    • // FILE NAME-ARCUST,LABEL-?9?ARCUST,DISP-SHR:
    • Customer file (ARCUST) for customer-related data, opened in shared mode.
    • // FILE NAME-SHIPTO,LABEL-?9?SHIPTO,DISP-SHR:
    • Ship-to file (SHIPTO) for shipping address data, opened in shared mode.
    • // FILE NAME-GSCONT,LABEL-?9?GSCONT,DISP-SHR:
    • Control file (GSCONT) for system or configuration data, opened in shared mode.
    • // FILE NAME-BICONT,LABEL-?9?BICONT,DISP-SHR:
    • Inventory control file (BICONT) for railcar or company data, opened in shared mode.
    • // FILE NAME-GSCTUM,LABEL-?9?GSCTUM,DISP-SHR:
    • Unit of measure or control file (GSCTUM), opened in shared mode.
  14. // RUN:
    • Executes the BB750 program to generate the detailed BOL listing using the sorted BB750S file and other reference files.

Business Rules

  1. Selection Criteria:
  2. If the parameter at position 103 equals 'SEL', the program uses 'O COAC' for company selection (specific company or account).
  3. Otherwise, it uses 'O*CO*C' (likely a wildcard for all companies or a default selection).

  4. Sort Logic:

  5. Excludes records where position 1 equals 'D' (likely a delete flag, consistent with BCDEL in BICONT).
  6. Includes records where the company code (positions 2-3) matches the parameter at position 101.
  7. Sorts primarily by order number (positions 4-9) and additional fields (positions 106, 112, etc., likely order line or sequence numbers) in ascending order.
  8. Outputs fields for company, order, sequence, and the full 512-byte record.

  9. File Usage:

  10. The input BOL data (BBBOL) is sorted into BB750S for ordered processing.
  11. The report program (BB750) uses multiple files (ARCUST, SHIPTO, GSCONT, BICONT, GSCTUM) to enrich the BOL listing with customer, shipping, and control data.

  12. Data Retention:

  13. The sorted file BB750S is retained as a job file (RETAIN-J), ensuring it’s available for the duration of the job but not permanently.

  14. Report Generation:

  15. The detailed report is generated only if the KYDETL flag (from BB750P.rpg36.txt) is 'Y', as determined by the calling OCL (BB750P.ocl36.txt).
  16. The report likely includes detailed order information, customer details, and shipping information, based on the files accessed.

Tables/Files Used

  1. BBBOL:
  2. Input file for the sort operation, containing raw BOL data.
  3. Label: ?9?BBBOL, opened in shared mode (DISP-SHR).
  4. Used by #GSORT as the input file and by BB750 as the sorted file (BB750S).

  5. BB750S:

  6. Temporary output file from the sort operation, containing sorted BOL data.
  7. Label: ?9?BB750S, with a capacity of 999,000 records, extendable, and retained as a job file (RETAIN-J).
  8. Used as the input (BBBOL) for the BB750 program.

  9. ARCUST:

  10. Customer file, likely containing customer master data (e.g., names, addresses).
  11. Label: ?9?ARCUST, opened in shared mode.
  12. Used by BB750 for customer-related information in the report.

  13. SHIPTO:

  14. Ship-to file, containing shipping address or destination data.
  15. Label: ?9?SHIPTO, opened in shared mode.
  16. Used by BB750 for shipping details in the report.

  17. GSCONT:

  18. Control file, likely containing system or configuration data.
  19. Label: ?9?GSCONT, opened in shared mode.
  20. Used by BB750 for control or reference data.

  21. BICONT:

  22. Inventory control file, containing railcar or company data.
  23. Label: ?9?BICONT, opened in shared mode.
  24. Used by BB750 for validation or additional railcar details (consistent with its use in BB750P.rpg36.txt).

  25. GSCTUM:

  26. Unit of measure or control file, possibly for measurement or formatting data.
  27. Label: ?9?GSCTUM, opened in shared mode.
  28. Used by BB750 for formatting or unit-related data in the report.

External Programs Called

  1. #GSORT:
  2. A system utility program for sorting data files.
  3. Used to sort the BBBOL file into BB750S based on company, order, and sequence fields.
  4. Called in the first part of the OCL program.

  5. BB750:

  6. The main program for generating the detailed BOL listing.
  7. Likely an RPG or CL program that processes the sorted BB750S file and other reference files to produce the report.
  8. Called in the second part of the OCL program.

Summary

  • Purpose: The BB750 OCL program generates a detailed Open Railcar BOL Listing by Order. It first sorts the BOL data (BBBOL) using #GSORT into a temporary file (BB750S), then runs the BB750 program to produce the report using sorted data and additional reference files.
  • Process Flow:
  • Sets up company selection criteria ('O COAC' or 'O*CO*C') based on a parameter.
  • Sorts the BBBOL file by company, order, and sequence, excluding deleted records, into BB750S.
  • Executes BB750 to generate the detailed report using BB750S and reference files (ARCUST, SHIPTO, GSCONT, BICONT, GSCTUM).
  • Business Rules:
  • Filters out deleted records and selects records by company code.
  • Sorts data by order number and additional sequence fields.
  • Uses multiple files to enrich the report with customer, shipping, and control data.
  • Files Used: BBBOL (input), BB750S (sorted output), ARCUST (customer), SHIPTO (shipping), GSCONT (control), BICONT (inventory), GSCTUM (unit of measure).
  • External Programs: #GSORT (sort utility) and BB750 (report generator).

If you have the RPG code for BB750 or file layouts for BBBOL, ARCUST, etc., I can provide further details on the report’s content or processing logic!