AR137B OCL
The provided AR137B.ocl36.txt is an Operation Control Language (OCL) script used in IBM i (AS/400) systems, invoked by the AR137.ocl36.txt OCL script as part of the EFT (Electronic Funds Transfer) draft notice filtering process. This script is responsible for generating the final EFT reports for each EFT customer. Below, I’ll explain the process steps, business rules, tables (files) used, and external programs called, ensuring a clear and concise analysis.
Process Steps of the AR137B OCL Program¶
The AR137B OCL script is designed to execute a program that produces EFT reports, directing output to specific print queues based on the environment. Here’s a step-by-step breakdown of its execution:
- Load AR136B Program:
-
// LOAD AR136B:- Loads the
AR136Bprogram into memory for execution. Note that the filenameAR137B.ocl36.txtsuggests an intent to loadAR137B, but the script specifiesAR136B, which may indicate a typo or a legacy naming convention. For consistency with the EFT process, it’s likely intended to beAR137B.
- Loads the
-
File Definitions:
-
The script defines the following files for the
AR136B(or intendedAR137B) program:FILE NAME-AREFTD,LABEL-?9?E?L'110,6'?,DISP-SHR:- Defines the
AREFTDfile, labeled as?9?E?L'110,6'?, where?L'110,6'?is the update date from the Local Data Area (LDA, positions 110-115) prefixed by ‘E’ and?9?for the library. - Opened in shared mode (
DISP-SHR) for reading transaction data. FILE NAME-AREFTD,LABEL-?9?AREFTX,DISP-SHR:- Defines another instance of
AREFTD, labeled as?9?AREFTX, also in shared mode. - Likely a filtered or alternate transaction file.
FILE NAME-ARCONT,LABEL-?9?ARCONT,DISP-SHR:- Defines the
ARCONTfile, labeled as?9?ARCONT, in shared mode. - Contains accounts receivable control data.
FILE NAME-ARCUST,LABEL-?9?ARCUST,DISP-SHR:- Defines the
ARCUSTfile, labeled as?9?ARCUST, in shared mode. - Contains customer data for EFT processing.
FILE NAME-ARCUFMX,LABEL-?9?ARCUFMX,DISP-SHR:- Defines the
ARCUFMXfile, labeled as?9?ARCUFMX, in shared mode. - Contains customer format data, including email addresses for EFT notices.
FILE NAME-ARDTWSC,LABEL-?9?ARDTGGC,RETAIN-T,RECORDS-50:- Defines the
ARDTWSCfile, labeled as?9?ARDTGGC, with temporary retention (RETAIN-T) and a capacity of 50 records. - Contains email address counts for EFT customers, generated by
AR137E.
-
Printer File Overrides:
- The script sets up printer file overrides to direct report output to specific output queues based on the environment parameter
?9?:- If
?9?is ‘G’ (likely a production environment): OVRPRTF FILE(LIST1) OUTQ(QUSRSYS/EFTEMALOTQ) CPI(12): DirectsLIST1output to theEFTEMALOTQqueue with 12 characters per inch (CPI).- Similarly for
LIST2,LIST3, andLIST4. - If
?9?is not ‘G’ (likely a test environment): OVRPRTF FILE(LIST1) OUTQ(QUSRSYS/TESTOUTQ) CPI(12): DirectsLIST1output to theTESTOUTQqueue with 12 CPI.- Similarly for
LIST2,LIST3, andLIST4.
- If
-
These overrides ensure that EFT reports are sent to the appropriate print queue for production or testing.
-
Run the Program:
// RUN:- Executes the
AR136B(or intendedAR137B) program, which processes the transaction data (AREFTDorAREFTX), usesARCONTandARCUSTfor reference data,ARCUFMXfor email addresses, andARDTWSCfor email address counts, and generates EFT reports for each EFT customer. - The reports are output to the specified queues (
EFTEMALOTQorTESTOUTQ) via printer filesLIST1toLIST4.
- Executes the
Business Rules¶
The AR137B OCL script enforces the following business rules:
- Dynamic File Naming:
- File names use the
?9?prefix for the library and?L'110,6'?for the update date, ensuring the correct transaction file is processed based on input from theAR137Pprogram. -
This supports flexibility across different environments or libraries.
-
File Access:
- All input files (
AREFTD,AREFTX,ARCONT,ARCUST,ARCUFMX) are opened in shared mode (DISP-SHR), allowing concurrent access by multiple jobs. -
The
ARDTWSCfile is temporary (RETAIN-T) with a 50-record limit, used for email address counts. -
Output Queue Selection:
- Reports are directed to
EFTEMALOTQfor production (?9? = 'G') orTESTOUTQfor testing (?9? ≠ 'G'), ensuring appropriate routing based on the environment. -
All reports use a consistent 12 CPI format for readability.
-
Report Generation:
- The
AR136B(or intendedAR137B) program generates EFT reports for each EFT customer, using transaction data, customer details, control data, and email address counts. - Reports are likely formatted for printing or electronic distribution (e.g., via email, based on
ARCUFMXdata).
Integration with AR137 OCL Script¶
The AR137B OCL script is invoked by the AR137.ocl36.txt script as part of the EFT draft notice filtering process, following the execution of AR137A and AR137E. The AR137 script:
- Prepares the transaction data (AREFTD, AREFTX) and summary data (AREFTS) via AR137A.
- Generates email address counts in ARDTWSC via AR137E.
- Passes these files to AR137B (or AR136B as specified) to produce the final EFT reports.
The update date (?L'110,6'?, KYUPDT from the LDA) links back to the AR137P program’s validation, ensuring consistency. The ARDTWSC file (labeled ?9?ARDTGGC) contains email counts from AR137E, used to determine how EFT notices are distributed.
Tables (Files) Used¶
The script uses the following files:
- AREFTD (labeled
?9?E?L'110,6'?and?9?AREFTX): - Type: Input (shared mode).
-
Purpose: Contains EFT transaction data, either the full set (
?9?E?L'110,6'?) or a filtered set (?9?AREFTX). -
ARCONT (labeled
?9?ARCONT): - Type: Input (shared mode).
-
Purpose: Contains accounts receivable control data for company validation.
-
ARCUST (labeled
?9?ARCUST): - Type: Input (shared mode).
-
Purpose: Contains customer data for EFT customer details (e.g., names, addresses).
-
ARCUFMX (labeled
?9?ARCUFMX): - Type: Input (shared mode).
-
Purpose: Contains customer format data, including email addresses for EFT notices.
-
ARDTWSC (labeled
?9?ARDTGGC): - Type: Input/Output (temporary, 50 records, shared mode).
- Purpose: Contains email address counts for EFT customers, generated by
AR137E.
External Programs Called¶
The script invokes the following external program:
- AR136B (likely intended as
AR137B): - Loaded and executed via
// LOAD AR136Band// RUN. - Processes transaction data (
AREFTD,AREFTX), control data (ARCONT), customer data (ARCUST), format data (ARCUFMX), and email counts (ARDTWSC) to generate EFT reports for each customer.
Summary¶
The AR137B OCL script (despite referencing AR136B, likely a typo for AR137B) is the final step in the EFT draft notice process, executing a program to generate EFT reports for each customer. It uses transaction, control, customer, and email address data, directing output to production or test print queues based on the environment. The script ensures proper file access and report formatting for the EFT process.
Tables Used: AREFTD (two instances: ?9?E?L'110,6'? and ?9?AREFTX), ARCONT, ARCUST, ARCUFMX, ARDTWSC.
External Programs Called: AR136B (likely intended as AR137B).