View previous topic :: View next topic
|
Author |
Message |
LouAnn Piela
New User
Joined: 29 Apr 2014 Posts: 3 Location: USA
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Why can't you use your Scheduler? |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
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 |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
As Bill suggested this could be handled in scheduler and also contact your support team. They could guide you |
|
Back to top |
|
|
LouAnn Piela
New User
Joined: 29 Apr 2014 Posts: 3 Location: USA
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
LouAnn Piela
New User
Joined: 29 Apr 2014 Posts: 3 Location: USA
|
|
|
|
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 |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
What is the scheduler at your shop? |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3051 Location: NYC,USA
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
David Robinson
Active User
Joined: 21 Dec 2011 Posts: 199 Location: UK
|
|
|
|
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 |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
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 |
|
|
jaidev85
New User
Joined: 11 Nov 2013 Posts: 3 Location: Bangalore
|
|
|
|
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 |
|
|
|