Skip to content

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:

  1. File and Data Structure Definitions (Lines 0002–0010):
  2. Header (H) Specification:
    • 064: Likely a program option or parameter.
    • Program name: BI9412.
  3. File Specifications (F):
    • BICUAGXX: Update file (258 bytes, disk) containing customer sales agreement data.
  4. Input Specifications (I):
    • BICUAGXX (record format 01):
    • Fields: BACONO (company number, positions 2–3), BACUST (customer number, positions 4–9), BACOCU (company/customer key, positions 2–9).
  5. Comment:

    • Indicates the program removes the salesman number for customer report purposes.
  6. Calculation Specifications (C) (Line 0015):

  7. No explicit calculations are performed, as the program’s logic is handled entirely in the output specifications.

  8. Output Specifications (O) (Lines 0016–0017):

  9. Output to BICUAGXX:

    • Record format D (update) is used for each BICUAGXX record (record format 01).
    • Updates position 258 (2 bytes) with the literal value '00', effectively clearing the salesman number.
  10. Program Termination:

  11. The program ends after processing all BICUAGXX records, updating each with a cleared salesman number.

Business Rules

  1. Salesman Number Clearing:
  2. For every record in BICUAGXX, set the salesman number field (position 258, 2 bytes) to '00'.
  3. 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 is SEL and sort order is N).

  4. Unconditional Update:

  5. The update is applied to all records in BICUAGXX without any filtering or conditional logic, as no checks are performed in the calculation specifications.

  6. Data Integrity:

  7. 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 updating BICUAGXX.

Summary

  • Process Steps:
  • Define the BICUAGXX file for update.
  • For each BICUAGXX record:
    • Update position 258 with '00' to clear the salesman number.
  • Terminate after processing all records.

  • Business Rules:

  • Clear the salesman number (position 258) to '00' for all BICUAGXX 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.