Skip to content

AR135B OCL RPG36

The provided documents include an OCL program (AR135B.ocl36.txt) and an RPG program (AR135B.rpg36.txt) that are part of the Accounts Receivable (AR) Electronic Funds Transfer (EFT) draft automation process. The OCL program loads and runs the RPG program, which processes EFT transaction data to produce a report or update transaction records. Below, I will explain the process steps, business rules, tables used, and external programs called for both the OCL and RPG programs.


Process Steps of the AR135B OCL Program

The OCL program (AR135B.ocl36.txt) is a simple script that sets up and executes the AR135B RPG program. Here are the steps:

  1. Comment Block:
    1
    2
    3
    4
    **
    ** EFT CUSTOMER(S) ACCCOUNTS RECEIVABLE DUE REPORT
    ** PRINTS THE EFT REPORT (ELECTRONIC FUNDS TRANSFER FOR EACH EFT CUSTOMER)
    **
    
  2. This describes the purpose: generating a report for EFT customers’ Accounts Receivable due amounts, likely listing transactions or summaries for EFT processing.

  3. Load Program AR135B:

    1
    // LOAD AR135B
    

  4. Loads the AR135B RPG program into memory for execution.

  5. Define File CRTRAN:

    1
    // FILE NAME-CRTRAN,LABEL-?9?E?L'110,6'?,DISP-SHR
    

  6. Specifies the CRTRAN file with a dynamic label (?9?E?L'110,6'?, e.g., PRODE123456 if ?9? is PROD and ?L'110,6'? is 123456).
  7. DISP-SHR indicates shared access, allowing concurrent use by other programs or jobs.
  8. CRTRAN is the EFT transaction workfile containing transaction details.

  9. Run the Program:

    1
    // RUN
    

  10. Executes the loaded AR135B RPG program, which processes the CRTRAN file to generate the EFT report or update records.

Process Steps of the AR135B RPG Program

The AR135B RPG program is a System/36-style fixed-format RPG program designed to process EFT transactions and update the CRTRAN file with date fields. It operates on the CRTRAN file and uses data from the User Data Structure (UDS) for control parameters. Here’s a step-by-step breakdown of the RPG program’s logic:

  1. File and Data Definitions:
  2. Files:
    • CRTRAN is defined as an update file (UP) with a record length of 256 bytes, keyed on position 2 (likely company and customer or sequence).
  3. Input Specifications:
    • Defines fields in CRTRAN such as ATDEL (delete flag), ATCO (company), ATCUST (customer), ATINV# (invoice), ATAMT (amount), ATDISC (discount), ATTYPE (type), ATDATE (date), ATGLCR (credit G/L), ATGLDR (debit G/L), ATDESC (description), ATDUDT (due date), ATTERM (terms), ATCODI (discount company), ATGLDI (discount G/L), ATCOCR (credit company), ATCODR (debit company), ATNOD (notification of difference), and additional date fields (ADTXCN, ADTXYY, ADTXMM, ADTXDD, ADDUD8, DISCY, DISMD).
    • KYSEDT (positions 234-239) is a key field for the select date.
  4. UDS:

    • Defines control fields: KYCO (company), STATUS, KYUPDT (update date), Y2KCEN (Y2K century), Y2KCMP (Y2K comparison).
  5. Main Processing Logic:

  6. The program operates under a condition (*IN01 indicator, likely set by the OCL or system state).
  7. Conditional Update of Dates:
    1
    2
    3
    4
    5
    6
    7
    C   01                DO
    C           KYUPDT    IFNE *ZEROS
    C                     Z-ADDKYUPDT    UPDTSV  60
    C                     END
    C           KYSEDT    IFNE *ZEROS
    C                     Z-ADDKYSEDT    SEDTSV  60
    C                     END
    
    • Checks if KYUPDT (update date) is non-zero; if so, moves it to UPDTSV (a 6-digit save field).
    • Checks if KYSEDT (select date) is non-zero; if so, moves it to SEDTSV (another 6-digit save field).
  8. Output Record:

    1
    C                     EXCPT
    

    • Writes or updates a record to CRTRAN using the E (exception) output specification.
  9. Output Specifications:

    1
    2
    3
    OCRTRAN  E
    O                         UPDTSV   233
    O                         SEDTSV   239
    

  10. Updates the CRTRAN file, writing UPDTSV to positions 228-233 and SEDTSV to positions 234-239.
  11. These fields likely represent updated transaction or select dates for EFT processing.

  12. Program Termination:

  13. The program ends after processing the CRTRAN record, returning control to the calling OCL program.

The program is simple and focused: it reads control data from UDS, updates date fields in CRTRAN, and writes the modified record. It does not interact with a workstation or produce a report directly, despite the OCL comment suggesting a report. The report may be generated by a subsequent program or process (e.g., AR135A).


Business Rules

The OCL and RPG programs enforce the following business rules, inferred from their structure and context:

  1. OCL Program (AR135B.ocl36.txt):
  2. Dynamic File Labeling: Uses ?9? (e.g., PROD) and ?L'110,6'? (e.g., 123456) for the CRTRAN file label, ensuring flexibility across environments (e.g., production, test).
  3. Shared Access: Opens CRTRAN in shared mode (DISP-SHR), allowing concurrent access by other jobs or programs, critical for multi-user EFT processing.
  4. Report Context: The comment indicates the program supports an EFT report, but the RPG logic suggests AR135B updates transaction records, likely preparing data for a report generated elsewhere.

  5. RPG Program (AR135B.rpg36.txt):

  6. Date Updates:
    • Updates CRTRAN with KYUPDT (update date) and KYSEDT (select date) from UDS, only if non-zero.
    • These dates are critical for EFT processing, possibly marking when transactions were processed or selected for transfer.
  7. Conditional Processing:
    • Only executes if *IN01 is on, suggesting control by the OCL caller or system state.
    • Checks for non-zero dates to avoid overwriting valid data with blanks.
  8. Data Integrity:
    • Updates specific fields (UPDTSV, SEDTSV) in CRTRAN without modifying other transaction data (e.g., amount, customer, G/L accounts).
    • Ensures accurate date tracking for EFT transactions.
  9. EFT Context:
    • Part of EFT draft automation, likely preparing transaction records for downstream processing (e.g., bank file generation or reporting in AR135A).

Tables/Files Used

The programs use the following file:

File Name Type Record Length Key Location Usage/Description
CRTRAN Update File (UP) 256 2 EFT transaction workfile; stores transaction details (company, customer, invoice, amount, discount, type, dates, G/L accounts, description). Updated with UPDTSV (update date) and SEDTSV (select date).
  • OCL Context: The file is labeled dynamically (?9?E?L'110,6'?, e.g., PRODE123456) and opened in shared mode (DISP-SHR).
  • RPG Context: The file is defined with fields for transaction data, including dates (ATDATE, ATDUDT, ADDUD8), G/L accounts, and flags (ATDEL, ATNOD).

No other files are referenced in either program.


External Programs Called

  • OCL Program (AR135B.ocl36.txt):
  • Calls the RPG program AR135B via LOAD and RUN.
  • No other external programs or procedures are invoked.

  • RPG Program (AR135B.rpg36.txt):

  • Does not explicitly call any external programs or procedures (no CALL operations).
  • Uses internal exception output (EXCPT) to update CRTRAN.
  • Relies on the calling OCL program for setup and control.

Summary

OCL Program (AR135B.ocl36.txt): - Process Steps: Loads AR135B, opens CRTRAN with a dynamic label in shared mode, and runs the program. - Business Rules: Ensures flexible file access across environments and supports concurrent processing. Prepares for an EFT report, though the RPG logic focuses on data updates. - Files Used: CRTRAN. - External Programs: Calls AR135B.

RPG Program (AR135B.rpg36.txt): - Process Steps: Reads control data from UDS, checks and moves non-zero KYUPDT and KYSEDT to save fields, updates CRTRAN with these dates, and writes the record. - Business Rules: Updates transaction dates for EFT processing, ensuring non-zero values are applied to maintain data integrity. Operates conditionally based on *IN01. - Files Used: CRTRAN. - External Programs: None.

The AR135B programs are a small but critical part of the EFT process, updating transaction dates in CRTRAN to prepare for reporting or further processing (likely by AR135A). The OCL sets up the environment, while the RPG performs targeted updates. If you need details on AR135A or the report output, additional source files would be required.