View previous topic :: View next topic
|
Author |
Message |
rexx77
New User
Joined: 14 Apr 2008 Posts: 78 Location: Mysore
|
|
|
|
Greetings!!
I am planning to create one REXX macro to automate the DB2 Table Loading. I will receive Date from User and that date PRODUCTION backup file will be used to load different tables.
I will be submitting only one JOB, in turn it will submit one JOB for each table. Now i wanted to run FORCE job at the end of Table Loading. How i can make sure to execute the FORCE job after all the Loading Jobs has been completed.
Any idea to acheive this is greatly appriceiated. |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1787 Location: Bloomington, IL
|
|
|
|
JES2 or JES3?
What's your scheduler? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
Quote: |
I am planning to create one REXX macro to automate the DB2 Table Loading. I will receive Date from User and that date PRODUCTION backup file will be used to load different tables.
|
the first idea would be to start defining better Your requirement and how it relates to Your environment
the way is worded now has the same value as I promise to be a good boy/girl when told by a 4 Year old kid
but .....
1 -You have the date
2 - You have the other entities to be changed according to the date ( most probably dataset names )
3 - You have the JOB/sequence of JOBS to do the reload
4 - You will just have to customize the JCL whit the changes depending on the date, and submit it/them
does not seem overly complicated to me
my feeling is that
You have 1
but since most probably You do not have (3) it is impossible to determine (2)
( or at least not the complete scenario )
so (4) is a bit difficult to achieve
meditate a bit meditate .... |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
Can I suggest a slightly different approach ?
One rexx program that:
- displays a panel
Code: |
restore date: __ / __ / ____
action: _ 1 restore all tables
2 restore selected tables
tables: _ table01 _ table06
_ table02 _ table07
_ table03 _ table08
_ table04 _ table09
_ table05 _ table10
|
uses a skeleton to generate one job.
the job will include all tables or part of them according to action parameter.
uses an ISPF table to generate the same step(s) with different values.
a FORCE step added as last step in the job.
That requires some ISPF skills, but it's not that difficult.
May the Force be with you! |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
A Rexx macro - applied to what in what edit? Did you perhaps mean Rexx program? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
the different approach deals just with the lowly technicalities
it will be implementable only after items (3) and (2) of my previous list
have been eviscerated |
|
Back to top |
|
|
rexx77
New User
Joined: 14 Apr 2008 Posts: 78 Location: Mysore
|
|
|
|
My Sincere Aplogies for not making my requirements clear.
Here is the scneario.
1. User invokes the Rexx Program and it asks for Date parameter.
2. Rexx program opens each member(Loading JCL for individual table) in the defined PDS and change the date in that member and saves the data there itself.
3. Once all the members are changed, the rexx program submits one master job which inturn submits all the loading jcls from the defined PDS.
All the above points are completed and ready for usage. Now the tricky part is, i need to have one job executed at the end of all Loading jobs,
i.e. if had submitted 10 loading jobs, after all them completed, i want the FORCE job to be executed to clear out all the Copy pending status./
Is there any way to execute the FORCE job at the end of the Loading Process?. |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1787 Location: Bloomington, IL
|
|
|
|
rexx77 wrote: |
Is there any way to execute the FORCE job at the end of the Loading Process?. |
Quite possibly.
Is your system JES2 or JES3?
What scheduler do you run on it? |
|
Back to top |
|
|
rexx77
New User
Joined: 14 Apr 2008 Posts: 78 Location: Mysore
|
|
|
|
Scheduler JES2 is used in my shop. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
That was two seperate questions. JES2 is not a scheduler, it is a... Job Entry Subsystem, I suppose :-) Without it (or a replacement) it would be very inconvenient to run jobs, get your output, things like that.
A scheduler is an entirely different sort of beast. If you don't know what you have, contact the people who are responsible for production and ask them. |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
rexx77 wrote: |
My Sincere Aplogies for not making my requirements clear.
Here is the scneario.
1. User invokes the Rexx Program and it asks for Date parameter.
2. Rexx program opens each member(Loading JCL for individual table) in the defined PDS and change the date in that member and saves the data there itself.
3. Once all the members are changed, the rexx program submits one master job which inturn submits all the loading jcls from the defined PDS.
All the above points are completed and ready for usage. Now the tricky part is, i need to have one job executed at the end of all Loading jobs,
i.e. if had submitted 10 loading jobs, after all them completed, i want the FORCE job to be executed to clear out all the Copy pending status./
Is there any way to execute the FORCE job at the end of the Loading Process?. |
- What is "the defined PDS" ?
is it a private dataset, or is it shared by different users ?
if it is shared, how do you prevent one user overriding the other one ?
- The above points are completed doesn't mean you can't go back and improve things...
When you write "after all them completed" you mean "after all them successfully completed".
What happens when one load has failed ?
If one job has failed and you want to rerun, will you rerun all jobs ???
|
|
Back to top |
|
|
rexx77
New User
Joined: 14 Apr 2008 Posts: 78 Location: Mysore
|
|
|
|
@@ Marso, When i say defined PDS, it is a common PDS where i have stored all the table loading Jobs(one job for one table).
After submitting the master job, rexx program terminates, so when any job fails, the users will rerun the failed job alone.
This macro is designed to reduce the time/effort taken to prepare the loading jcl for different date and for different DB2 regions. being Internal project, There are very little chance that Two users will be using the macro at the same time to submit loading jobs.(Our Team size is very small)
Eveything has been coded and tested successfully. (Except the FORCE job submission part).
Thanks for asking valuable questions. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
the magic of rexx, to create custom jcl because developers don't know dog-poop about jcl, procs, etc.
these 'tools', when they finally work, at the stage/date of evolution at that time,
deprive developers the knowledge to 'create' new control cards for new tables.
most of the places that i work have 1000 or so tables in 8 to 10 different environments (test, unit, qa, prod, regions 1 thru nn)
and the necessity of such tools was not needed,
because appropriate cateloged procedures where developed
and documented
so anyone, including the non-tech types could do what they needed to do
to perform their work. |
|
Back to top |
|
|
|