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
 
Executes a step only on last week of the month in the jcl

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> IBM Tools
View previous topic :: :: View next topic  
Author Message
radhakrishnan82

Active User


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

PostPosted: Mon Oct 25, 2010 11:20 am    Post subject: Executes a step only on last week of the month in the jcl
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: 2442
Location: Netherlands, Amstelveen

PostPosted: Mon Oct 25, 2010 5:48 pm    Post subject:
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: 436
Location: chennai, India

PostPosted: Tue Oct 26, 2010 10:59 am    Post subject:
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    Post subject: try this:
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: 1703
Location: Australia

PostPosted: Thu Oct 28, 2010 3:40 pm    Post subject:
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: 2442
Location: Netherlands, Amstelveen

PostPosted: Thu Oct 28, 2010 5:43 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> IBM Tools All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
No new posts it is possible output a SET value fro... Martylin JCL & VSAM 5 Fri Sep 22, 2017 7:08 am
No new posts Fetch Previous month & year in MM... girishb2 DFSORT/ICETOOL 3 Thu Sep 21, 2017 9:54 pm
No new posts Reg:Displaying the particular month o... bhavana yalavarthi All Other Mainframe Topics 4 Sat Jul 08, 2017 8:13 pm
No new posts Restart=Step not working ALAK SAHA JCL & VSAM 6 Fri Jun 30, 2017 6:28 pm

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