Page 1 of 1

Checking for empty files

Posted: Thu Oct 23, 2008 7:17 am
by meekhasingh
How do we check for empty files using sort card?

Thanks in advance
Meekha

DFSORT - ICETOOL - EMPTY FILE CHECK.

Posted: Thu Oct 23, 2008 4:07 pm
by JACK
Using ICETOOL, we can do this.

Code: Select all

//STEP1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=...
//TOOLIN DD *
COUNT FROM(IN) EMPTY
/*
This step return RC=12, if file IN is empty.

Posted: Thu Oct 23, 2008 8:23 pm
by Frank Yaeger
Meekha,

See the "Set RC=12 or RC=4 if file is empty, has more than n records,
etc" Smart DFSORT Trick at:

www.ibm.com/systems/support/storage/sof ... vs/tricks/