BI944P OCL
The provided document is an Operation Control Language (OCL) program, specifically BI944P.ocl36.txt
, used in IBM midrange systems like the AS/400 (now IBM i) to manage batch processing tasks, such as generating a Customer Sales Agreement Master File Listing. OCL is a scripting language used to control job execution, file handling, and program flow in these systems. Below, I’ll explain the process steps of the OCL program, identify any external programs called, and list the tables (files) used.
Process Steps of the OCL Program¶
The OCL program defines a sequence of steps to set up the environment, load necessary files, execute a program, and control job flow based on conditions. Here’s a step-by-step breakdown of the process:
- Program Identification and Initial Setup:
// SCPROCP ,,,,,,,,?9?
: This line likely identifies the procedure or program context, with?9?
being a placeholder for a parameter or variable (possibly a library or system identifier). In OCL, such placeholders are often replaced at runtime with specific values.// SWITCH 00000000
: Initializes a switch register to all zeros. Switches in OCL are used as flags to control program flow (e.g., conditional branching). Here, all eight switch bits are set to0
.// LOCAL BLANK-*ALL
: Clears all local variables, ensuring no residual data from previous runs affects the current execution.-
// GSY2K
: Likely a comment or directive related to system configuration (possibly Year 2000 compliance or a specific system module), but it doesn’t directly impact the execution flow. -
File Loading:
- The
// LOAD BI944P
statement initiates the loading of the program or procedure namedBI944P
. This could be an RPG program or another executable that performs the core logic of generating the Customer Sales Agreement Master File Listing. - The following
// FILE
statements define the input files required for the program, specifying their names, labels, and access mode (DISP-SHRRM
, indicating shared read mode, allowing multiple processes to read the files concurrently):BICONT
: Likely a control file containing configuration or control data for the process.GSTABL
: A table file, possibly containing general system data or lookup tables.ARCUST
: A customer file, likely containing customer master data (e.g., customer IDs, names, or sales agreement details).INLOC
: A location file, possibly containing inventory or location-specific data.GSPROD
: A product file, likely containing product master data (e.g., product codes or descriptions).
-
These files are labeled with
?9?
prefixes, suggesting the library or system identifier is dynamically substituted at runtime. -
Program Execution:
-
// RUN
: Executes the loaded program (BI944P
). This is where the actual processing of the Customer Sales Agreement Master File Listing occurs, using the files specified above. TheBI944P
program (likely an RPG program) would process the data from the input files to generate the required output (e.g., a report or updated master file). -
Conditional Logic:
// IF SWITCH1-1 GOTO END
: Checks if the first switch bit (SWITCH1) is set to1
. If true, the program branches to theEND
tag, skipping further execution. This suggests a conditional exit mechanism, possibly to bypass processing if a certain condition is met (e.g., a prior error or specific configuration).// IF ?L'328,1'?/Y JOBQ ?CLIB?,BI944,,,,,,,,,?9?
: This conditional statement checks a system indicator or variable at locationL'328,1'
(likely a memory location or flag in the system’s Local Data Area). If the value isY
, the program submits a job namedBI944
to the job queue in the library?CLIB?
(a placeholder for the actual library name), with parameters including the?9?
identifier. This could be used to schedule a follow-up job or retry the process.-
// ELSE BI944 ,,,,,,,,?9?
: If the condition is not met (i.e.,L'328,1'
is notY
), the program directly callsBI944
with the?9?
parameter, likely executing it immediately in the current job rather than submitting it to a job queue. -
End of Processing:
// TAG END
: Marks theEND
label, where the program jumps if theSWITCH1-1
condition is true. This effectively terminates the procedure early.// SWITCH 00000000
: Resets the switch register to all zeros, ensuring a clean state for any subsequent processing or cleanup.// LOCAL BLANK-*ALL
: Clears all local variables again, ensuring no residual data remains after execution.
External Programs Called¶
- BI944: This is the primary program or procedure explicitly called in the OCL script. It is referenced in two contexts:
- As part of the
// LOAD BI944P
and// RUN
sequence, indicating thatBI944P
is the main program executed to process the customer sales agreement data. - In the conditional logic (
JOBQ ?CLIB?,BI944
orBI944 ,,,,,,,,?9?
), suggesting thatBI944
may be a related program or a variation ofBI944P
called under specific conditions (e.g., a different execution mode or a follow-up job). - It’s possible that
BI944
andBI944P
are the same program, withBI944P
being the OCL procedure andBI944
being the underlying RPG or executable program. However, without further context, I’ll treat them as potentially distinct.
Tables (Files) Used¶
The OCL program specifies the following files, which are likely used as input tables or data sources by the BI944P
program:
- BICONT: Control file, possibly containing configuration or processing parameters.
- GSTABL: General system table, likely used for lookup or reference data.
- ARCUST: Customer master file, containing customer-related data (e.g., sales agreements or account details).
- INLOC: Location file, possibly containing inventory or location-specific data.
- GSPROD: Product master file, containing_ROE containing product-related data.
Summary¶
- Process Steps:
- Initialize switches and clear local variables.
- Load the
BI944P
program and specify input files (BICONT
,GSTABL
,ARCUST
,INLOC
,GSPROD
). - Execute the
BI944P
program to process the customer sales agreement data. - Check if
SWITCH1
is set; if so, skip to the end. - Check a system indicator (
L'328,1'
); ifY
, submitBI944
to the job queue; otherwise, callBI944
directly. -
Reset switches and clear variables at the end.
-
External Programs Called:
BI944P
(main program loaded and run).-
BI944
(called conditionally, possibly the same asBI944P
or a related program). -
Tables Used:
BICONT
GSTABL
ARCUST
INLOC
GSPROD
This OCL program sets up and controls the execution of a batch process for generating a customer sales agreement master file listing, leveraging the specified files and conditional logic to manage job flow. If you need further details about the RPG program (BI944P
or BI944
) or specific file structures, please provide additional context or files, as RPG program logic isn’t included in the OCL script.