How to assign parameter a value

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
Billyqing
Participant
Posts: 44
Joined: Thu May 13, 2004 12:00 pm
Location: Canada

How to assign parameter a value

Post by Billyqing »

At my job design, I have to assign parameter a values. This value will be passed to the down stream jobs.

What is the best way to do so?

Thanks in advance.
Bill
pandeesh
Premium Member
Premium Member
Posts: 1399
Joined: Sun Oct 24, 2010 5:15 am
Location: CHENNAI, TAMIL NADU

Post by pandeesh »

use a parameter and pass the same to downstream jobs. :)
pandeeswaran
jwiles
Premium Member
Premium Member
Posts: 1274
Joined: Sun Nov 14, 2004 8:50 pm
Contact:

Post by jwiles »

Well....

1) Use a job sequence, give it the parameter and pass that parameter to jobs/sequences called by the master sequence
2) Use a parameter set containing the parameter
3) Use a combination of 1 and 2 above

Regards,
- james wiles


All generalizations are false, including this one - Mark Twain.
Billyqing
Participant
Posts: 44
Joined: Thu May 13, 2004 12:00 pm
Location: Canada

Post by Billyqing »

Thanks for your feedback.

My question is how to assign a values to the parameter which will be used to passed to down stream jobs.


The value is dynamic selected from DB table.
The way I am current used is not good enough, my opinion at least.
So I am looking for the best one.

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

Post by chulett »

1) Use a Server job to fetch the parameter value.
2) Write the parameter value to the job's USERSTATUS area
3) Assign all downstream job parameter values to $UserStatus from the Server job.

You'll need to build a little routine to call the DSSetUserStatus function but the code for that can be found here. Another option is to write the value to a flat file then use a routine or command to 'read' it and then assign the output from that to any downstream job parameters.

What is your current methodology?
-craig

"You can never have too many knives" -- Logan Nine Fingers
Billyqing
Participant
Posts: 44
Joined: Thu May 13, 2004 12:00 pm
Location: Canada

Post by Billyqing »

Thank you, Craig.

My current approach is to select the results from a DB table and write the results into a file. Then using a function to get the value from the file just saved. Finally pass the parameters into down stream jobs.

Hope this is clear to you.
Bill
jwiles
Premium Member
Premium Member
Posts: 1274
Joined: Sun Nov 14, 2004 8:50 pm
Contact:

Post by jwiles »

A modification of the file method which would also work:

You can write the value to a parameterset valuefile in the form of PARAMETER=VALUE, then pass that parameterset, using the valuefile name, to a child sequence which calls your jobs.

Regards,
- james wiles


All generalizations are false, including this one - Mark Twain.
Billyqing
Participant
Posts: 44
Joined: Thu May 13, 2004 12:00 pm
Location: Canada

Post by Billyqing »

Could the host of forum move this post into DataStage PX forum?

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

Post by chulett »

If I felt this discussion was something specific to the PX product, I would have moved it already. :wink:

This is a perfectly appropriate General topic. Carry on!
-craig

"You can never have too many knives" -- Logan Nine Fingers
joycerecacho
Participant
Posts: 298
Joined: Tue Aug 26, 2008 12:17 pm

Post by joycerecacho »

chulett wrote:1) Use a Server job to fetch the parameter value.
2) Write the parameter value to the job's USERSTATUS area
3) Assign all downstream job parameter values to $UserStatus from the Server job.
Hi everybody.
I have the same issue.
How do I use a Server job to fetch the parameter value?

Thank guys!

Best regards,
Joyce A. Recacho
São Paulo/SP
Brazil
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Thought you weren't allowed to use Server jobs? If this case 'fetch' just means 'read from' because the parameter was stored in a database table.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply