Setting VSAM file entry for PL/I

In the Test Case Editor window, you can set file organization and record key for a VSAM file for PL/I.

Before you begin

For information about known limitations in the Test Case Editor, see PL/I Limitations.

The Test Case Editor opens in table format with rows that represent parameters in a data record and columns that represent test entries.

About this task

The Test Case Editor displays data records for a PL/I source program and any subroutines or dependent files that are discovered when the source program is parsed by the ZUnit parser, which is based on the PL/I importer. The data records are displayed in table format.

For a VSAM file, in the Data Type column, VSAM displays for a VSAM file, and File Organization displays in the Data Attribute column when the source program is opened in the Test Case Editor. Specify the VSAM file organization in the File Organization column. Refer to the following Test Case Editor window for more information.

VSAM data type

To open the Test Case Editor, select a source program in the Remote Systems or z/OS Projects view, and then click z/OS Automated Unit Testing Framework (ZUnit) > Create/modify Test Case. ZUnit analyzes the source program file, generates a test case, and opens the test case in the Test Case Editor.

Procedure

  1. Specify an existing file in the Set File Test Type dialog box, File Organization of the specified file is selected.
    • If the VSAM file is not specified with an existing file, when you select an existing file that has different file organization in the Set File Test Type dialog box and click OK, the file organization automatically displays as the selected file organization, such as ESDS, KSDS, or RRDS in the Data Attribute column.

      When a KSDS file is selected, the record key length and record key offset of the specified file will be checked, and the data item that matches the offset and length will be found as record key name. If it is not found, you will received an error message and the Set File Test Type dialog will be canceled.

    • If the VSAM file is already specified with an existing file, when you select the existing file that has different file organization in the Set File Test Type dialog box and click OK for the other entry, you receiving an error message informing you to select the correct file associated with the file organization and the Set File Test Type will be canceled.

      When a KSDS file is selected and one or more data of record key name, key length, record key offset is different from the attributes of the selected file, you will receive an error message and the Set File Test Type will be canceled.

  2. Specify the VSAM file organization for PL/I source program. If Use test data is selected in the Set File Test Type dialog, the STUB program can be used.
    When the VSAM I/O file is selected, the Set File Organization right-click menu is enabled in Test Case Editor for PL/I. See the following Test Case Editor for PL/I window for more information.

    VSAM data attribute menu

    Note: You can also double click the Level, Name, Data Type, or Data Attributes column of the VSAM File to open the Set File Organization dialog box
  3. Click Set File Organization. The Set File Organization dialog box displays with ESDS, KSDS, and RRDS to select.
  4. Click one of the file organization on the Set File Organization dialog box. The file organization data displays in the Data Attribute column.
    • If the VSAM file is not specified with an existing file, when the other file organization is selected, the file organization is changed to the specified one.
    • If the VSAM file is already specified with an existing file, the file organization is already set by the specified existing file. When the other file organization is selected, you need to changed the file organization and the Set File Test Type will be canceled.
    • KSDS

      Specify the VSAM KSDS record key for the PL/I source program. If Use test data is selected in the Set File Test Type dialog box, the STUB program is generated.

      For VSAM KSDS file of PL/I, Set as Record Key displays for the right-click menu. If the elementary data item in the VSAM file and the file organization is specified as KSDS that is selected, and the VSAM file is not specified with an existing file, the menu option is enabled.

      To set the selected data item as record key, select Set as Record Key.

    • RRDS

      All each record for RRDS should be entered sequentially.

    Note: You can select Undo and Redo in Test Case Editor.