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

Bypass JCl Step based on what month it is


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
LouAnn Piela

New User


Joined: 29 Apr 2014
Posts: 3
Location: USA

PostPosted: Tue Apr 29, 2014 9:00 pm
Reply with quote

I have a monthly job that will execute 2 steps. Step 1 is always executed. Step 2 will only be executed if it is month January, April, July or October. (The months will change each year). I need a way to execute Step 2 only during one of the exception months. I researched cond code processing and using the parm parameter but can't seem to come up with a solution. Any suggestions? If it helps, what I am trying to do is concatenate 4 or 5 weeks of GDGs into one flat file. For January I have 5 files, February I have 4 files ect. Step 1 was concatenating 4 files. Step 2 will append the 5 weeks file IF it is a file week month. Thanks for any help you can provide.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Apr 29, 2014 9:06 pm
Reply with quote

Why can't you use your Scheduler?
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Tue Apr 29, 2014 9:20 pm
Reply with quote

Or simply clear down your GDG once you have amalgamated the datasets so you will only ever be dealing with G0001V00 to G0004V00 or G0005V00?
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Tue Apr 29, 2014 9:37 pm
Reply with quote

As Bill suggested this could be handled in scheduler and also contact your support team. They could guide you
Back to top
View user's profile Send private message
LouAnn Piela

New User


Joined: 29 Apr 2014
Posts: 3
Location: USA

PostPosted: Tue Apr 29, 2014 11:04 pm
Reply with quote

Can't clear down the GDGs. They aren't my files to do that. I just use them. As for the scheduler doing it, can you elaborate? How is the scheduler going to control running the second step on certain months without that being a manual effort on their part?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Apr 29, 2014 11:13 pm
Reply with quote

You need to work with your site support group. Schedulers such as CA-7 can identify the week of the month and execute different jobs (such as one with two steps versus one step) depending upon the number of weeks in the month. If set up correctly, WITH YOUR SITE SUPPORT GROUP'S ASSISTANCE, the entire process would be automated.

CA-7 even allows you, via the CA-DRIVER process, to perform calculations with dates -- it is quite flexible in that regard.
Back to top
View user's profile Send private message
LouAnn Piela

New User


Joined: 29 Apr 2014
Posts: 3
Location: USA

PostPosted: Tue Apr 29, 2014 11:29 pm
Reply with quote

The two job idea - I had though of that but didn't want to create two separate jobs. That is a possibility and I know that can be set up on a schedule the way you noted above.The CA-7 option is one I need to look into. THANKS!
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Tue Apr 29, 2014 11:31 pm
Reply with quote

What is the scheduler at your shop?
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Wed Apr 30, 2014 1:11 am
Reply with quote

Quote:
Step 2 will only be executed if it is month January, April, July or October. (The months will change each year).


How are you getting this now ? and what logic is in place?

Quote:
I need a way to execute Step 2 only during one of the exception months.

Can you please explain more on what do you mean by exception months?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Apr 30, 2014 1:27 am
Reply with quote

the problem is that ...
Quote:
(The months will change each year).


so it might be possible to define a monthly cycle
but given the above no hope for a proper quarterly cycle
Back to top
View user's profile Send private message
David Robinson

Active User


Joined: 21 Dec 2011
Posts: 199
Location: UK

PostPosted: Wed Apr 30, 2014 11:53 am
Reply with quote

A simple Rexx could be included in the job which would set a return code based on the current month and therefore control the execution of the second step.

Obviously it will need amendment each year if the required months change, so not ideal but I believe it would meet the stated requirement.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Wed Apr 30, 2014 4:39 pm
Reply with quote

David Robinson wrote:
A simple Rexx could be included in the job which would set a return code based on the current month and therefore control the execution of the second step.

Obviously it will need amendment each year if the required months change, so not ideal but I believe it would meet the stated requirement.

Rather than hard-code the exception months in the script, I'd suggest getting them from some external source (parameters, data set, ISPF or DB2 table, etc.) Changes will still be needed to that source, but the script can be more general and the external source can be used as a calendar.
Back to top
View user's profile Send private message
jaidev85

New User


Joined: 11 Nov 2013
Posts: 3
Location: Bangalore

PostPosted: Sat May 17, 2014 1:46 pm
Reply with quote

Ya Correct!!

Rather than hard coding and amending the code every year, parameterizing the Months needed either from file or table would be great!!

1. First collect month names inscope from files or table
2. Check it using REXX or COBOl and set the return code.
3. Depending on return code handle the step 2.

Regards,
Jai[/quote]
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 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