COBOL data generation
Generate the COBOL test data.
Link the listing file to your COBOL file
- In the Explorer view, change the file extension for the listing so that it ends with .log.
- Right-click the COBOL file, and select watsonx Code Assistant for Z > Link listing file to generate test data.
- In the input field, choose Select File via Dialog.
- In the dialog window, navigate to your listing file, select it, and then click the Open button in the dialog window.
- A message appears at the lower right corner of the screen that confirms that the listing file is linked.
Generate the COBOL test data
-
In the Explorer panel, expand the tree view for Z Validation Assistant.
Figure 1. Explorer -
Right-click the COBOL file. Choose Generate COBOL test data.
Figure 2. Generate COBOL test data -
In the input field at the top of the VS Code screen, enter your load library and press Enter.
Figure 3. Load Library History Note: 2.4.0+ With Z Validation Assistant 2.4 and after, you are now able to view the history of previously used load libraries. Additionally, you can define the maximum number of load library history items to display. The relevant VS Code setting iszValidationAssistant.maxLoadLibraryHistoryItems
. -
Status notifications appear in the Z Validation Assistant view.
Note: 2.4.0+ With Z Validation Assistant 2.4 and after, you are now able to toggle a setting to remove titles from notification messages during COBOL test data generation and equivalence test. Also, you can now add a delay in between each step of COBOL test data generation and equivalence test. The following lists relevant VS Code settings for these options.zValidationAssistant.notifications.delayNotifications
zValidationAssistant.notifications.removeNotificationTitles
-
The following message appears in the lower right corner of the screen. Click Continue to proceed.
Note: 2.4.0+ Users can now retrieve the output values from generated inputs after an error or cancellation. When successfully creating input values from COBOL, if there is an error retrieving output value, the Validation tree is preserved and can be rerun from the second step.Figure 4. Example of a successfully retrieved COBOL inputs message When the process is completed, the following message appears in the corner:
Completed generating COBOL test data for [program name]
. The results show up in the Z Validation Assistant view that is located in the VS Code Explorer. If Validation Assistant fails to generate test data, tests are shown as failed with a red X icon.Figure 5. Example of Validation Assistant failing to generate test data In version 2.2.0, we introduced a Cancel button that helps to stop the COBOL test data generation process. The button appears in the lower right of the screen while the test data generation is running.
Figure 6. Example of the Cancel button