Before you use the Enterprise COBOL sample, allocate data
sets for the sample files, copy the samples into the data sets, and
set compiler and link options for the data sets.
The Enterprise COBOL AZUTC001 sample files are in the rdz\AZUTC001\src
folder of the product installation path, for example, C:\Program
Files\IBM\SDP\rdz\AZUTC001\src. The sample includes the following files:
File name
Description
ANAGRAM.cbl
A sample COBOL program that compares two strings and determines whether they are
anagrams.
ANAGRAM.cpy
A COBOL copybook that contains the input and output interface for program
ANAGRAM.
AZUCF001.azucfg
A zUnit test runner configuration file that defines the test cases to be run and the test
runner options.
AZURS001.azures
A zUnit test runner results file that contains sample test results.
AZURS001.xml
A JUnit-compatible version of AZURS001.azures that was created by
using the XSLFILE test runner parameter and the XSL style sheet
installation_path/rdz/zunit-samples/xsl/AZUZ2J21.xsl.
AZUTC001.cbl
An Enterprise COBOL zUnit test case that is statically linked with another Enterprise COBOL
program, ANAGRAM.cbl, that is to be tested. AZUTC001.cbl
was created by using the Enterprise COBOL zUnit Test Case Template wizard and contains four separate
tests to validate whether ANAGRAM.cbl detects valid anagrams. In
AZUTC001.cbl, test AZUTC001.test003 exposes a bug or limitation in
ANAGRAM.cbl related to punctuation; the test is ultimately failed by using an
assertion.
ZUNIT001.jcl
A JCL file that is used to submit the test runner job.
Procedure
To set up the AZUTC001 sample:
Copy the following sample files into the allocated data sets:
Sample file
Target data set
ANAGRAM.cbl AZUTC001.cbl
<HLQ>.COBOL.SOURCE.COBOL
ANAGRAM.cpy
<HLQ>.COBOL.COPYLIB
ZUNIT001.jcl
Copy this JCL file into your JCLLIB.
AZUCF001.azucfg
<HLQ>.ZUNIT.AZUCFG
AZURS001.azures
<HLQ>.ZUNIT.AZURES
Important: This file is overwritten
when you run the sample.
Customize the JCL in ZUNIT001.jcl for the z/OS system.
You might need
to add a JCLLIB statement similar to the following example so that
the FEL.SFELSAMP(AZUZUNIT) procedure can be found:
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 required for the z/OS
system
Data set for generated JCL
<HLQ>.ZUNIT.CNTL
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
Copy libraries
<HLQ>.COBOL.COPYLIB
Support Error Feedback
Select this check box and specify this data set qualifier for compiler errors:
<HLQ>.ERRCOB
Associate this property group with
the allocated data sets.
Compile and link <HLQ>.COBOL.SOURCE.COBOL(ANAGRAM) as
<HLQ>.LOAD(ANAGRAM). Specify typical compiler options for a batch
program.
Compile and link <HLQ>.COBOL.SOURCE.COBOL(AZUTC001) as
<HLQ>.LOAD(AZUTC001) Specify the build options by using the AZUPG001
property group.
Optional:
If you prefer to work in the z/OS Projects view, you can create a z/OS
project and an MVS subproject, associate the property group with the subproject, and add the data
sets that you allocated to the subproject.
Tip: The New z/OS Project wizard guides you through all of these
actions at the same time: 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.
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: