Change param values from within a job

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
ivannavi
Premium Member
Premium Member
Posts: 120
Joined: Mon Mar 07, 2005 9:49 am
Location: Croatia

Change param values from within a job

Post by ivannavi »

I know it's not recommended, it's not documented and future versions will not support this.
BUT,
I'd still like to try.
I have read some topics (there are a few):
viewtopic.php?t=89419&highlight=STAGECOM.JOB.STATUS
viewtopic.php?t=89625&highlight=STAGECOM.JOB.STATUS
viewtopic.php?t=90189&highlight=STAGECOM.JOB.STATUS
viewtopic.php?t=90029&highlight=STAGECOM.JOB.STATUS

and tried to put this, first in a before-job routine and then in the job control:
$INCLUDE DSINCLUDE JOBCONTROL.H
$INCLUDE DSINCLUDE DSD_STAGE.H
$INCLUDE DSINCLUDE DSD.H
$INCLUDE DSINCLUDE DSD_RTSTATUS.H

ErrorCode = 0
ParamName = 'dat'
ParamList = STAGECOM.JOB.CONFIG<CONTAINER.PARAM.NAMES>
Locate(ParamName,ParamList,1;ParamPos) Then
STAGECOM.JOB.STATUS<JOB.PARAM.VALUES,ParamPos> = 'value'
End
The parameter is mentioned in a transformers link derivation and the column is then output to a seq file. But in the file there was a default value, not the one set through code.
The only time I was able to set the value is with before-stage subroutine of a Basic Transformer. But even then this value was not accessible outside of the transformer.
So what is the proper way to perform this "illegal" operation?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

There is no 'proper way' to do something illegal. :wink:

What makes you think you need to do this? Or is this just an academic expedition into DataStage hackerdom?
-craig

"You can never have too many knives" -- Logan Nine Fingers
jeawin
Participant
Posts: 18
Joined: Mon Oct 04, 2004 6:49 am
Location: Milton Keynes
Contact:

Post by jeawin »

There is a routine around which will let you set a parameter value from within a transform by having the following derivation:

RoutineName(in.ParameterName:"={Parameter value}")
or
RoutineName("{ParameterName}={Parameter value}")
or
RoutineName("{ParameterName}=":StageVariable) etc.

as long as {ParameterName} is a valid parameter name for that job.

It seems to work fine, certainly on Server Edition versions 5, 6, 7.1 and 7.5.

OOPS - Sorry, have just noticed query is for EE - ignore this then. :(
_______________________________________
"If I had asked people what they wanted they would have said faster horses"
Henry Ford
ivannavi
Premium Member
Premium Member
Posts: 120
Joined: Mon Mar 07, 2005 9:49 am
Location: Croatia

Post by ivannavi »

Or is this just an academic expedition into DataStage hackerdom?

It is! I would love to be able to do this! So why don't you tell me if you know how? :P
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Don't know how. Been using the product since the 3.0 days and never had a need to do anything of the sort, so never went over to the Dark Side.
-craig

"You can never have too many knives" -- Logan Nine Fingers
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

viewtopic.php?t=89625&highlight=STAGECOM.JOB.STATUS is my post mostly. It does not work any more. It is a hack but I think it was useful. You can easily do the same thing by writing out the value to a sequential file and reading back in every time you need it.
Mamu Kim
ivannavi
Premium Member
Premium Member
Posts: 120
Joined: Mon Mar 07, 2005 9:49 am
Location: Croatia

Post by ivannavi »

Thanks Kim!
It does not work any more.
Just to make sure:
This means that parameter values cannot be changed with a hack like this in version 7.5.1.1 (version on my site)?
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Try it and let us know.
Mamu Kim
ivannavi
Premium Member
Premium Member
Posts: 120
Joined: Mon Mar 07, 2005 9:49 am
Location: Croatia

Post by ivannavi »

I have tried exactly as quoted in my original post. It didn't work. All I ask now is for someone to confirm it was a "valid" try (one that would have worked on some other version). :?
Post Reply