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 Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Sort Large record length cmsmoon DFSORT/ICETOOL 14 Tue Apr 11, 2017 5:49 pm
No new posts Format record to remove Leading zeroes Learncoholic DFSORT/ICETOOL 14 Wed Apr 05, 2017 2:43 pm


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