Getting Started


Chapter 14. Defining the working storage record

After you run an intermediate test and are satisfied with the results, you can begin defining the working storage record and supplying the logic for your program.

A working storage record holds temporary and intermediate data values that a program uses while it runs. Your sample program requires a working storage record containing four nonshared data items. Specifying that data items are nonshared means that they are not part of other record parts and cannot be used outside the context of the record they are used in.

You named the working storage record for this program when you defined the program specifications in the Program Editor. The working storage record is represented on the structure diagram by the record symbol and the name CUST-LIST-WS to the right of the symbol. The question mark (?) symbol is removed after you define the record.

Figure 71. Program Editor

Figure samplpr6 not displayed.

To begin defining the working storage record, do the following:

  1. In the Program Editor, double-click on CUST-LIST-WS.

    The New Part Package/Application is displayed.

  2. Ensure that tutorial is selected, and select OK.

    The new part is created and the Record Editor is displayed.

You have already named CUST-LIST-WS as a working storage record. Now, you need to define the nonshared data items for CUST-LIST-WS.

Figure 72. Record Editor

Figure wsrecedt not displayed.

To define the nonshared data items for CUST-LIST-WS, perform the following steps:

  1. Ensure that Working Storage is displayed in the Record Type drop-down list box and Nonshared is displayed in the Default Scope drop-down list box.
  2. From the Edit menu, select Insert After.

    A new row is inserted and the cursor is displayed in the Name field.

    Tip:Choices on the context menus can make defining records faster. To display the context menu, place the mouse pointer in the data items list and click mouse button 2. For more information on defining records, see the online help.
  3. In the Name field, type cusnum-ws and press Tab.

    The cursor moves to the Occurs field.

  4. In the Occurs field, type 10 and press Tab.

    The cursor moves to the Type field.

  5. In the Type field, press Tab.

    The default type of Char remains in this field and the cursor is displayed in the Length field.

  6. In the Length field, type 8.

    Now add three more data items by selecting Edit>Insert After three times. Then, enter the values from the following table into the three new data items.

    Name Occurs Length
    cusname-ws 10 20
    cuscontact-ws 10 20
    cusphone-ws 10 12

    When you've entered all the data items for your working storage record, it should look like the record shown in Figure 73.

  7. From the File menu, select Save.

    The record is saved.

  8. Close the Record Editor.

Figure 73. Record Editor

Figure wsreced2 not displayed.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]