Hi,
I'm facing a situation I do not understand, even if everything is working ok.
Maybe someone know how this work ?
I'm using a job control in order to get the parameters values to execute a job sequence.
I'm doing something like this in order to get the parameters list :
ParamList = DSGetJobInfo(JobId, DSJ.PARAMLIST)
NbParam = DCount (ParamList, ',')
And then I get the parameters values from a configuration file, and use this command for each parameter :
ErrCode = DSSetParam(JobId, ParamName, ParamVal)
That is working fine, I get the good parameters for the execution of the job.
The strange thing is when I add that code after the alimentation of the parameters values in order to verify the alimentation :
For i = 1 to NbParam
ParamName= Field(ParamList, ',', i)
ParamType= DSGetParamInfo(JobId, ParamName, DSJ.PARAMTYPE)
If ParamType <> DSJ.PARAMTYPE.ENCRYPTED
Then
ParamVal = DSGetParamInfo(JobId, ParamName, DSJ.PARAMVALUE)
CALL DSLogInfo(NomParam : " for verification : " : Param Val, ProgramName)
End
Next i
The values I get from the command DSGetParamInfo are the default values, and not the values I've just assigned to the parameters.
Am I doing something wrong ?
Thanks for your help,
Nicolas
Using DSSetParam and DSGetParamInfo in a job control
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 13
- Joined: Fri Aug 11, 2006 11:57 am
- Location: Toulouse, France
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
No you are not doing anything wrong, this is one of those strange behaviours of DataStage. If you run the job, and retrieve the parameter values afterwards with DSJ.PARAMVALUE, you will get back what you set. But, until the job has run, you do not.
It is sufficient, in your case, to test the value returned by DSSetParam. If it is zero (DSJE.NOERROR), then all is well. If it is a negative integer, then there was some kind of a problem, such as DSJE.BADPARAM or DSJE.BADVALUE. Mnemonics are declared in the JOBCONTROL.H header file.
It is sufficient, in your case, to test the value returned by DSSetParam. If it is zero (DSJE.NOERROR), then all is well. If it is a negative integer, then there was some kind of a problem, such as DSJE.BADPARAM or DSJE.BADVALUE. Mnemonics are declared in the JOBCONTROL.H header file.
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.
-
- Participant
- Posts: 13
- Joined: Fri Aug 11, 2006 11:57 am
- Location: Toulouse, France
Ok, thanks for your answer.
Too bad I can't read the post, but I get the point from the first sentence
About the online help on the DSGetParamInfo function :
Too bad I can't read the post, but I get the point from the first sentence
![Wink :wink:](./images/smilies/icon_wink.gif)
About the online help on the DSGetParamInfo function :
Maybe we can say that as I do not have started the job yet, the values I get are those of the previous run ?DSJ.PARAMVALUEString - Current value of the parameter for the running job or the last job run if the job is finished.
Yes. And as an FYI, I've never bothered to check to that level. Simply checking the status of the DSSetParam function is sufficient:nisaumande wrote:Maybe we can say that as I do not have started the job yet, the values I get are those of the previous run ?
Code: Select all
ErrCode = DSSetParam(JobId, ParamName, ParamVal)
If ErrCode # DSJE.NOERROR Then
(error code)
End
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 13
- Joined: Fri Aug 11, 2006 11:57 am
- Location: Toulouse, France
Actually I wanted to check the values I got from the parameters files rather than the action of assigning the value.chulett wrote:And as an FYI, I've never bothered to check to that level. Simply checking the status of the DSSetParam function is sufficient:
Code: Select all
ErrCode = DSSetParam(JobId, ParamName, ParamVal) If ErrCode # DSJE.NOERROR Then (error code) End
But I'll do the DSLogInfo when retrieving the values.
Thanks !