Page 1 of 1

How to assign parameter a value

Posted: Fri Jun 08, 2012 12:09 pm
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.

Posted: Fri Jun 08, 2012 12:16 pm
by pandeesh
use a parameter and pass the same to downstream jobs. :)

Posted: Fri Jun 08, 2012 12:26 pm
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,

Posted: Fri Jun 08, 2012 12:56 pm
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

Posted: Fri Jun 08, 2012 1:07 pm
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?

Posted: Fri Jun 08, 2012 1:50 pm
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.

Posted: Fri Jun 08, 2012 1:59 pm
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,

Posted: Mon Jun 11, 2012 7:10 am
by Billyqing
Could the host of forum move this post into DataStage PX forum?

Thanks,

Posted: Mon Jun 11, 2012 7:20 am
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!

Posted: Wed Sep 26, 2012 10:53 am
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,

Posted: Wed Sep 26, 2012 1:23 pm
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.