Skip to content

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:

  1. Load AR136B Program:
  2. // LOAD AR136B:

    • Loads the AR136B program into memory for execution. Note that the filename AR137B.ocl36.txt suggests an intent to load AR137B, but the script specifies AR136B, which may indicate a typo or a legacy naming convention. For consistency with the EFT process, it’s likely intended to be AR137B.
  3. File Definitions:

  4. The script defines the following files for the AR136B (or intended AR137B) program:

    • FILE NAME-AREFTD,LABEL-?9?E?L'110,6'?,DISP-SHR:
    • Defines the AREFTD file, 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 ARCONT file, labeled as ?9?ARCONT, in shared mode.
    • Contains accounts receivable control data.
    • FILE NAME-ARCUST,LABEL-?9?ARCUST,DISP-SHR:
    • Defines the ARCUST file, labeled as ?9?ARCUST, in shared mode.
    • Contains customer data for EFT processing.
    • FILE NAME-ARCUFMX,LABEL-?9?ARCUFMX,DISP-SHR:
    • Defines the ARCUFMX file, 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 ARDTWSC file, 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.
  5. Printer File Overrides:

  6. 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): Directs LIST1 output to the EFTEMALOTQ queue with 12 characters per inch (CPI).
    • Similarly for LIST2, LIST3, and LIST4.
    • If ?9? is not ‘G’ (likely a test environment):
    • OVRPRTF FILE(LIST1) OUTQ(QUSRSYS/TESTOUTQ) CPI(12): Directs LIST1 output to the TESTOUTQ queue with 12 CPI.
    • Similarly for LIST2, LIST3, and LIST4.
  7. These overrides ensure that EFT reports are sent to the appropriate print queue for production or testing.

  8. Run the Program:

  9. // RUN:
    • Executes the AR136B (or intended AR137B) program, which processes the transaction data (AREFTD or AREFTX), uses ARCONT and ARCUST for reference data, ARCUFMX for email addresses, and ARDTWSC for email address counts, and generates EFT reports for each EFT customer.
    • The reports are output to the specified queues (EFTEMALOTQ or TESTOUTQ) via printer files LIST1 to LIST4.

Business Rules

The AR137B OCL script enforces the following business rules:

  1. Dynamic File Naming:
  2. 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 the AR137P program.
  3. This supports flexibility across different environments or libraries.

  4. File Access:

  5. All input files (AREFTD, AREFTX, ARCONT, ARCUST, ARCUFMX) are opened in shared mode (DISP-SHR), allowing concurrent access by multiple jobs.
  6. The ARDTWSC file is temporary (RETAIN-T) with a 50-record limit, used for email address counts.

  7. Output Queue Selection:

  8. Reports are directed to EFTEMALOTQ for production (?9? = 'G') or TESTOUTQ for testing (?9? ≠ 'G'), ensuring appropriate routing based on the environment.
  9. All reports use a consistent 12 CPI format for readability.

  10. Report Generation:

  11. The AR136B (or intended AR137B) program generates EFT reports for each EFT customer, using transaction data, customer details, control data, and email address counts.
  12. Reports are likely formatted for printing or electronic distribution (e.g., via email, based on ARCUFMX data).

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:

  1. AREFTD (labeled ?9?E?L'110,6'? and ?9?AREFTX):
  2. Type: Input (shared mode).
  3. Purpose: Contains EFT transaction data, either the full set (?9?E?L'110,6'?) or a filtered set (?9?AREFTX).

  4. ARCONT (labeled ?9?ARCONT):

  5. Type: Input (shared mode).
  6. Purpose: Contains accounts receivable control data for company validation.

  7. ARCUST (labeled ?9?ARCUST):

  8. Type: Input (shared mode).
  9. Purpose: Contains customer data for EFT customer details (e.g., names, addresses).

  10. ARCUFMX (labeled ?9?ARCUFMX):

  11. Type: Input (shared mode).
  12. Purpose: Contains customer format data, including email addresses for EFT notices.

  13. ARDTWSC (labeled ?9?ARDTGGC):

  14. Type: Input/Output (temporary, 50 records, shared mode).
  15. Purpose: Contains email address counts for EFT customers, generated by AR137E.

External Programs Called

The script invokes the following external program:

  1. AR136B (likely intended as AR137B):
  2. Loaded and executed via // LOAD AR136B and // RUN.
  3. 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).