View previous topic :: View next topic
|
Author |
Message |
rahul_kolhe
New User
Joined: 08 Nov 2006 Posts: 15
|
|
|
|
Hi,
I want to check the number of records count in file and if count is more than 10 then needs to return abend.
How could we attend this thru JCL, Do not want to write prog.
Thanks, |
|
Back to top |
|
|
Gautam512
Active User
Joined: 05 Oct 2005 Posts: 308 Location: Vizag / US
|
|
|
|
hi ,
search in the same forum itself, u can get a jcl for counting records.
u can just abend the program if the count reaches more than 10.
this can be acheived thru fileaid. |
|
Back to top |
|
|
meetsrk
New User
Joined: 13 Jun 2004 Posts: 85
|
|
|
|
The below code with abend with RC=12 when count > 10 in the input file
Code: |
//STEP02 EXEC PGM=ICETOOL,COND=(0,NE)
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=G<input file>,DISP=SHR
//TOOLIN DD *
COUNT FROM(IN) LOWER(10)
/*
|
|
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Actually, LOWER(10) will pass back RC=12 when count < 10 and RC=0 when count >= 10. It will NOT abend.
Here's a DFSORT/ICETOOL job that will pass back RC=12 when count > 10 and RC=0 when count <= 10.
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=... input file
//TOOLIN DD *
COUNT FROM(IN) HIGHER(10)
/*
|
For more information on this, 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/servers/storage/support/software/sort/mvs/tricks/ |
|
Back to top |
|
|
|