BB705 OCL
The provided document, BB705.ocl36.txt, is an Open Control Language (OCL) program for the IBM System/36, called by the main OCL program BB705P.ocl36.txt to generate a Pending Orders Report. It orchestrates the processing of order data, sorting, and report generation. Below, I’ll explain the process steps, business rules, tables used, and external programs called, referencing the context from the previous OCL (BB705P.ocl36.txt) and RPG (BB705P.rpg36.txt) programs for continuity.
Process Steps of the OCL Program¶
The BB705.ocl36.txt program manages the workflow for generating a pending orders report by location, container, date, and carrier. It involves data preparation, sorting, and report generation. Here’s a step-by-step breakdown:
- Initialization and Configuration:
// GSY2K: Indicates Year 2000 compliance or a specific system configuration (likely for date handling).// IF ?L'118,1'?/Y LOCAL OFFSET-1,DATA-'I*CIAC': If the parameter at position 118 (likelyKYZEYNfromBB705P.rpg36.txt, indicating zero date flag) is 'Y', set a local variable at offset 1 to'I*CIAC'.-
// ELSE LOCAL OFFSET-1,DATA-'IACI*C': IfKYZEYNis not 'Y', set the local variable to'IACI*C'. These values (I*CIACorIACI*C) likely control sort or selection criteria later in the process. -
Delete Temporary Files:
-
// GSDELETE BB705O,BB705S,,,,,,,?9?: Deletes temporary filesBB705OandBB705Sfrom the library specified by?9?to ensure a clean slate for new data. -
Load and Run BB7051 (Data Preparation):
// LOAD BB7051: Loads the programBB7051.// FILE NAME-BBORDR,LABEL-?9?BBORDR,DISP-SHR: Opens theBBORDRfile (order data) in shared read mode.// FILE NAME-BB705O,LABEL-?9?BB705O,RETAIN-T,RECORDS-999000,EXTEND-999000: Defines a temporary output fileBB705Owith a capacity of 999,000 records, marked as temporary (RETAIN-T) and extensible.-
// RUN: ExecutesBB7051, which likely readsBBORDR, applies filters (e.g., based onKYCO,KYLOC,KYFRDT,KYTODT,KYZEYNfromBB705P), and writes filtered order data toBB705O. -
Load and Run #GSORT (Sorting):
// LOAD #GSORT: Loads the system sort utility#GSORT.// FILE NAME-INPUT,LABEL-?9?BB705O,DISP-SHR: UsesBB705O(output fromBB7051) as the input file in shared read mode.// FILE NAME-OUTPUT,LABEL-?9?BB705S,RECORDS-999000,EXTEND-999000,RETAIN-T: Defines a temporary output fileBB705Sfor sorted data, with similar capacity and attributes asBB705O.// RUN: Executes the sort with the following specifications:- Header:
HSORTR 24A 3X 532 N: Defines a sort with a 24-byte header, 3 control fields, a 532-byte record, and no sequence checking (N). - Include Conditions:
I C 1 1NECD: Include records where position 1 is not equal to 'D' (excludes deleted records).IAC 2 3EQC?L'101,2'?: Include records where positions 2-3 equal the company code (KYCO) from position 101-102.?L'4,3'? 516 523EQC00000000: If the location code (KYLOC) from positions 4-6 is non-blank, include records where positions 516-523 (request date) equal zero.?L'1,3'? 516 523GEC?L'169,8'?: If the location code is non-blank, include records where the request date (516-523) is greater than or equal to the from date (FRDT8, positions 169-176).?L'1,3'? 516 523LEC?L'177,8'?: If the location code is non-blank, include records where the request date is less than or equal to the to date (TODT8, positions 177-184).- Sort Fields (ascending,
FNC): - Positions 2-3: Company (
COMPANY). - Positions 513-515: Location temp in header (
LOCATION TEMP IN HEADER). - Positions 516-523: Request date (
REQUEST DATE). - Positions 524-525: Carrier code (
CARRIER CODE). - Positions 4-9: Order number (
ORDER). - Positions 10-12: Sequence (
SEQUENCE). - Data Fields (
FDC): - Positions 1-256: Record data.
- Positions 257-512: Additional record data.
- Positions 513-532: Header or control data.
- Header:
-
Outcome: Sorts
BB705OintoBB705Sbased on company, location, request date, carrier, order, and sequence, applying filters for valid records and date ranges. -
Load and Run BB705 (Report Generation):
// LOAD BB705: Loads theBB705program, which generates the final report.- Files:
BBORDR(sorted data fromBB705S, labeled?9?BB705S, shared read).ARCUST(customer data, shared read).SHIPTO(ship-to address data, shared read).GSCONT(container data, shared read).BICONT(company data, shared read, also used inBB705P).GSCTUM(possibly unit of measure or control data, shared read).INLOC(location data, shared read, also used inBB705P).
-
// RUN: ExecutesBB705, which uses the sorted data and additional files to produce the pending orders report, formatted by location, container, date, and carrier. -
Cleanup:
// GSDELETE BB705O,BB705S,,,,,,,?9?: Deletes the temporary filesBB705OandBB705Safter report generation to free up disk space.
Business Rules¶
The OCL program enforces the following business rules for generating the pending orders report:
- Data Filtering:
- Exclude records marked as deleted (position 1 ≠ 'D').
- Filter by company code (positions 2-3 must match
KYCOfrom position 101-102). -
If a location is specified (
KYLOCnon-blank), filter by:- Zero request date (if
KYZEYN= 'Y', positions 516-523 = 00000000). - Request date within the specified range (
FRDT8≤ date ≤TODT8).
- Zero request date (if
-
Sort Order:
- Sort records by:
- Company (positions 2-3).
- Location (positions 513-515).
- Request date (positions 516-523).
- Carrier code (positions 524-525).
- Order number (positions 4-9).
- Sequence (positions 10-12).
-
This ensures the report is organized hierarchically for easy reading.
-
Temporary File Management:
- Temporary files
BB705OandBB705Sare created and deleted within the job to manage intermediate data. -
Files are allocated with a large capacity (999,000 records) to handle large datasets.
-
Date Range Handling:
- If
KYZEYN= 'Y', only records with a zero request date are included (for special reporting cases). -
Otherwise, records must fall within the user-specified date range (
FRDT8toTODT8). -
File Access:
- All files are opened in shared read mode (
DISP-SHR) to allow concurrent access by other jobs. - The report generation (
BB705) uses multiple files to enrich order data with customer, ship-to, container, and location details.
Tables Used¶
No explicit RPG-style tables (e.g., TABxxx or arrays like COM in BB705P.rpg36.txt) are defined in the OCL program. However, the following files are used as data sources, functioning as tables in the context of the System/36:
- BBORDR: Contains order data, used as input for
BB7051and sorted input (BB705S) forBB705. - BB705O: Temporary file for intermediate data output by
BB7051. - BB705S: Temporary file for sorted data output by
#GSORT. - ARCUST: Customer data, used by
BB705for report details. - SHIPTO: Ship-to address data, used by
BB705. - GSCONT: Container data, used by
BB705. - BICONT: Company data, used by
BB705(also used inBB705Pfor validation). - GSCTUM: Likely unit of measure or control data, used by
BB705. - INLOC: Location data, used by
BB705(also used inBB705Pfor validation).
These files serve as relational tables, providing data for filtering, sorting, and reporting.
External Programs Called¶
- BB7051:
- Purpose: Prepares order data by reading
BBORDR, applying filters (e.g., company, location, date range), and writing toBB705O. -
Called: In the first
LOAD/RUNblock. -
#GSORT:
- Purpose: System sort utility that sorts
BB705OintoBB705Sbased on specified fields and include conditions. -
Called: In the second
LOAD/RUNblock. -
BB705:
- Purpose: Generates the final pending orders report using sorted data (
BB705S) and additional files (ARCUST,SHIPTO,GSCONT,BICONT,GSCTUM,INLOC). -
Called: In the third
LOAD/RUNblock. -
GSDELETE:
- Purpose: System utility to delete temporary files
BB705OandBB705S. - Called: Twice, before and after processing.
Summary¶
- Process Steps:
- Initialize with Y2K settings and set sort criteria based on
KYZEYN. - Delete temporary files
BB705OandBB705S. - Run
BB7051to filter order data fromBBORDRtoBB705O. - Sort
BB705OintoBB705Susing#GSORTby company, location, date, carrier, order, and sequence. - Run
BB705to generate the report using sorted data and additional files. -
Delete temporary files.
-
Business Rules:
- Filter out deleted records and apply company, location, and date range criteria.
- Sort report hierarchically for clarity.
- Manage temporary files to optimize disk usage.
- Support zero-date reporting when
KYZEYN= 'Y'. -
Use shared read mode for concurrent file access.
-
Tables Used:
-
Files:
BBORDR,BB705O,BB705S,ARCUST,SHIPTO,GSCONT,BICONT,GSCTUM,INLOC(function as relational tables). -
External Programs Called:
BB7051(data preparation).#GSORT(sorting utility).BB705(report generation).GSDELETE(file cleanup).
This OCL program integrates with BB705P.rpg36.txt (for input validation) and relies on BB7051 and BB705 to process and report order data. If you have the RPG code for BB7051 or BB705, or file layouts for BBORDR, ARCUST, etc., I can provide further details. Let me know if you need additional analysis or a search for related information!