|
View previous topic :: View next topic
|
| Author |
Message |
Purna Shankar
New User
Joined: 25 May 2010 Posts: 7 Location: Bangalore
|
|
|
|
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 |
|
 |
superk
Global Moderator

Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
| 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 |
|
 |
Purna Shankar
New User
Joined: 25 May 2010 Posts: 7 Location: Bangalore
|
|
|
|
| The output dataset need to show the actual dataset names. |
|
| Back to top |
|
 |
superk
Global Moderator

Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
 |
superk
Global Moderator

Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
 |
Purna Shankar
New User
Joined: 25 May 2010 Posts: 7 Location: Bangalore
|
|
|
|
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 |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|