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:
- Comment Block:
1 2 3 4
** ** EFT CUSTOMER(S) ACCCOUNTS RECEIVABLE DUE REPORT ** PRINTS THE EFT REPORT (ELECTRONIC FUNDS TRANSFER FOR EACH EFT CUSTOMER) ** -
This describes the purpose: generating a report for EFT customers’ Accounts Receivable due amounts, likely listing transactions or summaries for EFT processing.
-
Load Program
AR135B:1// LOAD AR135B -
Loads the
AR135BRPG program into memory for execution. -
Define File
CRTRAN:1// FILE NAME-CRTRAN,LABEL-?9?E?L'110,6'?,DISP-SHR - Specifies the
CRTRANfile with a dynamic label (?9?E?L'110,6'?, e.g.,PRODE123456if?9?isPRODand?L'110,6'?is123456). DISP-SHRindicates shared access, allowing concurrent use by other programs or jobs.-
CRTRANis the EFT transaction workfile containing transaction details. -
Run the Program:
1// RUN - Executes the loaded
AR135BRPG program, which processes theCRTRANfile 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:
- File and Data Definitions:
- Files:
CRTRANis defined as an update file (UP) with a record length of 256 bytes, keyed on position 2 (likely company and customer or sequence).
- Input Specifications:
- Defines fields in
CRTRANsuch asATDEL(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.
- Defines fields in
-
UDS:
- Defines control fields:
KYCO(company),STATUS,KYUPDT(update date),Y2KCEN(Y2K century),Y2KCMP(Y2K comparison).
- Defines control fields:
-
Main Processing Logic:
- The program operates under a condition (
*IN01indicator, likely set by the OCL or system state). - 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 toUPDTSV(a 6-digit save field). - Checks if
KYSEDT(select date) is non-zero; if so, moves it toSEDTSV(another 6-digit save field).
- Checks if
-
Output Record:
1C EXCPT- Writes or updates a record to
CRTRANusing theE(exception) output specification.
- Writes or updates a record to
-
Output Specifications:
1 2 3
OCRTRAN E O UPDTSV 233 O SEDTSV 239 - Updates the
CRTRANfile, writingUPDTSVto positions 228-233 andSEDTSVto positions 234-239. -
These fields likely represent updated transaction or select dates for EFT processing.
-
Program Termination:
- The program ends after processing the
CRTRANrecord, 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:
- OCL Program (AR135B.ocl36.txt):
- Dynamic File Labeling: Uses
?9?(e.g.,PROD) and?L'110,6'?(e.g.,123456) for theCRTRANfile label, ensuring flexibility across environments (e.g., production, test). - Shared Access: Opens
CRTRANin shared mode (DISP-SHR), allowing concurrent access by other jobs or programs, critical for multi-user EFT processing. -
Report Context: The comment indicates the program supports an EFT report, but the RPG logic suggests
AR135Bupdates transaction records, likely preparing data for a report generated elsewhere. -
RPG Program (AR135B.rpg36.txt):
- Date Updates:
- Updates
CRTRANwithKYUPDT(update date) andKYSEDT(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.
- Updates
- Conditional Processing:
- Only executes if
*IN01is on, suggesting control by the OCL caller or system state. - Checks for non-zero dates to avoid overwriting valid data with blanks.
- Only executes if
- Data Integrity:
- Updates specific fields (
UPDTSV,SEDTSV) inCRTRANwithout modifying other transaction data (e.g., amount, customer, G/L accounts). - Ensures accurate date tracking for EFT transactions.
- Updates specific fields (
- EFT Context:
- Part of EFT draft automation, likely preparing transaction records for downstream processing (e.g., bank file generation or reporting in
AR135A).
- Part of EFT draft automation, likely preparing transaction records for downstream processing (e.g., bank file generation or reporting in
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
AR135BviaLOADandRUN. -
No other external programs or procedures are invoked.
-
RPG Program (AR135B.rpg36.txt):
- Does not explicitly call any external programs or procedures (no
CALLoperations). - Uses internal exception output (
EXCPT) to updateCRTRAN. - 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.