Define BLDRUPD Program Actions

Walks you through the process of defining program actions and events using Online Express.
Restriction: This topic applies only when the AppMaster Builder AddPack has been installed, and applies only to Windows platforms.

In AppMaster Builder, you define program logic using Online Express to create events and assign actions to those events. Some actions are pre-defined or reserved by AppMaster Builder, and you can define custom actions as well.

In this session, you define the following actions for the BLDRUPD program:

Action Description
Query Reads database records and moves data to screen fields
Update Updates the records by moving data from screen fields to the records
Delete Deletes database records
Term Terminates the program

The end user executes these database and teleprocessing actions by entering a function code in the screen entry field named Function. Users can also return to the Main Menu program of the application by pressing the F3 function key.

Start the Action/Event Editor

  1. In Online Express on the Control Type list, click Function Field.
  2. On the Control Name list, double-click Function. The Action/Event Editor appears.

Define Query database action

  1. From the Function Field drop-down list box, click Function.
  2. Click Edit > Create. A new function line appears on the Action/Event Editor.
  3. In the Event field, type Q.
  4. From the Action drop-down list, click Reserved.
  5. From the Argument drop-down list, click *QUERY.

Define remaining database actions

  • Repeat steps 2 through 5 in Define Query database action one time for each action listed in the following table, substituting the appropriate event, action, and argument for each:
    Event Action Argument
    U Reserved *UPDATE
    D Reserved *DELETE
    C Reserved *CLEAR
    E Reserved *TERM

Complete program actions

  1. On the Action/Event Editor, click Apply.
  2. Close the Action/Event Editor. The Action/Event Browser shows all assigned actions.

Assign an action to the PF3 key

Previously, you assigned the PF3 key to bypass field edits. In this section, you assign the PF3 key to also escape from the Parts Update program and transfer you back to the Main Menu program.

  1. From the Control Type list, choose KEYS.
  2. On the Control Name list, double-click PF1-PF12. The Action/Event Editor dialog box appears.
  3. Click the PF3 row.
  4. From the Action drop-down list, select XCTL.
  5. In the Argument field, type bldrcmnu.
  6. Click Apply.
  7. Close the Action/Event Editor. The Action/Event Browser reappears.

Code working-storage fields

The screen fields that you created using the Screen Painter and mapped to working-storage fields in a previous session need corresponding working-storage fields in the BLDRUPD program. In Online Express you can code a record for these fields as Miscellaneous User Code using the S-COBOL language, which is a short-hand version of COBOL. S-COBOL is read by the Micro Focus Generator (MFG) and translated into native COBOL. The record coded here receives the data from the VSAM file in the project.

  1. On the Action/Event Browser on the Control Type list, click All.
  2. On the Control Name list, click All.
  3. Click Action/Event > Edit Miscellaneous User Code. This brings up your default editor.
  4. Code the following S-COBOL record into the editor. Code the WS on the first line in column 4. Continue the line starting in column 12. Indent the code for the remainder of the record under the first line. Use the field on the bottom right of the editor to be sure you have the code placed in the proper columns.
       WS      WS-MASTER-RECORD
                 WS-PART-NUMBER      9(8)
                 WS-SHORT-DESC       X20
                 WS-UNITS-INSTOCK    99
                 WS-BASE-PRICE       9(4)V99
                 WS-DIMENSIONS       X8
                 FILLER              X36
  5. To save your source code, click File > Save.
  6. Exit the editor. This returns you to the Action/Event Editor.