spacer Home spacer Valid HTML 4.01! spacer Dublin Core Used Here spacer Guestbook spacer PayPal Donate Nigel Pentland's downloads page
Frank Yaeger

ICETOOL reports for RACF

Frank Yaeger (IBM DFSORT / ICETOOL Guru) has been very helpful in assisting with DFSORT ICETOOL reports for RACF. So much so that I want to share his wisdom with everyone by publishing his advice here. I hope you find it as useful as I have.
Example 1
Example 2


Example 1

Below is an email taken from the RACF-L and seems to me like such a useful piece of example code, I wanted to place along side my own samples.
----------------------------------------------------------------------------
shiraz esakjee wrote:
>Need some help in combining two record types into one report. EG: List
>all users with TSO segment (get this from rec type 220), but I also
>want the userid default group and programmer name (get this from rec
>type 200). I can run this successfully in batch with two reports, I
>need one report with headings for userid,dfltgrp,programmer name,tso
>account,logon proc,size and mazsize.

I worked with shiraz offline on this. He wanted the report to look like this with one combined record for each Userid that appears in both the 0200 record and the 0220 record:

USR NAME  DFLTGRP   PROGRAMMER NAME     ACCOUNT  LOGON PROC   ...
--------  --------  -----------------   -------  ----------   ...
SEC0001   SEC000X   SHIRAZ              ACCT#    @LOGISPF     ...

Here's a DFSORT/ICETOOL job to produce this kind of report:

//RACFICE EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//PRNTDSP DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//SORTDIAG DD DUMMY
//IN DD DSN=... input file
//TEMP1 DD DSN=&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//TEMP2 DD DSN=&T2,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//CONCT DD DSN=*.TEMP1,VOL=REF=*.TEMP1,DISP=(OLD,PASS)
// DD DSN=*.TEMP2,VOL=REF=*.TEMP2,DISP=(OLD,PASS)
//TOOLIN DD *
* Split off 0200 and 0220 records and reformat each for
* summing
 COPY FROM(IN) USING(CTL1)
* Keep only records that have the same userid in the 0200 record
* and the 0220 record
 SELECT FROM(CONCT) TO(TEMP2) ON(1,8,CH) ALLDUPS
* Sort by userid and sum needed fields from reformatted 0220 records
* with binary zeros in reformatted 0200 records.
 SORT FROM(TEMP2) TO(TEMP1) USING(CTL2)
* Create report using needed fields from joined 0200 and 0220 records DISPLAY FROM(TEMP1) LIST(PRNTDSP) BLANK -
         TITLE('>>> USERID INFORMATION <<<') -
         BETWEEN(2) -
         HEADER('USR NAME') ON(1,8,CH) -
         HEADER('DFLTGRP') ON(12,8,CH) -
         HEADER('PROGRAMMER NAME') ON(22,18,CH) -
         HEADER('ACCOUNT') ON(42,8,CH) -
         HEADER('LOGON PROC') ON(51,8,CH) -
         HEADER('SIZE') ON(63,10,CH) -
         HEADER('MAXSIZE') ON(78,10,CH)
/*
//CTL1CNTL DD *
 OUTFIL FNAMES=TEMP1,VTOF,
* Select 0200 records with 'SEC' in userid
   INCLUDE=(5,4,CH,EQ,C'0200',&,
            10,3,CH,EQ,C'SEC'),
* Reformat 0200 records to look like this:
* |userid|dfltgrp|prgname|zeros|zeros|zeros|zeros|
   OUTREC=(1:10,8,12:100,8,22:79,18,
     42:8Z,51:8Z,63:10Z,78:10Z)
 OUTFIL FNAMES=TEMP2,VTOF,
* Select 0220 records with 'SEC' in userid
   INCLUDE=(5,4,CH,EQ,C'0220',&,
            10,3,CH,EQ,C'SEC'),
* Reformat 0200 records to look like this:
* |userid|filler |filler |accnt|lgprc|size |maxsz|
   OUTREC=(1:10,8,
     42:19,8,51:154,8,63:163,10,78:176,10)
/*
//CTL2CNTL DD *
* Make sure the 0200 record comes before the matching 0220 record
  OPTION EQUALS
* Sort on userid
  SORT FIELDS=(1,8,CH,A)
* SUM account, logproc, size and maxsize fields from 0220 records
* with zeros in 0200 records to join 0200 and 0220 fields.
  SUM FORMAT=BI,
   FIELDS=(42,8,51,8,63,8,71,2,78,8,86,2)
/*

Frank Yaeger - DFSORT Team (IBM)
 Specialties: ICETOOL, OUTFIL, Symbols, Migration
 => DFSORT/MVS is on the WWW at http://www.ibm.com/storage/dfsort/



Example 2

Nigel Pentland wrote:

> Is there any way - when generating ICETOOL Reports - to trap the zeroes
> in the statistics part of the search - and to not write the results - ie:
> a null report to the Reports Dataset?
>
> This means that we do not want to generate pages of Headings with no
> Reports.

If I'm interpreting this correctly, they want DFSORT/ICETOOL to avoid writing a LIST data set for DISPLAY (or OCCUR) when the input data set is empty. Normally, ICETOOL will write the header records when the data set is empty, but they don't want to write the list data sets if they only have the header records.

They can actually use a DFSORT/ICETOOL job like the following to do what they want. I've shown how to do it with two DISPLAY operators, but it can be extended to any number of DISPLAY or OCCUR operators using the same or different input files. Reports will only be written for input data sets that are not empty.

//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=... input file1
//IN2 DD DSN=... input file2
//SHOW1 DD DSN=... output file1
//SHOW2 DD DSN=... output file2
//TOOLIN DD *
* SET MODE FOR STOP ON ERROR (DEFAULT)
  MODE STOP
* IF IN1 IS EMPTY, SET RC=12.
* IF IN1 IS NOT EMPTY, SET RC=0.
  COUNT FROM(IN1) EMPTY
* IF IN1 IS EMPTY, RC=12 SET BY PREVIOUS COUNT STOPS NEXT DISPLAY
* FROM EXECUTING. IF IN1 IS NOT EMPTY, RC=0 SET BY PREVIOUS COUNT
* ALLOWS NEXT DISPLAY OPERATOR TO EXECUTE.
  DISPLAY FROM(IN1) LIST(SHOW1) HEADER('HD') ON(1,5,FS)
* RESET MODE FOR CONTINUE ON ERROR SO PREVIOUS RC=12 WILL NOT
* STOP SUBSEQUENT OPERATORS.
  MODE CONTINUE
* RESET MODE FOR STOP ON ERROR.
  MODE STOP
* IF IN2 IS EMPTY, SET RC=12.
* IF IN2 IS NOT EMPTY, SET RC=0.
  COUNT FROM(IN2) EMPTY
* IF IN2 IS EMPTY, RC=12 SET BY PREVIOUS COUNT STOPS NEXT DISPLAY
* FROM EXECUTING. IF IN2 IS NOT EMPTY, RC=0 SET BY PREVIOUS COUNT
* ALLOWS NEXT DISPLAY OPERATOR TO EXECUTE.
  DISPLAY FROM(IN2) LIST(SHOW2) HEADER('HD') ON(1,5,FS)
/*

If IN1 and IN2 are not empty, SHOW1 and SHOW2 will be written and ICETOOL will set cc=0.
If IN1 is empty and IN2 is not empty, only SHOW2 will be written and ICETOOL will set cc=12.
If IN1 is not empty and IN2 is empty, only SHOW1 will be written and ICETOOL will set cc=12.
If IN1 and IN2 are empty, neither SHOW1 nor SHOW2 will be written and ICETOOL will set cc=12.


Frank Yaeger - DFSORT Team (IBM)
 Specialties: ICETOOL, OUTFIL, Symbols, Migration
 => DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort/




This page last updated:
Webmeister