View previous topic :: View next topic
|
Author |
Message |
harsha puthraya
New User
Joined: 29 Oct 2008 Posts: 8 Location: Bangalore
|
|
|
|
Hi
I have a requirement to COUNT the no of records in a file and set the CC.
I want to check if there is only one record (header record) in the file and do some processing.
Tried out IDCAMS but it checks for greater than "N" rather than lesser than "N" records.
Is there any other way to do it?
Please advise.
Regards
Harsha |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
harsha puthraya,
You can use the following DFSORT/ICETOOL to set the return code
Code: |
//STEP0100 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=your input file,DISP=SHR
//TOOLIN DD *
* SET RC=4 IF THE 'IN' DATA SET IS ONLY 1 RECORD, OR
* SET RC=0 IF THE 'IN' DATA SET IS EMPTY OR HAVE MORE THAN 1 RECORD
COUNT FROM(IN) EQUAL(1) RC4
//* |
|
|
Back to top |
|
|
harsha puthraya
New User
Joined: 29 Oct 2008 Posts: 8 Location: Bangalore
|
|
|
|
Thanks for the reply.
I have one more question. Is it only possible to set a RC=0 or RC=4 through this? Cant we set any other Return Code?
Please advise.
Regards
Harsha |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
You can set RC=12 instead of RC=4 by removing the RC4 operand.
RC=0, RC=4 and RC=12 are the only return codes available. |
|
Back to top |
|
|
|