BI9411 RPG36
The provided RPG program, BI9411.rpg36.txt
, is an RPG III program for IBM System/36 or AS/400, invoked by the BI941.ocl36
OCL program. Its purpose is to update the customer sales agreement work file (BICUAGXX
) by adding the salesman number from the customer master file (ARCUST
). Below, I’ll explain the process steps, business rules, tables used, and external programs called.
Process Steps of the BI9411 RPG Program¶
The program reads records from the BICUAGXX
file, retrieves the corresponding salesman number from the ARCUST
file, and updates the BICUAGXX
record with the salesman number. Here’s a detailed breakdown of the process steps:
- File and Data Structure Definitions (Lines 0002–0012):
- Header (H) Specification:
064
: Likely a program option or parameter.- Program name:
BI9411
.
- File Specifications (F):
BICUAGXX
: Update file (258 bytes, disk) containing customer sales agreement data.ARCUST
: Input file (384 bytes, indexed, 8-byte key, 2 access paths) for customer master data.
- Input Specifications (I):
BICUAGXX
(record format01
):- Fields:
BACONO
(company number, positions 2–3),BACUST
(customer number, positions 4–9),BACOCUL1
(company/customer key, positions 2–9). ARCUST
:- Field:
ARSLS#
(salesman number, positions 263–264, 2 digits, zoned decimal).
-
Comment:
- Indicates the program updates the sales agreement file with the salesman number from the customer master.
-
Calculation Specifications (C) (Lines 0013–0015):
-
Processing Loop (for each
BICUAGXX
record, record format01
):- Chaining to ARCUST:
BACOCU
(combined company/customer key, positions 2–9) is used to chain to theARCUST
file.- If no matching record is found, indicator 91 is set.
- Update Logic:
- If a matching
ARCUST
record is found (indicator 91 off), the program proceeds to update theBICUAGXX
record.
-
Output Specifications (O) (Lines 0016–0017):
-
Output to
BICUAGXX
:- Record format
D
(update) is used when indicator 91 is off (matchingARCUST
record found). - Updates position 258 (2 bytes) with
ARSLS#
(salesman number fromARCUST
).
- Record format
-
Program Termination:
- The program ends after processing all
BICUAGXX
records, updating those with valid salesman numbers fromARCUST
.
Business Rules¶
- Salesman Number Update:
- For each record in
BICUAGXX
, retrieve the salesman number (ARSLS#
) from theARCUST
file using the company (BACONO
) and customer (BACUST
) as the key (BACOCU
). -
Update the
BICUAGXX
record with the salesman number in position 258 only if a matchingARCUST
record is found. -
Record Skipping:
-
If no matching
ARCUST
record is found (indicator 91 on), theBICUAGXX
record is not updated. -
Data Integrity:
- The program assumes
BICUAGXX
andARCUST
are properly formatted, withBACOCU
(company/customer) matching the key structure ofARCUST
.
Tables Used¶
The program uses the following files/tables:
1. BICUAGXX:
- Update file containing customer sales agreement data.
- Fields: BACONO
(company number), BACUST
(customer number), BACOCUL1
(company/customer key).
- Updated with ARSLS#
(salesman number) in position 258.
2. ARCUST:
- Input file containing customer master data.
- Field: ARSLS#
(salesman number).
External Programs Called¶
- None:
- The
BI9411
program does not call any external programs. It performs all processing internally, reading fromARCUST
and updatingBICUAGXX
.
Summary¶
- Process Steps:
- Define files:
BICUAGXX
(update) andARCUST
(input). - For each
BICUAGXX
record:- Chain the company/customer key (
BACOCU
) toARCUST
. - If a matching
ARCUST
record is found, updateBICUAGXX
with the salesman number (ARSLS#
) in position 258.
- Chain the company/customer key (
-
Terminate after processing all records.
-
Business Rules:
- Update
BICUAGXX
records with salesman numbers fromARCUST
based on company/customer key. -
Skip records without a matching
ARCUST
entry. -
Tables Used:
-
BICUAGXX
,ARCUST
. -
External Programs Called:
- None.
This program is a simple, focused utility that enriches the customer sales agreement data with salesman information, preparing it for further processing in the BI941
workflow.