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
-
Click the
Add File Definition to Subprogram toolbar button.
The Add File Definition window opens.
-
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 @).
- Click OK.
Editing a file I/O definition
Procedure
-
Select a subprogram file definition, and then click the
Edit File Definition toolbar button.
The Edit File Definition window opens.
-
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 @).
- Click OK.
Deleting a file I/O definition
Procedure
What to do next
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.