Execute a Step based on Date compared



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

Execute a Step based on Date compared

Postby senthamizh » Sun Aug 28, 2016 2:06 pm

Hi,

In my JCL thru Parm date(16238) is passed and i want to compare the PARM date with hardcoded date and if the PARM date is less than harcoded date then the particular step should execute. Is this possible in JCL.

For example thru parm date is passed as 16238 and harcoded date is 16250 then the step should execute.
senthamizh
 
Posts: 3
Joined: Tue Sep 14, 2010 2:44 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Execute a Step based on Date compared

 

Re: Execute a Step based on Date compared

Postby NicC » Sun Aug 28, 2016 3:41 pm

No - JCL only compares codition codes so you will have to provide a means of comparing the dates and setting the condition code so that the next step executes or does not execute depending on the condition code. The alternative - and much better way is to amend the program that is/is not meant to execute so that the first thing it does is read the parm date, compare with the "hard-coded" date an then by-pass the rest of the program if the date comparison is not right.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2531
Joined: Sun Jul 04, 2010 12:13 am
Location: Down on the pig farm
Has thanked: 4 times
Been thanked: 88 times

Re: Execute a Step based on Date compared

Postby willy jensen » Mon Aug 29, 2016 3:29 pm

I have this one-liner in a REXX lib member SETCC:

Interpret "Exit (" arg(1) ")"  /* rexx */    
 

It can be executed like shown hereafter. If the test matches then the return code is set to 1 (true), else 0 (false). Any valid REXX comparison can be done this way, not just date check. Or you can set a specific code.

//SETCC    EXEC PGM=IRXJCL,PARM='SETCC DATE(S)=20160829'    
//SYSTSPRT DD SYSOUT=*                      
//SYSEXEC  DD DISP=SHR,DSN=your.LIB.EXEC
//SYSTSIN  DD DUMMY                        
 
willy jensen
 
Posts: 61
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 11 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post