Creating dynamic table.

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
UPS
Premium Member
Premium Member
Posts: 56
Joined: Tue Oct 10, 2006 12:18 pm
Location: New Jersey

Creating dynamic table.

Post by UPS »

Hi,
Newbie Questions :?:
I am reading sequential files using file pattern & trying to load temp tables for each changing time period(YYMM). I need to pass parameter to Oracle stage to create tables with changing YYMM?

Thanks in Advance.
SP.
kris
Participant
Posts: 160
Joined: Tue Dec 09, 2003 2:45 pm
Location: virginia, usa

Re: Creating dynamic table.

Post by kris »

Have a JOB parameter for the period and use it as part of the table name in the DATABASE stage.

something like
TEMPTABLE_#Param_Period#

Every time you run the job, you will create a new table. But you need to be mindful about the fact that when the period doesn't change, table need to be dropped or handled correctly.
~Kris
UPS
Premium Member
Premium Member
Posts: 56
Joined: Tue Oct 10, 2006 12:18 pm
Location: New Jersey

Re: Creating dynamic table.

Post by UPS »

kris wrote:Have a JOB parameter for the period and use it as part of the table name in the DATABASE stage.

something like
TEMPTABLE_#Param_Period#

Every time you run the job, you will create a new table. But you need to be mindful about the fact that when the period doesn't change, table need to be dropped or handled correctly.
The Parameter is a field in the sequential file. How do I pass it to the table name in the same job... If I say #DSLinkname.fieldname# in the table name, job parameter doesn't get resolved. I am using Oracle Enterprise stage with load option.

Thanks
SP
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You can't. It must be a Job Parameter passed in from another source, like another job or routine. A Sequence job could easily do the trick, read the file to get the parameter value and then pass it to your processing job.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Job parameters must be defined in the job properties dialog. Use the fifth tool from the left on the toolbar, or Ctrl-J, to open this dialog.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
anshumangupta1206
Participant
Posts: 42
Joined: Tue Jan 24, 2006 9:11 am

Re: Creating dynamic table.

Post by anshumangupta1206 »

[quote="UPS"]

You can pass the seq file value in the DS routine. The routime will set the parameter using 'DSSetParam ' function and call a job 'DSRunJob'.

Thanks.
wed
Post Reply