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:
- Initialization and Environment Setup:
-
// GSY2K: Likely a system or environment setup command, possibly related to Y2K compliance or system configuration. -
Conditional Local Variable Setup:
// 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).
- Checks if the parameter at position 103 (length 3) equals
-
// 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).
- If false, sets the local variable to
-
Sort Operation:
// LOAD #GSORT:- Loads the
#GSORTutility, a system program for sorting data files.
- Loads the
- 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).
// RUN:- Executes the
#GSORTutility 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).
- Defines a sort operation with a header (
- 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 9NECindicates sorting on positions 4-9 (likely order number) with no equal comparison (NEC).
- Sorts on multiple fields, each starting with a 3-byte field (
- Inclusion Criteria:
I C 1 1NECD: Includes records where position 1 is not equal to'D'(likely excluding deleted records, asBCDEL = 'D'indicates deletion inBICONT).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 namedCOMPANY.FNC 4 9 ORDER: Maps positions 4-9 to a field namedORDER.FNC 10 12 SEQUENCE: Maps positions 10-12 to a field namedSEQUENCE.FDC 1 512: Copies the entire 512-byte record from position 1.
- Executes the
-
// END: Completes the sort operation, producing the sorted fileBB750S. -
Report Generation:
// LOAD BB750:- Loads the
BB750program (likely an RPG or CL program) to generate the detailed BOL listing.
- Loads the
- 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 asBBBOL. // 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.
// RUN:- Executes the
BB750program to generate the detailed BOL listing using the sortedBB750Sfile and other reference files.
- Executes the
Business Rules¶
- Selection Criteria:
- If the parameter at position 103 equals
'SEL', the program uses'O COAC'for company selection (specific company or account). -
Otherwise, it uses
'O*CO*C'(likely a wildcard for all companies or a default selection). -
Sort Logic:
- Excludes records where position 1 equals
'D'(likely a delete flag, consistent withBCDELinBICONT). - Includes records where the company code (positions 2-3) matches the parameter at position 101.
- Sorts primarily by order number (positions 4-9) and additional fields (positions 106, 112, etc., likely order line or sequence numbers) in ascending order.
-
Outputs fields for company, order, sequence, and the full 512-byte record.
-
File Usage:
- The input BOL data (
BBBOL) is sorted intoBB750Sfor ordered processing. -
The report program (
BB750) uses multiple files (ARCUST,SHIPTO,GSCONT,BICONT,GSCTUM) to enrich the BOL listing with customer, shipping, and control data. -
Data Retention:
-
The sorted file
BB750Sis retained as a job file (RETAIN-J), ensuring it’s available for the duration of the job but not permanently. -
Report Generation:
- The detailed report is generated only if the
KYDETLflag (fromBB750P.rpg36.txt) is'Y', as determined by the calling OCL (BB750P.ocl36.txt). - The report likely includes detailed order information, customer details, and shipping information, based on the files accessed.
Tables/Files Used¶
- BBBOL:
- Input file for the sort operation, containing raw BOL data.
- Label:
?9?BBBOL, opened in shared mode (DISP-SHR). -
Used by
#GSORTas the input file and byBB750as the sorted file (BB750S). -
BB750S:
- Temporary output file from the sort operation, containing sorted BOL data.
- Label:
?9?BB750S, with a capacity of 999,000 records, extendable, and retained as a job file (RETAIN-J). -
Used as the input (
BBBOL) for theBB750program. -
ARCUST:
- Customer file, likely containing customer master data (e.g., names, addresses).
- Label:
?9?ARCUST, opened in shared mode. -
Used by
BB750for customer-related information in the report. -
SHIPTO:
- Ship-to file, containing shipping address or destination data.
- Label:
?9?SHIPTO, opened in shared mode. -
Used by
BB750for shipping details in the report. -
GSCONT:
- Control file, likely containing system or configuration data.
- Label:
?9?GSCONT, opened in shared mode. -
Used by
BB750for control or reference data. -
BICONT:
- Inventory control file, containing railcar or company data.
- Label:
?9?BICONT, opened in shared mode. -
Used by
BB750for validation or additional railcar details (consistent with its use inBB750P.rpg36.txt). -
GSCTUM:
- Unit of measure or control file, possibly for measurement or formatting data.
- Label:
?9?GSCTUM, opened in shared mode. - Used by
BB750for formatting or unit-related data in the report.
External Programs Called¶
- #GSORT:
- A system utility program for sorting data files.
- Used to sort the
BBBOLfile intoBB750Sbased on company, order, and sequence fields. -
Called in the first part of the OCL program.
-
BB750:
- The main program for generating the detailed BOL listing.
- Likely an RPG or CL program that processes the sorted
BB750Sfile and other reference files to produce the report. - Called in the second part of the OCL program.
Summary¶
- Purpose: The
BB750OCL program generates a detailed Open Railcar BOL Listing by Order. It first sorts the BOL data (BBBOL) using#GSORTinto a temporary file (BB750S), then runs theBB750program 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
BBBOLfile by company, order, and sequence, excluding deleted records, intoBB750S. - Executes
BB750to generate the detailed report usingBB750Sand 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) andBB750(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!