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

Executes a step only on last week of the month in the jcl


IBM Mainframe Forums -> IBM Tools
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
radhakrishnan82

Active User


Joined: 31 Mar 2005
Posts: 435
Location: chennai, India

PostPosted: Mon Oct 25, 2010 11:20 am
Reply with quote

If there are 5 steps in a jcl, step 3 has to be run only if the JCL run date falls on the last week Friday of everymonth else the JCL should run step1,2,4 and 5 excluding step 3 on the first 3 week friday's of everymonth. Can this be done using OPC scheduler.

I know,in ca7, it can be done through job omit card and job include card before the start of the step3. But I am not sure about how to accomplish this thru OPC. Can anyone give me some details about it.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Mon Oct 25, 2010 5:48 pm
Reply with quote

For OPC you have to make two jobs, 1 for steps 1,2,4,5 and 1 for step 3.
In OPC you define 2 applications for the 2 jobs. Define run cycles and/or
periods for those 2 applications.

For details ask your TWS support or consult the manual :

Planning and Scheduling the Workload SH19-4546-01
Back to top
View user's profile Send private message
radhakrishnan82

Active User


Joined: 31 Mar 2005
Posts: 435
Location: chennai, India

PostPosted: Tue Oct 26, 2010 10:59 am
Reply with quote

Thanks, Peter. I didn't know this is the only way to accomplish such scenarios in OPC.
Back to top
View user's profile Send private message
Tim Rock

New User


Joined: 20 Aug 2007
Posts: 2
Location: Phoenix, AZ

PostPosted: Thu Oct 28, 2010 1:53 am
Reply with quote

TWS supplied variable "CDD" resolves to occurrence calendar day -- this code inserts STEP3 if cal. day is 25 thru 31:

//STEP1 EXEC PGM=IEFBR14
//STEP2 EXEC PGM=IEFBR14
//*
//*%OPC BEGIN ACTION=INCLUDE
//TESTDATE IF (&CDD > 24) THEN
//STEP3 EXEC PGM=IEFBR14
//TESTDAT1 ENDIF
//*%OPC END ACTION=INCLUDE
//*
//STEP4 EXEC PGM=IEFBR14
//STEP5 EXEC PGM=IEFBR14
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Thu Oct 28, 2010 3:40 pm
Reply with quote

Hi Tim,

how does day 25 thru 31 satisfy months with less than 31 days ?

Although I'm confused with the request

Quote:
Executes a step only on last week of the month in the jcl


and then
Quote:
run date falls on the last week Friday of everymonth


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

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Thu Oct 28, 2010 5:43 pm
Reply with quote

Tim,

as far as i understood the TS :

step 3 has to be run only if the JCL run date falls on the last week Friday of every month

else step 1,2,4 and 5 excluding step 3 on the first 3 week friday's of every month

So for me that means that step 3 is not to be inserted.
Back to top
View user's profile Send private message
Tim Rock

New User


Joined: 20 Aug 2007
Posts: 2
Location: Phoenix, AZ

PostPosted: Thu Oct 28, 2010 8:24 pm
Reply with quote

my solution was a way to insert a jobstep only on a range of calendar dates.
There are other supplied variables that check which weekday it is.
It seems like with a combination of IF statements checking day and date you can tweak this to do whatever you need.
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 -> IBM Tools

 


Similar Topics
Topic Forum Replies
No new posts Populate last day of the Month in MMD... SYNCSORT 2
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Return codes-Normal & Abnormal te... JCL & VSAM 7
No new posts How to append a PS file into multiple... JCL & VSAM 3
No new posts replace word 'MONTH' with current mon... SYNCSORT 11
Search our Forums:

Back to Top