Page 1 of 2

Posted: Tue Jun 03, 2003 2:21 pm
by tonystark622
I'm pretty sure that you can just access them as you would variables, e.g. if you had a job param named 'FilePath', you would use FilePath in your routine.

Hope I'm right[;)],

Tony

Posted: Tue Jun 03, 2003 5:56 pm
by vmcburney
Job parameters are not global parameters so they are not available to the routines called up by a server or sequence job. The way to retrieve job parameters within a routine is to either pass them in as arguments or to attach the job within the routine and use the DSGetParamInfo command to retrieve parameter values. According to the server job programming guide the DSGetParamInfo routine with the DSJ.PARAMVALUE option will return the current value of the parameter for a running job or the last job run if the job is finished.

I think the first method is better and more robust, if someone renames or removes the job parameter the job recompile will inform the user that they need to change the argument as well.

Vincent McBurney
Data Integration Services
www.intramatix.com

Posted: Tue Jun 03, 2003 7:45 pm
by tonystark622
Thanks, Vincent.

Sorry to pass along bad information.

TOny

Posted: Tue Jun 03, 2003 8:07 pm
by vmcburney
We are going to have to drop you back to four stars. [:D]

Vincent McBurney
Data Integration Services
www.intramatix.com

Posted: Wed Jun 04, 2003 7:53 am
by tonystark622
No problem. I'm not sure what the stars mean anyway. Whatever they mean, I probably don't deserve 5 anyway [8D]

Posted: Wed Jun 04, 2003 9:11 am
by chulett
The stars just show aggregate posting numbers, the more the merrier. They top out at five I believe, otherwise Ray would need sixty or seventy. [:o)]

-craig

Posted: Wed Jun 04, 2003 5:41 pm
by ray.wurlod
Check out Parameter Manager for DataStage, from the folks who provide this Forum. [;)]
There's a link at the top of this screen to get you there. You can watch a (video) demo, do a tutorial, download a 30 day evaluation, determining pricing information (it's very reasonable), and even buy it!
Among other things, you can get some kind of globalization of job parameters happening, though not at run time (which is what you were after).

[Potential Conflict of Interest]
If the buyer is outside the Americas, I can supply this software and would earn a commission thereon.

All that said, there's something not right about an assertion in this thread. See my next post.

Ray Wurlod
Education and Consulting Services
ABN 57 092 448 518

Posted: Wed Jun 04, 2003 5:48 pm
by ray.wurlod
One of my pet peeves is folks not checking the return status of DataStage functions. In the current example, this would provide instant identification about why a parameter called FilePath could not have its value returned by DSGetParamInfo (possibilities include invalid job handle, no such parameter (misspelled/miscased), invalid value (supplied value not a pathname) and so on).


$IFNDEF JOBCONTROL.H
$INCLUDE DSINCLUDE JOBCONTROL.H
$ENDIF

ParamName = "FilePath"

PathName = DSGetParamInfo(hJob, ParamName, DSJ.PARAMVALUE)
Begin Case
Case PathName = DSJ.BADHANDLE
Msg = "Job not attached (DSGetParamValue)."
Case PathName = DSJ.BADPARAM
Msg = "Parameter " : Quote(ParamName) : " not found in job."
* ... and so on
End Case

Posted: Thu Jun 05, 2003 11:12 am
by kduke
Raggid

Vincent is correct. You need to pass it as an argument. If I am reading your message correctly the problem may be that a parameter name should not have spaces in it. If you have a parameter named file path then change it to FilePath. Next call your routine like this MyRoutine(FilePath) in a derivation. If you are calling it from job control then the syntax is a little different.

Thanks Kim.


Kim Duke
DwNav - ETL Navigator
www.Duke-Consulting.com

Posted: Sat Jun 07, 2003 8:31 am
by alex
quote:Originally posted by raggid
[br]I have a lot of parameters defined and it would be messy to have to redefine then in the subroutine I am using.

How do I access the values in already defined job parameters?

Thanks in advance,
Raggy

Posted: Sat Jun 07, 2003 8:33 am
by alex
when you call routine, you have to pass job parameters to routine parameter. Then you can access job parameter.
quote:Originally posted by raggid
[br]I have a lot of parameters defined and it would be messy to have to redefine then in the subroutine I am using.

How do I access the values in already defined job parameters?

Thanks in advance,
Raggy