Adding file I/O definitions for subprograms

You can add file I/O definitions for subprograms to test subprogram modules without having to capture file I/O transactions.

About this task

When file I/O capture is enabled, file I/O data in subprograms is also captured and replayed with the recorded data, so you don't need to add a file definition even if you are testing with a real subprogram module that contains file I/O.

If the real subprogram module is not a COBOL or PL/I program, but an assembler program, file I/O data is not captured, so you must manually add a file definition.

If a program to be tested contains file I/O definitions in subprograms, you can use the Test Case Editor to add information about file I/O definitions to subprograms. You can create a file by specifying the DD name and file type, such as input, output, or input-output, and specify the existing file as the input file or the expected file. No layout is shown for the files. File stubbing using test data for each layout is not supported.

Adding a file I/O definition

Procedure

  1. Click the Add File Definition to Subprogram Add File Definition to Subprogram toolbar button.
    The Add File Definition window opens.
  2. Specify a DD name for the file and then select a file type: Input, Output, or Input and output.
    The DD name must be unique in the test case. Its maximum length is 8 characters and allowable characters are alphabet, digit, and national characters ($, # and @).
  3. Click OK.

Editing a file I/O definition

Procedure

  1. Select a subprogram file definition, and then click the Edit File Definition Edit File Definition toolbar button.
    The Edit File Definition window opens.
  2. Modify the DD name for the file or the file type: Input, Output, or Input and output.
    The DD name must be unique in the test case. Its maximum length is 8 characters and allowable characters are alphabet, digit, and national characters ($, # and @).
  3. Click OK.

Deleting a file I/O definition

Procedure

Select a subprogram file definition, and then click the Remove File Definition Remove File Definition toolbar button.
The file definition is removed from the Test Case Editor.

What to do next

When you click Generate, the ZUnit (z/OS® Automated Unit Testing Framework), generates the test case for the files in the subprogram as well as the file I/O that is defined in the test target program.

When you run the test case, ZUnit generates In the JCL to run the ZUnit test case, ZUnit generates DD statements for the files in the subprogram in the same way that it generates files for the test target program.