Setup instructions

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.

Before you begin

Connect to the remote system and allocate data sets for the sample by using the instructions in Sample JCL to allocate ZUnit data sets.

About this task

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:

  1. 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.
  2. 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:
    //ZUNIT001 JOB , 
    // MSGCLASS=H,MSGLEVEL=(1,1),TIME=NOLIMIT,REGION=0M 
    //PROCS JCLLIB ORDER=(CSPSHR.V85.PROCLIB)
  3. 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.
      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
  4. Associate this property group with the allocated data sets.
  5. Compile and link <HLQ>.COBOL.SOURCE.COBOL(ANAGRAM) as <HLQ>.LOAD(ANAGRAM). Specify typical compiler options for a batch program.
  6. Compile and link <HLQ>.COBOL.SOURCE.COBOL(AZUTC001) as <HLQ>.LOAD(AZUTC001) Specify the build options by using the AZUPG001 property group.
  7. 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.
  8. 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:
Figure 1. Property group. Property group editor with a property group created for the Enterprise COBOL AZUTC001 sample.
Property group editor with a property group created for the Enterprise COBOL AZUTC001 sample.
Figure 2. z/OS Projects view. z/OS Projects view with Enterprise COBOL AZUTC001 data sets loaded.
z/OS Projects view showing allocated data sets with sample files copied into them.

What to do next

Using the sample