Skip to content

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:

  1. Program Identification and Initial Setup:
  2. // 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.
  3. // 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 to 0.
  4. // LOCAL BLANK-*ALL: Clears all local variables, ensuring no residual data from previous runs affects the current execution.
  5. // 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.

  6. File Loading:

  7. The // LOAD BI944P statement initiates the loading of the program or procedure named BI944P. This could be an RPG program or another executable that performs the core logic of generating the Customer Sales Agreement Master File Listing.
  8. 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).
  9. These files are labeled with ?9? prefixes, suggesting the library or system identifier is dynamically substituted at runtime.

  10. Program Execution:

  11. // 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. The BI944P 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).

  12. Conditional Logic:

  13. // IF SWITCH1-1 GOTO END: Checks if the first switch bit (SWITCH1) is set to 1. If true, the program branches to the END 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).
  14. // IF ?L'328,1'?/Y JOBQ ?CLIB?,BI944,,,,,,,,,?9?: This conditional statement checks a system indicator or variable at location L'328,1' (likely a memory location or flag in the system’s Local Data Area). If the value is Y, the program submits a job named BI944 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.
  15. // ELSE BI944 ,,,,,,,,?9?: If the condition is not met (i.e., L'328,1' is not Y), the program directly calls BI944 with the ?9? parameter, likely executing it immediately in the current job rather than submitting it to a job queue.

  16. End of Processing:

  17. // TAG END: Marks the END label, where the program jumps if the SWITCH1-1 condition is true. This effectively terminates the procedure early.
  18. // SWITCH 00000000: Resets the switch register to all zeros, ensuring a clean state for any subsequent processing or cleanup.
  19. // 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 that BI944P is the main program executed to process the customer sales agreement data.
  • In the conditional logic (JOBQ ?CLIB?,BI944 or BI944 ,,,,,,,,?9?), suggesting that BI944 may be a related program or a variation of BI944P called under specific conditions (e.g., a different execution mode or a follow-up job).
  • It’s possible that BI944 and BI944P are the same program, with BI944P being the OCL procedure and BI944 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:

  1. BICONT: Control file, possibly containing configuration or processing parameters.
  2. GSTABL: General system table, likely used for lookup or reference data.
  3. ARCUST: Customer master file, containing customer-related data (e.g., sales agreements or account details).
  4. INLOC: Location file, possibly containing inventory or location-specific data.
  5. 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'); if Y, submit BI944 to the job queue; otherwise, call BI944 directly.
  • Reset switches and clear variables at the end.

  • External Programs Called:

  • BI944P (main program loaded and run).
  • BI944 (called conditionally, possibly the same as BI944P 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.