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
 

 

Execute a step based on file or variable

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Andy85

New User


Joined: 25 Dec 2008
Posts: 35
Location: India

PostPosted: Fri Feb 13, 2009 11:03 am    Post subject: Execute a step based on file or variable
Reply with quote

Hi all,

I have a requirement in which there is a job having 3 steps. Steps 2 and 3 of the job should always execute. However, if a particular input file is empty then step1 should not execute else it should execute. I was planning to use file empty condition check of SORT which can set RC4 if file is empty. However the problem is that the COND in my last step is (1,LT). Hence if the input file is empty then last step also would not run.

Please suggest something. Instead of checking file as the criteria for execution of step001, can we check some user defined variable to know whether to execute step1 or not.

Thanks in advance.

Following is the JCL with empty file condition check at first:
Code:

//**********************************************************************
//* IF FILE EMPTY THEN SET RC=4 SO THAT STEP001 DOES NOT EXECUTE    *
//**********************************************************************
//STEP01A  EXEC PGM=SORT,PARM='NULLOUT=RC4'                             
//SYSOUT   DD SYSOUT=*                                                 
//SORTIN   DD DSN=HLQ.TRIAL.LOGSSS,DISP=SHR                       
//SORTOUT  DD SYSOUT=*                                                 
//SYSIN    DD *                                                         
 OPTION COPY                                                           
//*                                                                     
//STEP001 EXEC PGM=ICETOOL,COND=(4,LE)                                 
//..........
//STEP002 EXEC PGM=SORT,PARM='DYNALLOC=SYSDA'                           
//..........
//STEP003 EXEC PGM=SORT,PARM='DYNALLOC=SYSDA',COND=(1,LT)               
//..........
Back to top
View user's profile Send private message

gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Fri Feb 13, 2009 11:21 am    Post subject:
Reply with quote

Hi,

why the condition on STEP003 ? STEP002 has no condition and is happy to run.


Gerry
Back to top
View user's profile Send private message
Andy85

New User


Joined: 25 Dec 2008
Posts: 35
Location: India

PostPosted: Fri Feb 13, 2009 11:26 am    Post subject:
Reply with quote

Step003 is dependent on step002. So if step002 has any RC greater than zero then stpe003 should not run. Hence the condition on step003.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Fri Feb 13, 2009 11:29 am    Post subject:
Reply with quote

Hi,

the code
Code:
COND=(0,LT,STEP002)   



Gerry
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 Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 4 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm


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