How to get the individual dataset record counts?



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

How to get the individual dataset record counts?

Postby vinothrajagopal » Mon Apr 11, 2011 12:55 pm

I'm going to combine 3 datasets with the SORT step. On succesful execution of this job I am able to see the total record count of the output file (which is of all 3 I/P files) in the spool. But I would like to know is there any possiblity to get the record count of each input file, and the same should be displayed in the spool. Is there is any method to log this?

Thanks,
Vinoth R
vinothrajagopal
 
Posts: 4
Joined: Mon Apr 11, 2011 12:44 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How to get the individual dataset record counts?

Postby steve-myers » Mon Apr 11, 2011 8:15 pm

Run JCL like this --
//A       EXEC PGM=IDCAMS
//SYSPRINT DD  SYSOUT=*
//OUTPUT   DD  DUMMY,DCB=(RECFM=FB,LRECL=80,BLKSIZE=80)
//SYSIN    DD  *
 REPRO INDATASET(XXXXXX.MASTJCL.ASM) OUTFILE(OUTPUT)

There should be a blank character before the REPRO command, which this dumb board deleted. The DCB parameters on the OUTPUT DD statement must match, within reason, the actual DCB parameters of the input dataset/

You will get output like this -
 REPRO INDATASET(XXXXXX.MASTJCL.ASM) OUTFILE(OUTPUT)

IDC0005I NUMBER OF RECORDS PROCESSED WAS 185

IDC0001I FUNCTION COMPLETED, HIGHEST CONDITION CODE WAS 0



IDC0002I IDCAMS PROCESSING COMPLETE. MAXIMUM CONDITION CODE WAS 0

There was a blank character before the REPRO command, ...
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: How to get the individual dataset record counts?

Postby Frank Yaeger » Mon Apr 11, 2011 11:04 pm

Vinoth R,

It's not clear what you're trying to do. If you are asking can you use copy three concatenated data sets to an output data set in one pass AND get the count of each individual input data set, then the answer is no (I don't believe IDCAMS can do that either). For concatenated data sets, DFSORT wouldn't know where each data set starts and ends.

If you want to create an output data set consisting of three input data sets and you want a count of each input data set, you could do that with ICETOOL in one step with a COPY operator for each input data set and a MOD output data set, e.g.

COPY FROM(IN1) TO(OUT)
COPY FROM(IN2) TO(OUT)
COPY FROM(IN3) TO(OUT)

where OUT is a MOD data set. You would get messages in DFSMSG giving the record count for each input file.

If you want to do something else, you need to explain more clearly exactly what you want to do. Show an example of your input files and expected output.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times

Re: How to get the individual dataset record counts?

Postby vinothrajagopal » Tue Apr 12, 2011 2:23 pm

Actually this is my JCL
XXPS010 EXEC PGM=SORT
XXSORTIN DD DUMMY,
XX DCB=(RECFM=FB,LRECL=344,BLKSIZE=0,BUFNO=5)
X\SORTIN DD DSN=xxx00000.xxxxxxx.G0004V00,
X\ DISP=SHR,DCB=BUFNO=50
X/SORTIN DD DCB=(BUFNO=50,RECFM=FB,LRECL=344,BLKSIZE=0),DISP=SHR,
X/ DSN=xxx00000.xxxxxxx.G0004V00
X@ DD DSN=xxx00000.xxxxxxx.G0005V00,
X@ DISP=SHR,DCB=BUFNO=50
SORTOF02 DD DSN=XXX00000.xxxxxxxx.BKUP(+1),
DISP=(NEW,CATLG,DELETE),

I need to print the record count of the inout files "xxx00000.xxxxxxx.G0004V00 and xxx00000.xxxxxxx.G0005V00" in spool. Is it possible with SORT utility? Please advice
vinothrajagopal
 
Posts: 4
Joined: Mon Apr 11, 2011 12:44 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How to get the individual dataset record counts?

Postby NicC » Tue Apr 12, 2011 5:45 pm

What did you not understand about Frank's answer? When sort runs it puts diagnostics of the run to SYSOUT on the spool. Theses diagnostics include count of records read and records written. However, if you concatenate the files SORT cannot tell where one file ends and the next starts. But if you use the COPY function against the individual files then you will get the counts.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: How to get the individual dataset record counts?

Postby vinothrajagopal » Tue Apr 12, 2011 6:55 pm

I am using SORT FIELDS=COPY. Is this right?
vinothrajagopal
 
Posts: 4
Joined: Mon Apr 11, 2011 12:44 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How to get the individual dataset record counts?

Postby NicC » Wed Apr 13, 2011 1:04 am

Wrong - you should be using the COPY function of DFSORT - not the SORT function (nor the MERGE function). Check out the manual.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: How to get the individual dataset record counts?

Postby Frank Yaeger » Wed Apr 13, 2011 1:06 am

you should be using the COPY function of DFSORT


SORT FIELDS=COPY does perform the copy function. SORT FIELDS=(p,m,f,s,...) would perform the SORT function.

Of course, you don't need any SORT statement with the COPY operator of DFSORT's ICETOOL since it does a COPY function by default.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post