Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Need to check count of file records and abend if >10.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
rahul_kolhe

New User


Joined: 08 Nov 2006
Posts: 15

PostPosted: Fri Nov 17, 2006 2:29 am    Post subject: Need to check count of file records and abend if >10.
Reply with quote

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
View user's profile Send private message

Gautam512

Active User


Joined: 05 Oct 2005
Posts: 309
Location: Vizag / US

PostPosted: Fri Nov 17, 2006 2:34 am    Post subject: Re: Need to check count of file records and abend if >10.
Reply with quote

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
View user's profile Send private message
meetsrk

New User


Joined: 13 Jun 2004
Posts: 85

PostPosted: Mon Nov 20, 2006 8:32 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Mon Nov 20, 2006 9:54 pm    Post subject:
Reply with quote

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:

http://www.ibm.com/servers/storage/support/software/sort/mvs/tricks/
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us