Contents


Rational Developer for System z code review application for z/OS

3 new features

Comments

IBM® Rational® Developer for System z® released additional features for the code review application for IBM® z/OS® since my previous tutorial was published. These features make the application easier to use and reduce the artifacts to export from the Rational Developer for System z client.

Prerequisites

This tutorial requires host and client installation of Rational Developer for System z version 9.1.1 or later. The client installation must include the optional code review feature. The host installation must include the optional Rational Developer for System z host utilities. You'll also need the files and data sets created in the original tutorial still in place.

This tutorial was developed using Rational Developer for System z version 9.5.1. The figures in this article reflect the particular settings of the environment in which the tutorial was developed; these might differ from your own settings.

Feature 1. Status messages in MSGS

The Rational Developer for System z code review application for z/OS shows status messages for in-progress scans in the MSGS output file. This is useful for long scans that involve multiple source files. To run a simple code scan and view the status messages in the MSGS output:

  1. Connect to your host system and create a member called FEATURE1 in the PDS [HLQ].DEVWORKS.JCL, where [HLQ] is your high level qualifier.
  2. Set the contents of FEATURE1 to the values shown in Listing 1.
Listing 1. JCL source for FEATURE1 member
//FEATURE1 JOB MSGLEVEL=(1,1),MSGCLASS=A,CLASS=A
//PROCS JCLLIB ORDER=([RDZHLQ].SAKGSAMP)
//*
//AKGCREV EXEC PROC=AKGCR
//RULES DD PATH='/[hlq]/devworks/DEVWORKS.dat'
//PROPERTY DD PATH='/[hlq]/devworks/DEVWORKS.xml'
//PDS DD DISP=SHR,DSN=[HLQ].DEVWORKS.COBOL
//CSV DD SYSOUT=*,RECFM=VB,LRECL=2051
//XML DD SYSOUT=*,RECFM=VB,LRECL=2051
//MSGS DD SYSOUT=*,RECFM=VB,LRECL=2051
//*

Note: This is almost identical to the PART1 JCL used in the previous article, the only difference is the "FEATURE1" job name.

  1. Submit the FEATURE1 JCL on the host system.
  2. Examine the MSGS job output. Notice that the output contains status messages, including COBOL Code Review analyzing resource 1 of 2 - /[HLQ].DEVWORKS.COBOL/VISCOL.cbl.

Feature 1 showed you how to view status messages in the MSGS output. Feature 2 explains how to use the SYSLIB input parameter to avoid exporting a property group from the Rational Developer for System z client.

Feature 2. A simpler SYSLIB

Feature 2 shows you how to specify the copy book location using the SYSLIB DD.

In part 2 of the previous article, you scanned a program that included a copy book. The code review application for z/OS located the copy book, thanks to the property group that you supplied. Because property groups must be edited and exported from the Rational Developer for System z workstation client and then transferred to z/OS UNIX, it is difficult to quickly change the SYSLIB when you need to change or add a copy book location. This is why the code review application for z/OS introduced the SYSLIB parameter. The SYSLIB DD is a concatenation of libraries where copy books are located, just like the SYSLIB DD in a compile job.

  1. To see how the SYSLIB DD works in the code review application for z/OS, create a member named FEATURE2 in the PDS [HLQ].DEVWORKS.JCL.
  2. Then, set the contents of FEATURE2 to the values in Listing 2.
Listing 2. JCL source for FEATURE2 member
//FEATURE2 JOB MSGLEVEL=(1,1),MSGCLASS=A,CLASS=A
//PROCS JCLLIB ORDER=([RDZHLQ].SAKGSAMP)
//*
//AKGCREV EXEC PROC=AKGCR
//RULES DD PATH='/[hlq]/devworks/DEVWORKS.dat'
//SYSLIB DD DISP=SHR,DSN=[HLQ].DEVWORKS.COPYLIB
//PDS DD DISP=SHR,DSN=[HLQ].DEVWORKS.COBOL
//CSV DD SYSOUT=*,RECFM=VB,LRECL=2051
//XML DD SYSOUT=*,RECFM=VB,LRECL=2051
//MSGS DD SYSOUT=*,RECFM=VB,LRECL=2051
//*

Notice that this is almost identical to the FEATURE1 JCL, except that the PROPERTY DD is replaced by the SYSLIB DD.

Note:
If both the SYSLIB DD and the PROPERTY DD are specified, the code review application for z/OS uses the SYSLIB DD to find copy books and ignores the PROPERTY DD.

  1. Submit the FEATURE2 JCL on the host system.
  2. Examine the job output. Notice that the results include code rule violations from copy books that the code review application for z/OS has located.

With feature 2 you can specify the copy book location using the SYSLIB DD.

Feature 3. Scanning multiple PDS’s at once

Feature 3 shows how to use the LIST input parameter as an alternate way to specify the source code to scan.

Until now, you've had to scan one PDS at a time because the PDS parameter only accepts a single data set. Using the PDS parameter, you would have to code multiple code review steps to scan multiple PDS's at once. Also, in part 4 of the previous article, you scanned a program in a data set that did not have a default Rational Developer for System z extension mapping. Therefore, you had to create an extension map in the Rational Developer for System z workstation client, export it, transfer it to z/OS UNIX, and specify the file as the EXTMAP DD. Like the SYSLIB in property groups, requiring an artifact to export from the Rational Developer for System z client makes it harder and slower to change.

To scan multiple PDS's at once and eliminate the need for an extension map file, the code review application for z/OS introduced the LIST input parameter. The LIST DD points to a file that specifies all of the source code to scan. Each record in the LIST file specifies:

  • A data set
  • The members of that data set
  • The programming language for the selected members
  • Whether to include or exclude the selected members
Listing 3. LIST DD specification
#The # character in the first column indicates a comment
#Select={Include eXclude}, I is default
#Language=language
#Member=member, * is default
#Datasetname=dsn
#Sample:
L=COBOL D=MY.DATASET.COBOL M=AKG*

You can specify any number of records in the LIST file. You can specify any number of COBOL or PL/I programs in any number of data sets as members for the code review application for z/OS to scan.

By specifying scan targets in a file, the LIST parameter enables flexibility in the management of the code review process by separating the means of specifying the code review targets from the JCL that actually invokes the code review. Some examples of how this flexibility helps with management of the code review process are:

  • You can use one LIST file and run different sets of rules on the source code during different phases of development.
  • You can store the LIST file in your SCM repository and track the changes to it over time.
  • You can dynamically integrate code review with your SCM processes by using SCM metadata to extract all the programs in a given application to a set of PDS's and generate a LIST file.

Note:
If the LIST DD is specified, the PDS DD, MEMBER DD, and EXTMAP DD are all ignored.

  1. Transfer the PLFAC.pli file from the DEVWORKS project in your Rational Developer for System z workspace to the [HLQ].DEVWORKS.PLI PDS. If you completed the self-guided exercise from Part 1 of the previous article, this is done. Transfer the same file to the [HLQ].DEVWORKS.SOURCE PDS. The easiest way to transfer the file with the Rational Developer for System z client is to drag the file from the z/OS Projects view to the PDS in the Remote Systems view, as shown in Figure 1. Based on the settings of your connection, the code page conversion should take place automatically.
Figure 1. Source code resources in PDS's
  1. Create a member called FEATURE3 in the PDS [HLQ].DEVWORKS.JCL.
  2. Set the contents of FEATURE3 to the values in Listing 4.
Listing 4. JCL source for FEATURE3 member
//FEATURE3 JOB MSGLEVEL=(1,1),MSGCLASS=A,CLASS=A
//PROCS JCLLIB ORDER=([RDZHLQ].SAKGSAMP)
//*
//AKGCREV EXEC PROC=AKGCR
//RULES DD PATH='/[hlq]/devworks/DEVWORKS.dat'
//SYSLIB DD DISP=SHR,DSN=[HLQ].DEVWORKS.COPYLIB
//LIST DD *
# Everything in the COBOL PDS...
L=COBOL D=[HLQ].DEVWORKS.COBOL
# ...except VISCOL
L=COBOL D=[HLQ].DEVWORKS.COBOL M=VISCOL S=X
# Everything in the PL/I PDS
L=PLI D=[HLQ].DEVWORKS.PLI
# Various programs in SOURCE PDS
L=COBOL D=[HLQ].DEVWORKS.SOURCE M=CBFAC
L=COBOL D=[HLQ].DEVWORKS.SOURCE M=VISCOL
L=PLI D=[HLQ].DEVWORKS.SOURCE M=PLFAC
/*
//CSV DD SYSOUT=*,RECFM=VB,LRECL=2051
//XML DD SYSOUT=*,RECFM=VB,LRECL=2051
//MSGS DD SYSOUT=*,RECFM=VB,LRECL=2051
//*

Each record of the LIST DD instructs the code review application for z/OS to include or exclude programs during the scan.

  1. Submit the FEATURE3 JCL on the host system.
  2. Examine the job output. Programs from three PDS's and two programming languages were scanned as part of the job.

Feature 3 showed you how to use the LIST file to specify target programs for scanning more flexibly than any previous method.

Summary

This tutorial showed you 3 new features of the code review application for z/OS. These features make the application more flexible and reduce the number of artifacts to export from the Rational Developer for System z client.


Downloadable resources


Related topics


Comments

Sign in or register to add and subscribe to comments.

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Rational
ArticleID=1038082
ArticleTitle=Rational Developer for System z code review application for z/OS
publish-date=10062016