BB005 RPG36
Process Steps of the RPG Program (BB005.rpg36.txt)¶
This RPG III program (BB005) releases or posts a selected order entry batch by updating the batch control record in BBBTCH. It is called from the main OCL procedure (BB201.ocl36.txt) in the "Release Batch" section at the end, after processing/unlocking orders. The program chains to the batch record using the batch number from the LDA (local data area) and conditionally updates fields based on the program mode (PGM). It uses exception outputs (EXCPT) to perform the updates, which modify specific positions in the record (e.g., lock status, delete flag, printed flag, record count). The process is non-interactive and executes once per call.
High-level process steps:
- Record Lookup:
- Chains to BBBTCH using BATCH# (from UDS positions 490-491) as the key.
-
If the record is not found (indicator 99 on), no action is taken (DO block skipped).
-
Conditional Update Based on Mode (If Record Found, N99):
- Checks the PGM value (from UDS position 504):
- If 'O' (likely order entry mode): Executes EXCPT REL to release the batch.
- If 'L' (likely pick list mode): Executes EXCPT PICK to release after pick list.
- If 'B' (likely BOL print mode): Executes EXCPT BOL to release after BOL printing.
- If 'P' (post mode): Executes EXCPT POST to mark as posted and deleted.
- Default (any other PGM): Falls back to EXCPT REL.
-
Each EXCPT updates the BBBTCH record by writing specific values to positions:
- REL/PICK: Position 6 = ' ' (clear lock?), 8 = ' ' (clear WSID?), 39 = RECCNT (update record count from UDS 475-482).
- BOL: Same as REL but position 9 = 'Y' (BOL printed flag).
- POST: Position 1 = 'D' (delete flag), 6 = 'P' (posted flag), 39 = RECCNT.
-
End of Processing:
- Sets LR on to end the program.
- No further actions; the update is committed via the exception output.
Business Rules¶
- Batch Update Logic:
- Only updates if the batch record exists (N99).
- Clears locks/WSID (positions 6 and 8) for release modes ('O', 'L', 'B', default), allowing the batch to be reused or deleted.
- Marks BOL printed ('Y' in position 9) only for 'B' mode.
- For posting ('P'): Soft-deletes the batch ('D' in position 1) and marks as posted ('P' in position 6), preventing further use.
- Always updates the record count (ABREC in position 39) with RECCNT from LDA, reflecting the final count after processing.
- Modes (PGM):
- 'O': Release after order entry (clear locks).
- 'L': Release after pick list generation.
- 'B': Release after BOL printing, with printed flag.
- 'P': Post batch (delete and mark posted).
- Other: Default to basic release.
- No Validation/Errors: Assumes valid BATCH# and PGM from caller (OCL/LDA). No explicit error handling beyond not-found (99 on, skipped).
- Atomic Update: Uses exception outputs for targeted position updates, ensuring minimal changes.
Tables Used (Files)¶
The program uses one disk file, defined in the F-specs:
- BBBTCH: Update combined (UC), 48 bytes, record address type (R 2AI), disk file. Batch control records, chained and updated via exception outputs.
External Programs Called¶
None. The program contains no CALL opcodes or references to external programs. It operates independently using file I/O and internal logic.