Paremetrize the columns in a DB stage.

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
Minhajuddin
Participant
Posts: 467
Joined: Tue Mar 20, 2007 6:36 am
Location: Chennai
Contact:

Paremetrize the columns in a DB stage.

Post by Minhajuddin »

Hi there,

Can you guys Please help me with this scenario.

Code: Select all

                         DRS_Stage
                                |
                                |
                                |
                                |
                                |
                                V
Sequential_File ----->JOIN_Stage---------->Sequential_File

I have ten parallel jobs which have the same setup as the one shown above.

Here the input source file, the schema of the input file, the output file, the columns from the DB stage all are same.

The only difference in them is in the key which is used to join. In the ten jobs I use ten different columns to join the data.

I was thinking of implementing it using a single job and parametrizing the key column name in the join stage. Is that possible?. And if we can parametrize, Can we use multiple instances of job?
Or do I need to create copies of the job and change the key column names in all the jobs.......

I really appreciate your help.

Thank you :D
Last edited by Minhajuddin on Wed May 30, 2007 10:47 am, edited 1 time in total.
Minhajuddin

<a href="http://feeds.feedburner.com/~r/MyExperi ... ~6/2"><img src="http://feeds.feedburner.com/MyExperienc ... lrow.3.gif" alt="My experiences with this DLROW" border="0"></a>
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Sorry buddy. You cannot parametrize column names. No method that I know of. You will have to explicity define column names and keys.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Minhajuddin
Participant
Posts: 467
Joined: Tue Mar 20, 2007 6:36 am
Location: Chennai
Contact:

Post by Minhajuddin »

Is there any way we can do this using routines or Buildops or any other options :(
Minhajuddin

<a href="http://feeds.feedburner.com/~r/MyExperi ... ~6/2"><img src="http://feeds.feedburner.com/MyExperienc ... lrow.3.gif" alt="My experiences with this DLROW" border="0"></a>
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

I doubt it. If you are really eager to get rid of 10 jobs and keep one then you can get away with it by maintaining two jobs.
Job1 will load your source file into a temp table.
Job2 will take in user defined sql that joins the tables and spits out the result to a flat file. You can parametrize the user defined sql.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Minhajuddin
Participant
Posts: 467
Joined: Tue Mar 20, 2007 6:36 am
Location: Chennai
Contact:

Post by Minhajuddin »

Can you please elaborate on how to go about with job2.

How can I write a SQL Query which is paremetrizeble.

Do you mean I can create a job parameter say "SQL" and put just "SQL" in the User defined SQL box of the DRS stage?

Thanks for the help.
Minhajuddin

<a href="http://feeds.feedburner.com/~r/MyExperi ... ~6/2"><img src="http://feeds.feedburner.com/MyExperienc ... lrow.3.gif" alt="My experiences with this DLROW" border="0"></a>
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Yes. SQL will be surrounded by hashes ofcourse telling the engine that it is a parameter.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Minhajuddin
Participant
Posts: 467
Joined: Tue Mar 20, 2007 6:36 am
Location: Chennai
Contact:

Post by Minhajuddin »

Thanks for all the Help DSguru2B :D
Minhajuddin

<a href="http://feeds.feedburner.com/~r/MyExperi ... ~6/2"><img src="http://feeds.feedburner.com/MyExperienc ... lrow.3.gif" alt="My experiences with this DLROW" border="0"></a>
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Try relying upon Runtime Column Propagation. You will, of course, need to specify the join key, so that may limit your flexibility somewhat.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply