BI9412 RPG36
The provided RPG program, BI9412.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 clearing the salesman number field (setting it to '00'
) for records used in a customer-focused report. Below, I’ll explain the process steps, business rules, tables used, and external programs called.
Process Steps of the BI9412 RPG Program¶
The program is straightforward, reading records from the BICUAGXX
file and updating the salesman number field to '00'
to ensure proper sorting for a customer report. Here’s a detailed breakdown of the process steps:
- File and Data Structure Definitions (Lines 0002–0010):
- Header (H) Specification:
064
: Likely a program option or parameter.- Program name:
BI9412
.
- File Specifications (F):
BICUAGXX
: Update file (258 bytes, disk) containing customer sales agreement data.
- Input Specifications (I):
BICUAGXX
(record format01
):- Fields:
BACONO
(company number, positions 2–3),BACUST
(customer number, positions 4–9),BACOCU
(company/customer key, positions 2–9).
-
Comment:
- Indicates the program removes the salesman number for customer report purposes.
-
Calculation Specifications (C) (Line 0015):
-
No explicit calculations are performed, as the program’s logic is handled entirely in the output specifications.
-
Output Specifications (O) (Lines 0016–0017):
-
Output to
BICUAGXX
:- Record format
D
(update) is used for eachBICUAGXX
record (record format01
). - Updates position 258 (2 bytes) with the literal value
'00'
, effectively clearing the salesman number.
- Record format
-
Program Termination:
- The program ends after processing all
BICUAGXX
records, updating each with a cleared salesman number.
Business Rules¶
- Salesman Number Clearing:
- For every record in
BICUAGXX
, set the salesman number field (position 258, 2 bytes) to'00'
. -
This ensures the salesman number does not influence sorting in a customer-focused report, as specified in the
BI941.ocl36
context (used when salesman selection isSEL
and sort order isN
). -
Unconditional Update:
-
The update is applied to all records in
BICUAGXX
without any filtering or conditional logic, as no checks are performed in the calculation specifications. -
Data Integrity:
- The program assumes
BICUAGXX
is properly formatted, with a 258-byte record structure, and that position 258 is reserved for the salesman number.
Tables Used¶
The program uses the following file/table:
1. BICUAGXX:
- Update file containing customer sales agreement data.
- Fields: BACONO
(company number), BACUST
(customer number), BACOCU
(company/customer key).
- Updated with '00'
in position 258 (salesman number).
External Programs Called¶
- None:
- The
BI9412
program does not call any external programs. It performs all processing internally, reading and updatingBICUAGXX
.
Summary¶
- Process Steps:
- Define the
BICUAGXX
file for update. - For each
BICUAGXX
record:- Update position 258 with
'00'
to clear the salesman number.
- Update position 258 with
-
Terminate after processing all records.
-
Business Rules:
-
Clear the salesman number (position 258) to
'00'
for allBICUAGXX
records to support customer-focused report sorting. -
Tables Used:
-
BICUAGXX
. -
External Programs Called:
- None.
This program is a simple utility that prepares the BICUAGXX
file for customer report generation by removing salesman-specific data, aligning with the customer sort requirements in the BI941
workflow.