Forming a Dynamic Query in UDB

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
Inquisitive
Charter Member
Charter Member
Posts: 88
Joined: Tue Jan 13, 2004 3:07 pm

Forming a Dynamic Query in UDB

Post by Inquisitive »

The output of a UDB Stage is a date (CREATE_D). I need to use this date to select data from a different database.

A possible approach ? : Store the CREATE_D in a sequential file. Write a basic routine to read this value and invoke a job which takes the CREATE_D as a parameter.

Select A,B,C from DB2PROD.ALPHA where SOME_DATE > <JOB-PARAMETER>

i) Can one do this in a Parallel Job ? If so, how ?

ii) If not, how can one do it in a Server Job ?

Can anyone suggest a neater and cleaner method ?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Neater and cleaner: do it in a job sequence, or in a "roll your own" job control routine. This can pass the date to the main job (parallel or server) as a parameter value.

Another way is to extract the date into a text file, as you indicated, then load an environment variable with the date.

Code: Select all

CREATEDATE=`head -1 filename`; export CREATEDATE
You can then use the environment variable to supply the value to the job parameter.
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