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

Execute a step based on file or variable


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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: 1702
Location: Australia

PostPosted: Fri Feb 13, 2009 11:21 am
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
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: 1702
Location: Australia

PostPosted: Fri Feb 13, 2009 11:29 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 0
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top