Skip to content

BB110E RPG36

Process Steps of the RPG Program BB110E

This RPG III program (for IBM i/AS/400 systems) serves as a "busy screen" or waiting/interruptible display for order entry processes, specifically related to picking tickets and confirmations. It displays a screen to the user, likely indicating that a background process is active (e.g., "checking" or "processing"), and monitors for user input, particularly a cancel action. The program uses indicators (flags) to control flow and screen behavior. Below is a step-by-step breakdown of the execution flow based on the code structure (H, F, I, C, O specifications):

  1. Program Initialization:
  2. The program starts with header (H) specifications, defining it as BB110E with some parameters (e.g., P016, B – possibly print or batch options, but not central to logic).
  3. File (F) specifications define a single workstation file named SCREEN (display file for interactive user interface), with a record length of 500 bytes, attached to the WORKSTN device (terminal or emulator).

  4. Input Handling:

  5. Input (I) specifications define the screen format SCREEN as non-sequential (NS) under indicator 01.
  6. A data structure (UDS-like) maps positions 300-305 on the input record to a field named CANCEL (likely a 6-character field to detect user input like "/CANCEL").

  7. Calculation Logic (Main Processing):

  8. Under indicator 01 and 10, if not KG (a function key indicator, possibly F3 or F12 for cancel), set off indicator 10. This prepares for redisplay or continuation.
  9. If KG is on (cancel key pressed):
    • Move the literal 'CANCEL' into the CANCEL field.
    • Set off indicators 01 and 10 (reset display/processing flags).
    • Set on the Last Record (LR) indicator, which signals the program to end gracefully.
  10. If indicator 09 is off (N09), set on indicators 10 and 09. This might enable error highlighting or alternate screen behavior (e.g., for invalid input or busy state).

  11. Output and Display:

  12. Output (O) specifications define detail output (D) to the SCREEN file under indicators 01 and 10.
  13. Outputs a constant or format name 'BB110EFM' associated with K8 (possibly a function key or format identifier for the display file DDS). This likely displays a formatted screen (e.g., a message like "Processing... Press Cancel to stop").
  14. The screen is displayed to the user, and the program waits for input (e.g., EXFMT implied in workstation file handling).

  15. Program Termination:

  16. If cancel is detected (via KG), the program ends via LR indicator.
  17. Otherwise, it may loop or redisplay based on indicators (though no explicit loop; typical in RPG for interactive programs via indicator-controlled EXFMT cycles).
  18. No error handling or complex loops are present; it's a simple modal display for interrupting a process.

The program runs in a cycle typical of RPG: Read input → Calculate → Output → Repeat until LR. It's designed to be called from an OCL (as noted), run briefly to show a status screen, and return control (possibly with CANCEL value indicating interruption).

Business Rules

  • Purpose: Acts as a user-interruptible "busy" indicator during order entry workflows (e.g., generating picking tickets or confirmations). It prevents user interaction with the main system while processing occurs but allows cancellation.
  • Cancel Handling: If the user presses a designated cancel key (KG), the program sets CANCEL to 'CANCEL' and terminates. This value is likely checked by the calling OCL to abort the batch or process (e.g., order confirmation generation).
  • Indicator Usage:
  • 01: Controls input/output for the main screen format.
  • 09: Possibly for error or alternate state (set on if not already active).
  • 10: Toggles display/processing (set off on entry, set on for busy/error).
  • KG: Function key for cancel (business rule: Allow user to interrupt long-running order processes to avoid timeouts or unwanted completions).
  • Interactivity: The screen must be responsive; no long computations here – it's purely for UI feedback during external processing.
  • Data Integrity: No database updates; it's read-only for user input. Business implication: Safe for concurrent use in multi-user order entry systems.
  • Assumptions: Relies on external DDS (Display Data Description) for SCREEN file (not shown in code) to define actual screen layout (e.g., messages, fields). The 'BB110EFM' likely references a format in that DDS.

Tables Used

  • SCREEN: A workstation display file (not a database table). Used for interactive input/output with the user terminal. No physical database files (PF) are defined or accessed; all operations are screen-based.

No database tables (e.g., PF-DTA) are used for reading/writing data. The program is UI-focused.

External Programs Called

None. The program contains no CALL, EXSR (external subroutine), or other opcodes that invoke external programs or procedures. It operates standalone, likely returning control to the calling OCL via LR or cancel detection.