Use test results to correct an error in the ANAGRA2.cbl program

The ANAGRA2.cbl program contains an error that is detected by the third test entry. Use the test results to find and correct the error. Then, generate, build, and run a test case for the corrected program.

Correcting an error

Before you begin

This procedure uses a sample program included with the product. It also uses a z/OS® project that was created by the sample setup procedure. Before using this procedure:
  1. Set up the sample files by using the instructions in Setup instructions.
  2. Create/modify a test case for the sample file by using the instructions in Create/modify a test case from ANAGRA2.cbl.
  3. Add data, and generate, build, and run the test case by using the instructions in Add data to the AZUTC003.cbl test case.

Procedure

  1. Open the ZUnit Runner Results view on the <HLQ>.ZUNIT.AZURES(AZUTC003) test results file.
    The results show that an error is detected by test ENTRY3.
    TTOURFIL Test Runner Results
  2. To fix the error in the ANAGRA2.cbl program, open the source file in an editor, comment out line 99, and uncomment line 101.
  3. Close and save the ANAGRA2.cbl file.
  4. Close the Test Runner Results view and the Test Case Editor.
  5. In the z/OS Projects view, right-click the ANAGRA2.cbl source file and click z/OS Automated Unit Testing Framework (ZUnit) > Create/modify Test Case.
  6. In the Create/modify a test case window, click Edit Test Entry Data.
    A message window opens and indicates that the test data layout is updated because the source file is changed.
    Generating test data layout window
  7. Click OK.
    ZUnit prompts you to reload the dependent files.
  8. Click OK.
  9. Generate the test case and stub program.
  10. Rebuild SORTCHAR.cbl and ANAGRA2.cbl.
  11. Select ANAGRA2.cbl, and then right-click and select Build Test Case. When prompted to run the test case, click OK.
    The Test Runner Results view opens and shows that all three tests pass.
    Test Runner Results page