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
 

 

Want to a execute 2 different pgms based on the count

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Want to a execute 2 different pgms based on the count
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

Senior Member


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

PostPosted: Mon May 25, 2009 5:42 pm    Post subject:
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    Post subject: Reply to: Want to a execute 2 different pgms based on the co
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

Senior Member


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

PostPosted: Tue May 26, 2009 5:25 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM 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
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 Group Data based on a key Arun Raj DFSORT/ICETOOL 7 Thu Apr 27, 2017 11:29 pm
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm


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