Page 2 of 2

Re: Reducing I/O amount

PostPosted: Thu Nov 10, 2011 8:29 am
by BillW
Just a thought. You can take advantage of the sorts fast I/O by using sort exits. I did this once long ago when I was sorting large datasets and wanted to minimize passes through the data. In your case, you could use a sort exit to count the records in input. As you can fail the record (i.e. tell sort not to sort/merge it) with a return code. Sort will get the next record for you. I believe you are given indication that you have end of input file(s) and you could print your record count. Not sure if this is just an exercise or if it something you need to do on a regular basis, which is the only reason to use a sort exit.

Re: Reducing I/O amount

PostPosted: Thu Nov 10, 2011 10:57 am
by steve-myers
Yes, that would work, though it's rather unorthodox.

Re: Reducing I/O amount

PostPosted: Fri Nov 11, 2011 12:52 am
by BillW
Perhaps, and not as cool as writing your own excp routines/channel programs, but workable. Whether or not one would do it depends on the parameters not expressed in the initial post. But, sort has much better i/o than many other utilities and you don't have to deal with lower level minutia of DASD.

Re: Reducing I/O amount

PostPosted: Fri Nov 11, 2011 5:30 am
by BillyBoyo
From "Smart DFSORT Tricks"

//CTRCDS EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=...input file
//OUT DD DSN=...output file
//TOOLIN DD *
COUNT FROM(IN) WRITE(OUT) DIGITS(8)
/*


Saves the overhead of an Exit. Works with F/FB files as well as V/VB (+VSAM, etc) without having to have seperate Exits. The we come full circle, matching to the EXCPs to DFSORT and not reducing them for TS's code :-)

Re: Reducing I/O amount

PostPosted: Fri Nov 11, 2011 10:09 am
by steve-myers
Of course, Billyboyo's little example could be "optimized" by specifying

//OUT DD DUMMY

Not that I've actually tried it!

Re: Reducing I/O amount

PostPosted: Sat Nov 12, 2011 12:00 am
by Frank Yaeger
Of course, Billyboyo's little example could be "optimized" by specifying

//OUT DD DUMMY


Huh? That makes no sense. If you don't need to see the count in the OUT data set, then you would just use:

//CTRCDS EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=...input file
//TOOLIN DD *
COUNT FROM(IN)
/*


DFSORT displays the count in TOOLMSG.

If you want the count in a data set, then you would use WRITE(OUT) with a //OUT DD you could look at (not DUMMY).