Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Extract Record using range of Data scorp_rahul23 DFSORT/ICETOOL 3 Wed Nov 15, 2017 11:54 pm
No new posts Squeeze record left so that zeroes ar... Vignesh Sid SYNCSORT 5 Fri Nov 10, 2017 1:40 pm
No new posts Formatting multiple records to a sing... Vignesh Sid SYNCSORT 3 Tue Nov 07, 2017 12:22 pm
No new posts Format Last Record differently from r... Learncoholic DFSORT/ICETOOL 5 Tue Oct 24, 2017 12:01 pm
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us