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

Query in Table Loading REXX macro


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rexx77

New User


Joined: 14 Apr 2008
Posts: 78
Location: Mysore

PostPosted: Thu Feb 23, 2012 3:44 pm
Reply with quote

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
View user's profile Send private message
Akatsukami

Global Moderator


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

PostPosted: Thu Feb 23, 2012 4:03 pm
Reply with quote

JES2 or JES3?

What's your scheduler?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10888
Location: italy

PostPosted: Thu Feb 23, 2012 6:24 pm
Reply with quote

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 icon_cool.gif

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 icon_cool.gif
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
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Thu Feb 23, 2012 8:07 pm
Reply with quote

Can I suggest a slightly different approach ?

One rexx program that:
  1. 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       
                                               
  2. uses a skeleton to generate one job.
    the job will include all tables or part of them according to action parameter.
  3. uses an ISPF table to generate the same step(s) with different values.
  4. 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
View user's profile Send private message
Nic Clouston

Global Moderator


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

PostPosted: Thu Feb 23, 2012 8:34 pm
Reply with quote

A Rexx macro - applied to what in what edit? Did you perhaps mean Rexx program?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10888
Location: italy

PostPosted: Thu Feb 23, 2012 8:56 pm
Reply with quote

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
View user's profile Send private message
rexx77

New User


Joined: 14 Apr 2008
Posts: 78
Location: Mysore

PostPosted: Thu Feb 23, 2012 9:18 pm
Reply with quote

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
View user's profile Send private message
Akatsukami

Global Moderator


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

PostPosted: Thu Feb 23, 2012 9:27 pm
Reply with quote

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
View user's profile Send private message
rexx77

New User


Joined: 14 Apr 2008
Posts: 78
Location: Mysore

PostPosted: Thu Feb 23, 2012 9:45 pm
Reply with quote

Scheduler JES2 is used in my shop.
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: Fri Feb 24, 2012 3:29 pm
Reply with quote

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
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Sun Feb 26, 2012 8:29 pm
Reply with quote

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
View user's profile Send private message
rexx77

New User


Joined: 14 Apr 2008
Posts: 78
Location: Mysore

PostPosted: Tue Feb 28, 2012 10:39 am
Reply with quote

@@ 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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Feb 28, 2012 10:55 am
Reply with quote

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
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 -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Run rexx with JCL Job CLIST & REXX 1
No new posts Run rexx in batch job CLIST & REXX 7
No new posts Does anyone know rexx for VSE CLIST & REXX 3
No new posts TSO ALLOC In REXX Needs Improvement JCL & VSAM 3
No new posts Need help with ADABAS query (COBOL-AD... All Other Mainframe Topics 0
Search our Forums:

Back to Top