BI945P OCL
The document provided is an OCL (Operation Control Language) program file, BI945P.ocl36.txt
, which appears to be used for managing a customer sales agreement master file listing in an IBM midrange system environment (likely AS/400 or iSeries). OCL is a scripting language used to control job execution, file operations, and program calls on these systems. Below, I’ll explain the process steps of the program, identify external programs called, and list the tables used, based on the provided document.
Process Steps of the RPG .OCL Program¶
The OCL program BI945P
outlines a sequence of steps for processing and managing data related to a customer sales agreement master file. Here’s a breakdown of the steps based on the document:
- Initial Setup and Configuration:
// SCPROCP ,,,,,,,,?9?
: This likely specifies a procedure or program context, with?9?
being a placeholder for a parameter or variable (possibly a library or environment identifier).// SWITCH 00000000
: Sets the program’s switch settings to a default state (all switches off). Switches are used to control conditional logic within the program.-
// LOCAL BLANK-*ALL
: Clears all local variables or sets them to blank, ensuring a clean state for the program execution. -
Data Upload Instructions:
-
The comments indicate a process for uploading data:
**** UPLOAD THE TABLE FROM THE PRICING APP
: Data is sourced from a pricing application.**** UPLOAD CSV WILL NEED TO BE COPIED TO GPRSABLN SPREADSHEET FOR DATA TRANSFER TO WORK
: A CSV file must be copied to a spreadsheet namedGPRSABLN
for data transfer. This suggests a manual or semi-automated step where data is prepared in a spreadsheet format.**** THEN RUN BI942F PROC TO CREATE THE DATA IN GPRSABLO*****NO LONGER NEEDED
: Previously, a procedureBI942F
was used to transfer data to theGPRSABLO
table, but this step is now obsolete.**** UPLOADING DIRECTLY TO GPRSABLO TABLE BEFORE THIS PROCEDURE IS RUN
: The process has been updated to upload data directly to theGPRSABLO
table before runningBI945P
. This indicates that the input data is already in theGPRSABLO
table when the program starts.
-
File Loading:
// LOAD BI945P
: Loads theBI945P
program or procedure into memory for execution.// FILE NAME-PRSABLX,LABEL-?9?PRSABLX,DISP-SHRRM
:- Specifies a file named
PRSABLX
to be used in the program. LABEL-?9?PRSABLX
suggests that the file is labeled with a prefix or library (replacing?9?
with an actual value at runtime).DISP-SHRRM
indicates the file is opened in shared read mode (SHRRM
), allowing multiple processes to read the file simultaneously without write access.
- Specifies a file named
-
// RUN
: Initiates the execution of theBI945P
program, which likely processes the data in thePRSABLX
file. -
Conditional Job Execution:
// IF ?L'328,1'?/Y JOBQ ?CLIB?,BI9445,,,,,,,,,?9?
:- Checks a condition based on the value of a local variable or parameter at position 328, character 1 (
?L'328,1'?
). If the condition evaluates toY
(yes): - Submits a job to a job queue (
JOBQ
) in the library specified by?CLIB?
(a placeholder for the actual library name). - Calls the program or procedure
BI9445
, passing parameters (with?9?
as a placeholder).
- Checks a condition based on the value of a local variable or parameter at position 328, character 1 (
// ELSE BI9445 ,,,,,,,,?9?
:- If the condition is not
Y
, the programBI9445
is called directly (without submitting to a job queue), with the same parameter structure.
- If the condition is not
-
This conditional logic determines whether
BI9445
runs synchronously or asynchronously via a job queue. -
End of Program:
// TAG END
: Marks the end of a program section or the entire OCL script.// SWITCH 00000000
: Resets switches to their default state (all off).// LOCAL BLANK-*ALL
: Clears all local variables again, ensuring no residual data affects subsequent processes.
External Programs Called¶
The OCL program references the following external programs or procedures:
1. BI942F:
- Mentioned in a comment as a previously used procedure to create data in the GPRSABLO
table. It is no longer needed, as data is now uploaded directly to GPRSABLO
.
- Not actively called in the current script but referenced for historical context.
2. BI9445:
- Called either directly or submitted to a job queue based on the conditional logic (IF ?L'328,1'?/Y
).
- Parameters are passed to BI9445
, with ?9?
indicating a placeholder for a runtime value.
Tables Used¶
The document references the following tables (or files) used in the process:
1. GPRSABLN:
- A spreadsheet or intermediate file where the CSV data from the pricing app is copied before being transferred to the GPRSABLO
table (though this step may be obsolete based on the comments).
2. GPRSABLO:
- The target table where data is uploaded directly before the BI945P
procedure runs. This table likely stores the customer sales agreement master file data.
3. PRSABLX:
- The primary file used by the BI945P
program, specified in the // FILE
statement. It is accessed in shared read mode (DISP-SHRRM
) and is likely the source of data processed by the program. The label ?9?PRSABLX
suggests it resides in a library specified at runtime.
Summary¶
The BI945P
OCL program is designed to process customer sales agreement data in an IBM midrange environment. The key steps involve:
- Setting up the environment (switches and local variables).
- Loading and processing the PRSABLX
file.
- Conditionally calling the BI9445
program, either directly or via a job queue.
- Relying on pre-uploaded data in the GPRSABLO
table, with historical references to GPRSABLN
and the BI942F
procedure (no longer used).
External Programs Called:
- BI9445
(actively called).
- BI942F
(referenced, but obsolete).
Tables Used:
- GPRSABLO
(primary data table).
- GPRSABLN
(intermediate spreadsheet, likely obsolete).
- PRSABLX
(file processed by the program).
If you have additional details (e.g., the contents of BI9445
or the structure of the tables), I can provide a more detailed analysis of their roles in the process.