Page 1 of 1

Creating OSH Script

Posted: Wed Sep 29, 2010 10:23 am
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.

Posted: Wed Sep 29, 2010 5:12 pm
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.

Posted: Wed Sep 29, 2010 6:04 pm
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.

Posted: Wed Sep 29, 2010 7:12 pm
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.

Posted: Wed Sep 29, 2010 9:14 pm
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.

Posted: Sun Oct 03, 2010 8:06 pm
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

Posted: Sun Oct 03, 2010 8:17 pm
by ray.wurlod
You CAN have RCP. Design it in Designer, compile it and see what develops.

Posted: Sun Oct 03, 2010 8:46 pm
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.

Posted: Mon Oct 04, 2010 7:30 am
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.