To pass job parameter in a SQL file

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
dxk9
Participant
Posts: 105
Joined: Wed Aug 19, 2009 12:46 am
Location: Chennai, Tamil Nadu

To pass job parameter in a SQL file

Post by dxk9 »

Hi,

I want to call the job parameter (age) in the where clause of the SQL file called in the DB2 stage.

The clause used in the sql file is :

'where Cust_Age = '#age#'

But its not recognizing the parameter.

Kindly help.

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

Post by ray.wurlod »

Why would you ever expect it to work? The scope of a job parameter is the job itself. The SQL file is external to the job.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
dxk9
Participant
Posts: 105
Joined: Wed Aug 19, 2009 12:46 am
Location: Chennai, Tamil Nadu

Post by dxk9 »

Thanks.

Can you plz let me know which is the best way to do it ?

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

Post by chulett »

If you insist on using a SQL file, you would need to translate the parameter and build the file with the actual value in it. Each time.
-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 »

In a sequence read the value then pass it to a job that includes parameterized SQL within the job design itself. Or have the sequence generate the entire SQL statement and pass that to the job as a 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