IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

check if there is only one record


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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
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
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 Developer


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

PostPosted: Thu Mar 05, 2009 9:48 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts SCOPE PENDING option -check data DB2 2
Search our Forums:

Back to Top