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
 

 

check if there is only one record

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
harsha puthraya

New User


Joined: 29 Oct 2008
Posts: 8
Location: Bangalore

PostPosted: Wed Mar 04, 2009 5:41 pm    Post subject: check if there is only one record
Reply with quote

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

Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Wed Mar 04, 2009 11:09 pm    Post subject: Reply to: check if there is only one record
Reply with quote

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

New User


Joined: 29 Oct 2008
Posts: 8
Location: Bangalore

PostPosted: Thu Mar 05, 2009 9:24 am    Post subject: Reply to: check if there is only one record
Reply with quote

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

DFSORT Moderator


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

PostPosted: Thu Mar 05, 2009 9:48 pm    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 7 Fri Nov 18, 2016 1:48 pm
No new posts Check System time(Minute) Using TIME1... balaji81_k DFSORT/ICETOOL 5 Fri Nov 11, 2016 10:53 am
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts sort with previous record anatol DFSORT/ICETOOL 9 Thu Oct 06, 2016 2:36 am
No new posts Get Record count in summary record fo... Atul Banke DFSORT/ICETOOL 21 Fri Sep 23, 2016 4:17 pm


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