Before you use the Enterprise COBOL AZUTC004 sample, allocate
data sets for the source file and generated files, copy the sample
file into a partitioned data set, create a property group that specifies
compiler and link options for the data sets, and create a z/OS® project for the sample.
The Enterprise COBOL AZUTC004 sample is in the
rdz\\AZUTC004\src folder of the installation path, for example,
C:\Program Files\IBM\SDP\rdz\\AZUTC004\src. The sample includes
the following files:
File name
Description
TOURFILE.cbl
A COBOL program that contains file I/O calls. The input file for the program is
TOURDATA. All records of TOURDATA are sorted with the
TOUR-CODE parameter. The program reads all records, combines records with the
same TOUR-CODE value, and writes them to the TOURMST
output file. The program has one error on line
107:
MOVE "CODE-INVALID" TO O-TOUR-NAME.
The following program instruction is
the correct one for this line:
MOVE "CODE-INVALID" TO W-TOUR-NAME.
AZUTC004.cbl
An Enterprise COBOL ZUnit test case that was generated from the
TOURFILE.cbl sample program. This program is statically linked with
TOURFILE.cbl, which is the program to be tested.
AZUTC004.cbl was created by using the Create/modify a test case
wizard and contains three separate tests to validate TOURFILE.cbl. When you
work through the sample scenario, you generate your own copy of this program. This sample is
provided to help you compare your results to the expected results.
AZUTC004.azucfg
A ZUnit test runner configuration file that defines the test cases to be run and the test
runner options. When you work through the sample scenario, you generate your own copy of this file.
This sample is provided to help you compare your results to the expected results.
AZUTC004.azures
A ZUnit test runner results file that contains sample test results. When you work through
the sample scenario, you generate your own copy of this file. This sample is provided to help you
compare your results to the expected results.
When you work through the sample scenario, you generate additional files that are used
to demonstrate ZUnit functions.
Procedure
To set up the sample:
Copy the TOURFILE.cbl sample file into the
<HLQ>.ZUNIT.COBOL data set.
In the Property Group Manager, select the remote system
that contains the ZUnit data sets and create a property group that specifies the following
categories and properties.
Category > Page
Property
Value
Info
Name
AZUPG001
Description
Property group for the ZUnit samples
JCL
JCL job card
Specify any JCL statements required for the z/OS
system. You might need to add a JCLLIB statement to call ELAXF* remote build procedures. For more
information, see ELAXF* remote build procedures.
Link > Procedures and Steps
Link options
DYNAM(DLL) NOREUS
Link libraries
CEE.SCEELKED <HLQ>.LOAD
Use specified link instructions
Select this check box and specify:
INCLUDE AZUTSTRX
Load module location
<HLQ>.LOAD
Additional JCL
//******* ADDITIONAL JCL FOR LINK HERE ******
//LINK.SYSDEFSD DD DUMMY
//LINK.AZUTSTRX DD DISP=SHR,
// DSN=&FELPRFX..SFELSAMP(AZUTSTRX)
Link > JCL substitution
User variables: Variable name
FELPRFX
User variables: Variable value:
Specify the data set prefix for the *.*.SFELSAMP partitioned data set.
Contact your systems administrator for the data set name.
COBOL > Procedures and Steps
Compiler options
SOURCE LIB
Debug data set
<HLQ>.COBOL.SYSDEBUG
Object deck data set
<HLQ>.ZUNIT.COBOL.OBJECT
SYSLIB
<HLQ>.COBOL.COPYLIB
Support Error Feedback
Select this check box and specify this data set qualifier for compiler errors:
<HLQ>.ERRCOB
In the z/OS Projects view, create a z/OS project named ZUnit Samples z/OS Project and an MVS™ subproject named AZUTC003, associate the AZUPGCOB
property group with the subproject, and add the data sets that you allocated to the
subproject.
Tip: By using the New z/OS Project wizard, you can complete all of
these actions at the same time. The wizard guides you through the process of creating the project,
creating the subproject, associating the property group with the subproject, and adding remote
resources to the subproject. To start the wizard, select New > z/OS Project from the pop-up menu of the z/OS Projects view.
Compile and link <HLQ>.ZUNIT.COBOL(TOURFILE) as
<HLQ>.ZUNIT.COBOL.LOAD(TOURFILE). Specify typical compiler options for a
batch program.
In Preferences > z/OS Automated Unit Testing Framework (ZUnit), select Test runner (AZUTSTRN). Click
Apply and then close the setting.
Results
The following resources are added to your workspace: