BB101 OCL
The provided document is an Operation Control Language (OCL) program, specifically BB101.ocl36.txt
, which appears to be part of an IBM System/38 or AS/400 (now IBM i) environment for managing order entry processes. OCL is used to control job execution, define file operations, and invoke programs. Below is a detailed explanation of the process steps, followed by a list of external programs called and tables (files) used.
Process Steps of the RPG .OCL Program¶
The OCL program BB101.ocl36.txt
is structured to handle order entry, batch selection, and batch release processes. It includes file definitions, conditional logic, printer overrides, and calls to external programs. Here’s a step-by-step breakdown of the process:
- Initial Setup and Program Invocation:
- The program starts by calling
STRPCOCLP
, likely a utility or initialization program to set up the environment for the order entry process. -
Comments indicate the program is related to "ORDER ENTRY" and includes temporary modifications by "JIMMY K."
-
Order Batch Selection:
- Local Variables Setup:
- Defines local variables at specific offsets (e.g.,
OFFSET-470,DATA-'?13?'
,OFFSET-494,DATA-'?USER?'
) to store runtime parameters such as batch type (?13?
), user ID (?USER?
), workstation (?WS?
), and mode (O
for Order Entry). - Conditionally sets a display message at
OFFSET-60
based on the value of?13?
: - If
?13?
is blank, displays " ORDER ENTRY ". - If
?13?
isPP
, displays " VISCOSITY ASN ENTRY ". - If
?13?
isPM
, displays " PRODUCT MOVES ENTRY ".
- Defines local variables at specific offsets (e.g.,
- Switch Logic:
- Defines a switch (
SWITCH 0XXXXXXX
) whereSWITCH1
is used to control batch deletion logic.
- Defines a switch (
- File Loading and Execution:
- Loads program
BB001
and defines filesBBBTCH
andBBBTCHX
(likely batch header files) with the label?9?BBBTCH
and shared disposition (DISP-SHR
). - Executes the program (
RUN
).
- Loads program
- Conditional Exit:
- If the condition
?L'121,6'?/CANCEL
is true (checking a specific field for the value "CANCEL"), the program returns, halting further execution.
- If the condition
-
Batch Deletion Logic:
- Evaluates
P20
with the value from?L'490,2'?
(a 2-character field at position 490). - If
SWITCH1
is set (i.e.,SWITCH1-1
): - Calls programs
BB215
andBB003
with*ALL
parameters. - Deletes records from files
?9?BBOR?20?
and?9?BBOX?20?
if they exist (DATAF1-?9?BBOR?20?
andDATAF1-?9?BBOX?20?
). - Resets program
BB101
with*ALL
parameters.
- Evaluates
-
Order Entry Processing:
- Temporary Setup:
- Sets a local variable at
OFFSET-101
to'10'
. - Defines
IN110
with parametersINTZH
andINTZXX
for files with labels?9?
,WK
,HOLD
,FUT
. - Calls program
IN805BC
, likely for additional processing or validation.
- Sets a local variable at
- File Creation:
- Conditionally creates files
?9?BBOR?20?
and?9?BBOX?20?
usingBLDFILE
if they exist, with specifications for 999,000 records, 512-byte record length, and other attributes.
- Conditionally creates files
- File Definitions:
- Loads program
BB101
and defines multiple files with shared disposition (DISP-SHR
), including: - Order-related files:
BBORTR
,BBORTRX
,BBORDR
,BBORDRH
,BBTRTX
,BBORTX
. - Customer-related files:
BICONT
,ARCUSTX
,EDICUS
,ARCOMMX
,ARCUST
,ARCUSP
,SHIPTO
. - Inventory and pricing files:
BIPRTX
,GSTABL
,INFRMP
,GLMAST
,INTANK
,INTAN2
. - Additional files for specific purposes:
BBOTHS1
,BBOTDS1
,BBOTA1
,BBORHS1
,BBORDS1
,BBORA1
,BBFRPR
,GSMLCD
,BBDATE
,GSCNTRA
,SA5SHS
,BBORDHZ
,SA5SHQ
,BBORDHU
. - Defines files for called programs (e.g.,
BB1011
,BB1012
,BB1013
, etc.), includingGSUMCV
,PRCNTR
,BBPRCE
,BBBCPR
,BICUAX
,BICUAY
,SA5FIZD
,ARCUPR
,BBORCL
,ARCUST2
,ARCLGR
,BBORDHC
,GSCTUM
,BBCSR
,BBSLSM
,INLOC
,BBSHSA1
,BICUFR
,GSCTWT
,BBCFSH
,BBCFSD1
,BBNDFI2
,BBTRANIN
,BBORF
,BBTRF
,BBCAID
,GSCNTR1
,GSPRCT
,FROF
,FROFH
,FROFCL1
,FROFC
,FROFCH
,GSTABL6
,GSCNTR6
,ARCUP16
,ARCUP36
,GSPRD6
,BICUF1
,BBTRDS1I
,BBPRXR
,BBPRXY
,BBPRXZ
,SHPADR
,CUADR
,ARCUSX
,BBORDD
,SA5FIUD
,SA5SHZ
,BBOH2
,BBOH3
,BBOH
,BBOHMS
,BBORDB
,BBORDH
,BBORDI
,BBORDM
,BBORDO
,BBPRCY
,BICUA6
,GSPROD
,BBRCSC2
,BBCNOR
,BBORPX
,GSCNTR
,INCONT
,INMTAJ
,INMTRDY
,INTKRV
,BBSHSA
,BBOTA
,BBBLA
,BBTRA
,BBSHSARD
,BBOTARD
,BBBLARD
,BBTRARD
.
- Loads program
- Printer Overrides:
- Overrides printer files
JBLIST
andLIST198J
to output queueQUSRSYS/CREDLIMIT
. - Conditionally overrides
CREMAL
andSMEMAL
to output queuesCSROUTQ
,SLMNOUTQ
, orTESTOUTQ
if?9?
equalsG
. - Defines a printer
BUGS
with devicePJ
and priority0
.
- Overrides printer files
-
Execution:
- Runs the program (
RUN
) after defining files and overrides.
- Runs the program (
-
Release Batch:
- Sets a local variable at
OFFSET-475
to?F'A,?9?BBOR?20?'?
. - Loads program
BB005
and defines fileBBBTCH
with label?9?BBBTCH
and shared disposition. - Executes the program (
RUN
). - Clears all local variables (
LOCAL BLANK-*ALL
).
External Programs Called¶
The OCL program calls the following external programs:
1. STRPCOCLP: Initializes the environment for order entry.
2. BB001: Handles order batch selection.
3. BB215: Called during batch deletion if SWITCH1
is set.
4. BB003: Called during batch deletion if SWITCH1
is set.
5. IN805BC: Called for additional processing in the order entry section.
6. BB005: Handles batch release.
7. BB1011: Associated with file definitions for pricing, customer, and inventory data.
8. BB1012: Associated with customer pricing data (ARCUPR
).
9. BB1013: Associated with order and customer data processing.
10. BB1014: Associated with location data (INLOC
).
11. BB1015: Associated with shipment data (BBSHSA1
).
12. BB1016: Associated with customer and pricing data (ARCUP16
, ARCUP36
).
13. BB106: Associated with freight and inventory data.
14. BB1018: Associated with pricing data (BBPRXR
, BBPRXY
, BBPRXZ
).
15. SHPAD1R: Associated with shipping address data (SHPADR
).
16. CUADR1R: Associated with customer address data (CUADR
).
17. MCSTSHP: Associated with customer data (ARCUSX
).
18. BB115: Associated with order and shipment data.
19. BB117: Associated with order header and master data.
20. BB801: Associated with order data processing.
21. AR822R: Associated with pricing and customer data.
22. MBBQTY: Associated with product and quantity data.
23. BB104A: Associated with contract order data (BBCNOR
).
24. IN805: Associated with inventory and contract data.
25. BI9005: Associated with shipment and billing data.
Tables (Files) Used¶
The program references numerous files (tables) for data processing, all defined with shared disposition (DISP-SHR
) unless otherwise noted. Below is a comprehensive list of the files used:
- BBBTCH: Batch header file (
?9?BBBTCH
). - BBBTCHX: Alternate batch header file (
?9?BBBTCH
). - BBORTR: Order transaction file (
?9?BBOR?20?
,EXTEND-100
). - BBORTRX: Alternate order transaction file (
?9?BBOR?20?
). - BBORDR: Order detail file (
?9?BBORDR
). - BBORDRH: Order header file (
?9?BBORDH
). - BBTRTX: Transaction file (
?9?BBOX?20?
,EXTEND-50
). - BBORTX: Order transaction file (
?9?BBORTX
). - BICONT: Customer contract file (
?9?BICONT
). - ARCUSTX: Customer extension file (
?9?ARCUSX
). - EDICUS: EDI customer file (
?9?EDICUS
). - ARCOMMX: Customer communication file (
?9?ARCOMMX
). - ARCUST: Customer master file (
?9?ARCUST
). - ARCUSP: Customer pricing file (
?9?ARCUSP
). - SHIPTO: Ship-to address file (
?9?SHIPTO
). - BIPRTX: Product pricing file (
?9?BIPRTX
). - GSTABL: General system table (
?9?GSTABL
). - INFRMP: Inventory formula file (
?9?INFRMP
). - GLMAST: General ledger master file (
?9?GLMAST
). - INTANK: Inventory tank file (
?9?INTANK
). - INTAN2: Secondary inventory tank file (
?9?INTAN2
). - BBOTHS1: Order transaction history file (
?9?BBOTHS1
). - BBOTDS1: Order detail history file (
?9?BBOTDS1
). - BBOTA1: Order transaction file (
?9?BBOTA1
). - BBORHS1: Order header history file (
?9?BBORHS1
). - BBORDS1: Order detail file (
?9?BBORDS1
). - BBORA1: Order alternate file (
?9?BBORA1
). - BBFRPR: Freight pricing file (
?9?BBFRPR
). - GSMLCD: System calendar file (
?9?GSMLCD
). - BBDATE: Date file (
?9?BBDATE
). - GSCNTRA: Contract file (
?9?GSCNTR1
). - SA5SHS: Shipment history file (
?9?SA5SHS
). - BBORDHZ: Order header file (
?9?BBORDHZ
). - SA5SHQ: Shipment queue file (
?9?SA5SHQ
). - BBORDHU: Order header unit file (
?9?BBORDHU
). - GSUMCV: Customer summary file (
?9?GSUMCV
). - PRCNTR: Pricing control file (
?9?PRCNTR
). - BBPRCE: Pricing file (
?9?BBPRCE
). - BBBCPR: Contract pricing file (
?9?BBBCPR
). - BICUAX: Customer auxiliary file (
?9?BICUAX
). - BICUAY: Customer auxiliary file (
?9?BICUAY
). - SA5FIZD: Shipment detail file (
?9?SA5FIZD
). - ARCUPR: Customer pricing file (
?9?ARCUPR
). - BBORCL: Order close file (
?9?BBORCL
). - BBORTRC: Order transaction file (
?9?BBOR?20?
). - ARCUST2: Customer master file (
?9?ARCUST
). - ARCLGR: Customer ledger file (
?9?ARCLGR
). - BBORDHC: Order header file (
?9?BBORDH
). - GSCTUM: Customer master file (
?9?GSCTUM
). - BBCSR: Customer service file (
?9?BBCSR
). - BBSLSM: Sales master file (
?9?BBSLSM
). - INLOC: Inventory location file (
?9?INLOC
). - BBSHSA1: Shipment file (
?9?BBSHSA1
). - BICUFR: Freight customer file (
?9?BICUFR
). - GSCTWT: Contract weight file (
?9?GSCTWT
). - BBCFSH: Freight shipment file (
?9?BBCFSH
). - BBCFSD1: Freight shipment detail file (
?9?BBCFSD1
). - BBNDFI2: Non-delivery file (
?9?BBNDFI2
). - BBTRANIN: Transaction input file (
?9?BBTRAN
,EXTEND-100
). - BBORF: Order freight file (
?9?BBORF
). - BBTRF: Transaction freight file (
?9?BBTRF
). - BBCAID: Carrier ID file (
?9?BBCAID
). - GSCNTR1: Contract file (
?9?GSCNTR1
). - GSPRCT: Product contract file (
?9?GSPRCT
). - FROF: Freight order file (
?9?FROF
). - FROFH: Freight order header file (
?9?FROFH
). - FROFCL1: Freight order close file (
?9?FROFCL1
). - FROFC: Freight order file (
?9?FROFC
). - FROFCH: Freight order header file (
?9?FROFCH
). - GSTABL6: System table (
?9?GSTABL
). - GSCNTR6: Contract file (
?9?GSCNTR1
). - ARCUP16: Customer pricing file (
?9?ARCUP1
). - ARCUP36: Customer pricing file (
?9?ARCUP3
). - GSPRD6: Product file (
?9?GSPRD6
). - BICUF1: Freight customer file (
?9?BICUF1
). - BBTRDS1I: Transaction detail file (
?9?BBTRDS1
). - BBPRXR: Pricing file (
?9?BBPRXR
). - BBPRXY: Pricing file (
?9?BBPRXY
). - BBPRXZ: Pricing file (
?9?BBPRXZ
). - SHPADR: Shipping address file (
?9?SHPADR
). - CUADR: Customer address file (
?9?CUADR
). - ARCUSX: Customer extension file (
?9?ARCUSX
). - BBORDD: Order detail file (
?9?BBORDD
). - SA5FIUD: Shipment detail file (
?9?SA5FIUD
). - SA5SHZ: Shipment file (
?9?SA5SHZ
). - BBOH2: Order header file (
?9?BBOH2
). - BBOH3: Order header file (
?9?BBOH3
). - BBOH: Order header file (
?9?BBOH
). - BBOHMS: Order header master file (
?9?BBOHMS
). - BBORDB: Order detail file (
?9?BBORDB
). - BBORDH: Order header file (
?9?BBORDH
). - BBORDI: Order item file (
?9?BBORDI
). - BBORDM: Order master file (
?9?BBORDM
). - BBORDO: Order file (
?9?BBORDO
). - BBPRCY: Pricing file (
?9?BBPRCY
). - BICUA6: Customer auxiliary file (
?9?BICUA6
). - GSPROD: Product file (
?9?GSPROD
). - BBRCSC2: Contract file (
?9?BBRCSC2
). - BBCNOR: Contract order file (
?9?BBCNOR
). - BBORPX: Order pricing file (
?9?BBORPX
). - GSCNTR: Contract file (
?9?GSCNTR
). - INCONT: Inventory contract file (
?9?INCONT
). - INMTAJ: Inventory adjustment file (
?9?INMTAJ
). - INMTRDY: Inventory ready file (
?9?INMTRDY
). - INTKRV: Inventory tank file (
?9?INTKRV
). - BBSHSA: Shipment file (
?9?BBSHSA
). - BBOTA: Order transaction file (
?9?BBOTA
). - BBBLA: Billing file (
?9?BBBLA
). - BBTRA: Transaction file (
?9?BBTRA
). - BBSHSARD: Shipment file (
?9?BBSHSA
). - BBOTARD: Order transaction file (
?9?BBOTA
). - BBBLARD: Billing file (
?9?BBBLA
). - BBTRARD: Transaction file (
?9?BBTRA
). - SA5MOVD3: Movement detail file (
?9?SA5MOVD3
, overridden viaOVRDBF
).
Summary¶
The BB101.ocl36.txt
OCL program manages order entry, batch selection, and batch release processes in an IBM midrange system. It initializes the environment, handles batch selection with conditional logic for display messages and batch deletion, processes order entry with extensive file operations, and releases batches. The program interacts with numerous files for orders, customers, inventory, pricing, and shipments, and calls multiple external programs to perform specific tasks. The use of dynamic file labels (e.g., ?9?
, ?20?
) and conditional logic (IF
, IFF
) allows flexibility in handling different environments and batch types.