BB215 RPG36
Process Steps of the RPG Program (BB215.rpg36.txt)¶
The RPG III program (BB215) is designed to remove lockout fields from the order header file (BBORDRH) based on transaction records from the batch file (BBORTR). It processes header records to clear the lockout code (BOLOCK) and workstation ID (BOWSID) fields, effectively unlocking open orders. The program is simple, with a straightforward loop that reads transaction records, matches them to order headers, and updates the corresponding fields. It is called from the main OCL procedure (BB201.ocl36.txt) in the "Unlock Open Orders" section.
High-level process steps:
- Initialization:
- On the first pass (ONCE = 0), initializes variables:
- Sets LOCK (1-character) to blanks.
- Sets WSID (2-character) to blanks.
- Sets ONCE to 1 to prevent re-initialization.
-
This ensures that the lockout fields are cleared only once at the start.
-
Header Record Processing:
- Reads records from BBORTR (primary input file, NS 01 specifies header records).
- Extracts the key BOCOS (positions 2-12, likely company + order#) from the transaction record.
- Chains to BBORDRH using BOCOS to locate the matching order header record.
-
If the record is found (indicator 90 off), proceeds to update.
-
Update Lockout Fields:
- Updates the BBORDRH record for the matched order:
- Sets BOLOCK (position 155) to the blank value in LOCK.
- Sets BOWSID (positions 156-157) to the blank value in WSID.
-
Writes the updated record to BBORDRH (output specification OBBORDRH with D for detail, conditioned on 01 and N90).
-
End of Processing:
- Continues reading BBORTR until end-of-file.
- No further actions are taken for non-header records (NS 09 is defined but unused).
Business Rules¶
- Lockout Removal:
- The program clears two specific fields in the order header (BBORDRH):
- BOLOCK (lockout code, 1 character, position 155): Set to blank to remove any lockout status.
- BOWSID (workstation ID, 2 characters, positions 156-157): Set to blanks to clear the workstation that locked the order.
- Only header records (NS 01) from BBORTR trigger updates.
- Matching:
- Uses BOCOS (company + order#, positions 2-12) as the key to match transaction records to order headers.
- Updates only if the order exists in BBORDRH (N90, i.e., chain successful).
- Scope:
- Processes one order at a time, updating only the lockout fields.
- No validation or conditional logic beyond record existence.
- No Output Reports:
- No printing or logging; updates are silent.
- Error Handling:
- If no matching BBORDRH record is found (indicator 90 on), no action is taken for that transaction.
Tables Used (Files)¶
The program uses two disk files, defined in the F-specs:
- BBORTR: Input primary (IP), 512 bytes, fixed format, disk file. Contains transaction batch records (only header records processed).
- BBORDRH: Update combined (UC), 512 bytes, record address type (R) with alternate index (11AI), disk file. Stores open order headers, updated to clear lockout fields.
External Programs Called¶
None. The program contains no CALL opcodes or references to external programs. It operates independently, relying solely on file I/O and internal logic.