AR418 OCL
The provided document is an Operation Control Language (OCL) program, specifically AR418.ocl36, which appears to be part of an IBM System/36 environment. OCL is used to control job execution, manage files, and invoke programs. Below, I will explain the process steps of the program, identify the external programs called, and list the tables (files) used .
Process Steps of the AR418.ocl36 Program¶
The OCL program performs a sequence of operations to set up and execute a process related to updating credit limits, likely in an accounts receivable or customer management system. Here’s a step-by-step breakdown of the process:
- Delete All File Overrides:
-
DLTOVR FILE(*ALL): This command removes all existing file overrides to ensure a clean slate for file assignments. -
Call Initial Program (Commented Out):
-
// CALL PGM(GSGENIEC): This line is commented out (indicated by//), so it does not execute. If uncommented, it would call the programGSGENIEC, possibly for initialization or environment setup. -
Conditional Check (Commented Out):
-
// IFF ?L'506,3'?/YES RETURN: This conditional statement is commented out. If active, it would check a specific condition at location 506, position 3 in the local data area. If the condition is met (YES), the program would terminate (RETURN). -
Procedure and Local Variable Setup:
// SCPROCP ,,,,,,,,?9?: This likely invokes a procedure or sets a parameter, with?9?being a placeholder for a runtime value (e.g., a company code or environment identifier).-
// LOCAL BLANK-*ALL: Clears all local variables to ensure no residual data affects the process. -
Check for Active Processes:
-
The program checks if processes
AR880orAR418are already running:IF ACTIVE-AR880: Checks if theAR880process is active.- If true, it displays messages: "EITHER OPTION 18 OR 20 IS ALREADY IN PROGRESS" and "PLEASE TRY AGAIN IN A FEW MINUTES".
- It then prompts the user with
PAUSE 'PRESS 0,ENTER AND JOB WILL CANCEL', allowing the user to cancel the job by entering0. - If active, the program jumps to the
OUTtag, terminating execution. - The same logic applies for
AR418, ensuring that only one instance of these processes runs at a time to avoid conflicts.
-
Environment Setup:
// GSY2K: Likely sets up a Year 2000-compliant environment or calls a procedure to handle date-related settings.-
// SWITCH 00000000: Resets all job switches to0, ensuring a known state for conditional logic. -
Set User Information:
-
// LOCAL OFFSET-103,DATA-'?USER?': Stores the user ID at offset 103 in the local data area, using the runtime value of?USER?. -
File Overrides:
- The program overrides database files to point to specific libraries or files:
OVRDBF FILE(BICONT) TOFILE(QS36F/GBICONT): Overrides theBICONTfile to useQS36F/GBICONT.OVRDBF FILE(BBCSR) TOFILE(QS36F/GBBCSR): Overrides theBBCSRfile to useQS36F/GBBCSR.OVRDBF FILE(BBSLSM) TOFILE(QS36F/GBBSLSM): Overrides theBBSLSMfile to useQS36F/GBBSLSM.
-
These overrides ensure the program accesses the correct files in the
QS36Flibrary. -
Load Program and File Definitions:
// LOAD AR418: Loads the main programAR418, which likely contains the core logic for updating credit limits.-
File definitions (some commented out, others active):
FILE NAME-BICONT,LABEL-?9?BICONT,DISP-SHRRM: Opens theBICONTfile with a label prefixed by the value of?9?(e.g., a company code) in shared read mode.FILE NAME-BBORCL,LABEL-?9?BBORCL,DISP-SHR: Opens theBBORCLfile in shared mode.FILE NAME-ARCUST,LABEL-?9?ARCUST,DISP-SHRMM: Opens theARCUSTfile in shared read/write mode.- Commented-out file definitions for
BBCSRandBBSLSMsuggest they were previously used or are optional.
-
Printer Setup:
// PRINTER NAME-JBLIST,DEVICE-PJ,FORMSNO-JBCL,PRIORITY-0: Configures a printer output for a report namedJBLIST, directed to devicePJwith form numberJBCLand priority0.
-
Conditional Printer Overrides:
// IF ?9?/G OVRPRTF FILE(CREMAL) OUTQ(CSROUTQ): If the parameter?9?equalsG, redirects theCREMALreport to theCSROUTQoutput queue.// IF ?9?/G OVRPRTF FILE(SMEMAL) OUTQ(SLMNOUTQ): Similarly, redirects theSMEMALreport to theSLMNOUTQoutput queue.// IFF ?9?/G OVRPRTF FILE(CREMAL) OUTQ(TESTOUTQ): If?9?is notG, redirectsCREMALto theTESTOUTQoutput queue (for testing).// IFF ?9?/G OVRPRTF FILE(SMEMAL) OUTQ(TESTOUTQ): Similarly, redirectsSMEMALtoTESTOUTQ.
-
Run the Program:
// RUN: Executes the loaded program (AR418).
-
Reset Environment:
// LOCAL BLANK-*ALL: Clears all local variables again.// SWITCH 00000000: Resets job switches to0.
-
Conditional Program Call:
// IF ?9?/G CALL AR418TC: If?9?equalsG, calls the programAR418TC.- A commented-out line
*******CALL AR418TCsuggests this call might have been unconditional in earlier versions.
-
Program Termination:
// TAG OUT: Marks theOUTlabel, where the program jumps ifAR880orAR418is active, or after completing execution.
External Programs Called¶
The OCL program references the following external programs:
- GSGENIEC (commented out):
- Purpose: Likely an initialization or environment setup program, but it is not executed in this version due to being commented out.
- AR418:
- Purpose: The main program loaded and executed, responsible for the core logic of updating credit limits.
- AR418TC:
- Purpose: Called conditionally if
?9?equalsG. Likely a test or cleanup program related to the credit limit update process.
Tables (Files) Used¶
The program interacts with the following files (tables), as defined in the OVRDBF and FILE statements:
- BICONT (
QS36F/GBICONT): - Label:
?9?BICONT(dynamic label based on?9?). - Access: Shared read mode (
DISP-SHRRM). -
Purpose: Likely contains control or configuration data for the credit limit update process.
-
BBORCL:
- Label:
?9?BBORCL. - Access: Shared mode (
DISP-SHR). -
Purpose: Likely stores order or credit limit data.
-
BBCSR (
QS36F/GBBCSR): - Label:
?9?BBCSR(commented out, but implied by override). - Access: Shared read/write mode (
DISP-SHRMMin commented code). -
Purpose: Likely contains customer service representative data or related records.
-
ARCUST:
- Label:
?9?ARCUST. - Access: Shared read/write mode (
DISP-SHRMM). -
Purpose: Likely the customer master file, containing customer details such as credit limits.
-
BBSLSM (
QS36F/GBBSLSM): - Label:
?9?BBSLSM(commented out, but implied by override). - Access: Shared read/write mode (
DISP-SHRMMin commented code). -
Purpose: Likely contains salesman or sales-related data.
-
Output Files:
- CREMAL: Report file, directed to either
CSROUTQorTESTOUTQbased on the value of?9?. - SMEMAL: Report file, directed to either
SLMNOUTQorTESTOUTQbased on the value of?9?. - JBLIST: Report file sent to the printer device
PJwith form numberJBCL.
Summary¶
The AR418.ocl36 program manages the execution of a credit limit update process in a System/36 environment. It:
- Ensures no conflicting processes (AR880 or AR418) are running.
- Sets up the environment by overriding files and configuring printer outputs.
- Loads and runs the main program AR418, with an optional call to AR418TC for specific conditions.
- Uses files like BICONT, BBORCL, BBCSR, ARCUST, and BBSLSM to manage data, and produces reports (CREMAL, SMEMAL, JBLIST).
The program is designed to handle concurrency, support testing environments (via ?9?/G), and ensure proper file and printer configurations.