IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to list the dataset names that have < 3 recs


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Purna Shankar

New User


Joined: 25 May 2010
Posts: 7
Location: Bangalore

PostPosted: Tue Jun 01, 2010 9:08 pm
Reply with quote

I need to code a job which will generate a list of dataset names that have less than 3 records.

The job step has to read a set of datasets and create an output dataset with a list of dataset names that have less than 3 records.

For example,
If
input file1 has 5 recs,
input file2 has 1 rec,
input file3 has 0 recs,
input file4 has 2 recs,
input file5 has 100 recs,
then the output dataset should be craeted with data as below:

THE BELOW LISTED FILES HAVE NO DETAIL RECORDS TO PROCESS FOR THE DAY.

FILE2
FILE3
FILE4
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Tue Jun 01, 2010 9:21 pm
Reply with quote

Does your output need to show the actual dataset names, or just the DD name associated to a specific dataset? If so, you'll need to provide some details as to how you'll supply that information to the DFSORT/ICETOOL process.
Back to top
View user's profile Send private message
Purna Shankar

New User


Joined: 25 May 2010
Posts: 7
Location: Bangalore

PostPosted: Tue Jun 01, 2010 9:26 pm
Reply with quote

The output dataset need to show the actual dataset names.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Tue Jun 01, 2010 10:52 pm
Reply with quote

So, I take it we're talking about a fixed number of input datasets, consistent from one run to the next, where you can identify the dataset name by its associated DD name and hard-code that name in the DFSORT/ICETOOL control statements?

For example:

//FILE1 DD DSN=THE.DATASET.#1,...
//FILE2 DD DSN=THE.DATASET.#2,...

so if you check the record count for FILE1 and it's < 3 then you can report that dataset 'THE.DATASET#1' has no detail records.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Tue Jun 01, 2010 11:39 pm
Reply with quote

Presuming the above, you might do this:

Code:

//STEPXXXX EXEC PGM=ICETOOL                                 
//FILE1    DD   DSN=DATASET.#1,...                                                       
//FILE2    DD   DSN=DATASET.#2,...                                                       
//FILE3    DD   DSN=DATASET.#3,...                                                         
//FILE4    DD   DSN=DATASET.#4,...                                                       
//T1       DD   DISP=(MOD,PASS),UNIT=VIO,SPACE=(CYL,(1,1)) 
//REPORT   DD   SYSOUT=*                                   
//DFSMSG   DD   SYSOUT=*                                   
//TOOLMSG  DD   SYSOUT=*                                   
//TOOLIN   DD   *       
COPY FROM(FILE1) USING(CTL1)                                   
COPY FROM(FILE2) USING(CTL2)                                   
COPY FROM(FILE3) USING(CTL3)                                   
COPY FROM(FILE4) USING(CTL4)                                   
COPY FROM(T1) USING(CTL5)                                     
/*                                                             
//CTL1CNTL DD   *                                             
  OUTFIL FNAMES=T1,ENDREC=3,                                   
    TRAILER1=(C'DATASET.#1',46:COUNT=(EDIT=(T)),80:X),   
    NODETAIL,REMOVECC                                         
/*                                                             
//CTL2CNTL DD   *                                             
  OUTFIL FNAMES=T1,ENDREC=3,                                   
    TRAILER1=(C'DATASET.#2',46:COUNT=(EDIT=(T)),80:X),   
    NODETAIL,REMOVECC                                         
/*                                                             
//CTL3CNTL DD   *                                             
  OUTFIL FNAMES=T1,ENDREC=3,                                   
    TRAILER1=(C'DATASET.#3',46:COUNT=(EDIT=(T)),80:X),   
    NODETAIL,REMOVECC                                         
/*                                                             
//CTL4CNTL DD   *                                             
  OUTFIL FNAMES=T1,ENDREC=3,                                   
    TRAILER1=(C'DATASET.#4',46:COUNT=(EDIT=(T)),80:X),   
    NODETAIL,REMOVECC                                         
/*                                                             
//CTL5CNTL DD   *                                             
  OUTFIL FNAMES=REPORT,REMOVECC,                               
    HEADER1=('THE BELOW LISTED FILES HAVE NO DETAIL RECORDS ',
             'TO PROCESS FOR THE DAY'),                       
    INCLUDE=(46,1,CH,LT,C'3'),BUILD=(1,44,80:X)               
/*                                                             
//*                                                           
Back to top
View user's profile Send private message
Purna Shankar

New User


Joined: 25 May 2010
Posts: 7
Location: Bangalore

PostPosted: Wed Jun 02, 2010 4:04 pm
Reply with quote

wowwww

many thnx kevin
its working !!!!!

I tweaked it a bit.
I didnt use ENDREC=3 as I wanted to get the count as well in the output T1 file. Changed the CTL5CNTL accordingly.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts How to create a list of SAR jobs with... CA Products 3
No new posts Allocated cylinders of a dataset DB2 12
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
Search our Forums:

Back to Top