Creating OSH Script

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
DSFreddie
Participant
Posts: 130
Joined: Wed Nov 25, 2009 2:16 pm

Creating OSH Script

Post by DSFreddie »

Hi All,

I have a requirement in my project where we have around 100 tables. We have to extract the data from Source Table & load it to Target Tables.

Can we do it through OSH Scripting- This is the client requirement (A generic Script)? If yes, where can i find some useful information related to this?

Checked in the PX forum & was not able to find any valuable information on the same.

Thanks in advance for your help.

Freddie.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Ignore your client requirement. Develop it in DataStage. When compiled this will generate an osh script that is run when the job is run. The client's requirement is now met.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
DSFreddie
Participant
Posts: 130
Joined: Wed Nov 25, 2009 2:16 pm

Post by DSFreddie »

Thanks Ray for your Reply.

Since the requirement is to extract the data from 150 DB2 tables & load into another set of similar tables in a different region, we dont want to create 150 DS jobs for the same. (Table to Table Load)

Can you pls let me know how to create OSH Scripts & make it generic so that we can call the same script multiple times to do this process.

Pls let me know where could I find the OSH Scripts generated while compiling the Jobs.

After creating this Script, where do we need to place it, how to run it etc.

Thanks for your help.
Freddie.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

When the job is compiled, the generated OSH script should be visible in the Job Properties workspace. It also gets written into the job log.

However this is never the script that gets executed. When the job is run, a new script, called the "score", is written. The score takes into account parallelism specified in the configuration file, which the generated osh does not - that is, the degree of parallelism is determined dynamically at run time rather than statically at design time.

If you create your job with Runtime Column Propagation enabled, the osh that comes out will be generic. You should be able to use it (the job or the script) 150 times with different record structures, provided you're not planning to effect any transformations, etc (which require fields to be named).

Scripts for job number nnn are stored in the project directory on the server in a sub-directory called RT_SCnnn.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Sounds like you need to read up on RCP - Runtime Column Propagation - rather than thinking you need to do anything with an OSH script.
-craig

"You can never have too many knives" -- Logan Nine Fingers
DSFreddie
Participant
Posts: 130
Joined: Wed Nov 25, 2009 2:16 pm

Post by DSFreddie »

Thanks for your reply.

I cannot use a RCP since I have a transformation in between the Source & Target DB. ( Addition of 2 columns).

Where can i find some sample OSH Scripts that will help me to write one for my requirement.

Thanks in advance
Freddie
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You CAN have RCP. Design it in Designer, compile it and see what develops.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
DSFreddie
Participant
Posts: 130
Joined: Wed Nov 25, 2009 2:16 pm

Post by DSFreddie »

Thanks Ray for your reply.

My understanding is, RCP will not work when the Source metadata & target metadata differs ( I have 2 additional columns in the target based on a derivation on couple of source columns).

One other query I have is,

I can get the OSH generated from the Designer ----> Job Properties -----> generated OSH.

What are the next steps I need to follow to run this OSH Script ? I have a UNIX script(Which performs 4/5 other validations/checks/statistics collection) from which I will call this OSH Script.

Can you pls let me know the directory where I need to place this .OSH script. Also, pls advise if I am missing some important steps here.

Thanks
Freddie.
FranklinE
Premium Member
Premium Member
Posts: 739
Joined: Tue Nov 25, 2008 2:19 pm
Location: Malvern, PA

Post by FranklinE »

Freddie, am I reading this right: Your development tool is DataStage, but the "clients" want this extract-load to run without the DS run-time engine.

So, if that's true, then it could be you are being pushed to use the wrong tool.

What is your destination? You write that the extract is from DB2, and the load is to "similar tables in a different region". If they are also DB2, then you might need to look to the DB2 utilities for this. My shop uses the BMC set. There are others available. If your shop has a set of load/unload utilities, that might be best for your situation.
Franklin Evans
"Shared pain is lessened, shared joy increased. Thus do we refute entropy." -- Spider Robinson

Using mainframe data FAQ: viewtopic.php?t=143596 Using CFF FAQ: viewtopic.php?t=157872
Post Reply