Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to list the dataset names that have < 3 recs

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: How to list the dataset names that have < 3 recs
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

Moderator Team Head


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

PostPosted: Tue Jun 01, 2010 9:21 pm    Post subject: Reply to: How to list the dataset names that have < 3 rec
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    Post subject:
Reply with quote

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

Moderator Team Head


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

PostPosted: Tue Jun 01, 2010 10:52 pm    Post subject: Reply to: How to list the dataset names that have < 3 rec
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

Moderator Team Head


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

PostPosted: Tue Jun 01, 2010 11:39 pm    Post subject: Reply to: How to list the dataset names that have < 3 rec
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Browse dataset cvnlynn CLIST & REXX 4 Tue Jul 18, 2017 3:52 am
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts RFE: DB2 support for mixed case names. Pedro DB2 0 Tue Jul 04, 2017 1:32 am
No new posts Fileaid 2 commands instream work. In ... descann Compuware & Other Tools 2 Tue May 16, 2017 3:31 pm
No new posts member list compare jzhardy TSO/ISPF 6 Fri May 12, 2017 3:18 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us