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
 
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 column with count of rows within dist... ronald wouterson DB2 4 Sun Sep 17, 2017 9:48 pm
No new posts BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts SORT Trailer Count - LRECL Output co... amorante DFSORT/ICETOOL 5 Tue Aug 29, 2017 8:57 pm
No new posts How do you create Eclipse based dialogs jasorn IBM Tools 0 Thu Aug 03, 2017 5:05 pm

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