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

Want to a execute 2 different pgms based on the count


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
dkarthikreddy

New User


Joined: 14 Mar 2008
Posts: 28
Location: bangalore

PostPosted: Mon May 25, 2009 3:59 pm
Reply with quote

Hi All,

I have a requirement like this, if the record count( excluding header and trailor) is more than 120K then want to execute a pgm, if it is less than the threshold count of 120K want to execute a different pgm.

Can you pls provide me the solution how to do that in a jcl. ( i want to count the records from a jcl and then based on the Return Code i want to execute subsequent steps)

Thanks
Karthik
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Mon May 25, 2009 5:42 pm
Reply with quote

This JCL will give you an RC=4, if the input file has < 120K records.
Code:
//SORTIN   DD DSN=your.input.file,DISP=SHR
//SORTOUT  DD SYSOUT=*                                   
//SYSIN    DD *                                           
 OPTION COPY,NULLOUT=RC4,                                 
 SKIPREC=120000,STOPAFT=1                             
/*         
Check the RC from this step in other step and execute the program you want to else execute the other program.
Back to top
View user's profile Send private message
dkarthikreddy

New User


Joined: 14 Mar 2008
Posts: 28
Location: bangalore

PostPosted: Mon May 25, 2009 6:22 pm
Reply with quote

Hi,

Thanks for your valuable reply. It is working fine.

Karthik
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Tue May 26, 2009 5:25 pm
Reply with quote

glad to hear that it worked for you . . .

Have a good one icon_smile.gif
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts To get the count of rows for every 1 ... DB2 3
No new posts Execute secondary panel of sdsf with ... CLIST & REXX 1
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Validating record count of a file is ... DFSORT/ICETOOL 13
No new posts Fetch data from programs execute (dat... DB2 3
Search our Forums:

Back to Top