Call a Routine in a Parameter value
Moderators: chulett, rschirm, roy
Call a Routine in a Parameter value
Hi,
Can we call a routine as a parameter value in job properties.
like, I would like to use previous month end date as a parameter.
I know if it is a UNIX server, we can use a shellscript. but we are using a NT server.
Can somebody give me some inputs..
Thanks
Can we call a routine as a parameter value in job properties.
like, I would like to use previous month end date as a parameter.
I know if it is a UNIX server, we can use a shellscript. but we are using a NT server.
Can somebody give me some inputs..
Thanks
Re: Call a Routine in a Parameter value
No can't use script in parameter. But yes use can use shell scripts as a before and after routine. As per your use you can use your date shell scripting as a before routine and feed this date value to you job.kab123 wrote:Hi,
Can we call a routine as a parameter value in job properties.
like, I would like to use previous month end date as a parameter.
I know if it is a UNIX server, we can use a shellscript. but we are using a NT server.
Can somebody give me some inputs..
Thanks
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
In a job sequence you can call a routine OR a command/script/BAT file. Provided it's upstream of your Job activity, its return value can be used to supply the parameter value.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Re: Call a Routine in a Parameter value
hello, if my interpretation about your doubt is clear, i think you want to use a parameter, just like all other parameters used in JOB-PROPERTIES.
If you want to use this job to be executed from Batch file.
Then i think below could be a solution which is quite cumbersome.
you have to use these coding in JOB-CONTROL tab of Job-properties.
DSGetJobInfo.
DSSetParam
DSRunJob
DSWaitForJob
DSDetachJob, with DSSetParam you can set your parameter at run-time and use it for further processing.
If you want to use this job to be executed from Batch file.
Then i think below could be a solution which is quite cumbersome.
you have to use these coding in JOB-CONTROL tab of Job-properties.
DSGetJobInfo.
DSSetParam
DSRunJob
DSWaitForJob
DSDetachJob, with DSSetParam you can set your parameter at run-time and use it for further processing.
If you have the info in afile, you can certainly write a small routine to type the value of the file, capture its return and send it back [using DSExecute()]. Call this routine in the job parameter's area,the return value of the routine will then be populated in the job parameter.
I think thats what you were asking right?
I think thats what you were asking right?
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
DSguru2B said:
Ans="test_text".
Then I put a call to this function into "default value" of a parameter on parameters tab of job properties. The value of the parameter is sent to a seq file.
My function name is Expand. Well it didn't expand. Instead of "test_text", I see "Expand("dummy")".
What am I missing?
I have just tested this. Created a rutine (Transform function server routine)that does nothing but assign to "Ans" like this:Call this routine in the job parameter's area
Ans="test_text".
Then I put a call to this function into "default value" of a parameter on parameters tab of job properties. The value of the parameter is sent to a seq file.
My function name is Expand. Well it didn't expand. Instead of "test_text", I see "Expand("dummy")".
What am I missing?
Nothing, other than the fact that you cannot use a routine in a Job Parameter's default value. You have been led astray.ivannavi wrote:What am I missing?
Note Ray's answer - Sequence job, Routine Activity stage, downstream Job Activity stage takes the result of the routine call. If you want a 'GUI' solution, that is.
Otherwise, if you are using hand rolled Job Control code, simply call your routine to 'expand' the pathname before you do your DSSetParam calls. You'll need a DEFFUN statement so your job knows it's a 'user defined' routine and not one of its own. Search the site for quite a number of discussion on the subject. You'll need something like:
Code: Select all
DEFFUN Expand(A) calling "DSU.Expand"
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
You can, of course, do anything in job control (batch) code that a job sequence can do - a job sequence is nothing more than a job control code generator.
Therefore, in your batch code, use DSExecute() to execute your command, script, BAT file, whatever and to capture its output, then use that to provide a value to the job parameter using DSSetParam() before calling DSRunJob().
Therefore, in your batch code, use DSExecute() to execute your command, script, BAT file, whatever and to capture its output, then use that to provide a value to the job parameter using DSSetParam() before calling DSRunJob().
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.