Parameter set used in Transformer = Compilation error

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
Druid_Elf
Participant
Posts: 32
Joined: Thu Aug 28, 2008 5:53 am

Parameter set used in Transformer = Compilation error

Post by Druid_Elf »

Hi all,
I've got a weird situation. We've got a parallel job which has got as parameter a parameterset. The parameterset contains as parameters project variables.
Now I can call without problem the #parameter.$projvar# in an oracle stage to specify the database connection.

Now I want to use a proj variable, defined in the parameterset, in a transformer stage. I can select the value parameter.$projvar by right clicking in a field in the transformer and select job parameter.
So far no error. If I compile the job I get an error on the transformer saying the token is unknown.

I've tried adding # in front and at the end ( #paramset.$projvar#) but then the transformer marks the line as red immediately. Is it not possible to call a proj variable from a parameter set in a transformer (is this maybe a bug) or am I doing something wrong ?

Thanks in advance for any help :)
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I'm assuming this advice is valid here as well: search the forums for information on the GetEnvironment() function and try using that.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Druid_Elf
Participant
Posts: 32
Joined: Thu Aug 28, 2008 5:53 am

Post by Druid_Elf »

hi,
I've tried the function you suggested, now the job compiles but if i output the value of the function it remains blanco.
Currently i've tried this:
GetEnvironment("PS_DEF_VALUES.$DEF_UNKNOWN")
GetEnvironment("PS_DEF_VALUES.DEF_UNKNOWN")

The $DEF_UNKNOWN is a project variable containing the String "Unknown" and PS_DEF_VALUES is the parameterset.

But the value remains empty when outputting in the job. Any idea what the problem can be ?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Try just GetEnvironment(DEF_UNKNOWN) as the parameter set name isn't part of the environment variable name that is actually set.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Druid_Elf
Participant
Posts: 32
Joined: Thu Aug 28, 2008 5:53 am

Post by Druid_Elf »

Thanks now its working. But now you are actually reading the value of the project variable and you are not reading from the parameterset. But thanks anyway it works :)
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Druid_Elf wrote:But now you are actually reading the value of the project variable and you are not reading from the parameterset.
As the ancient philosopher Sam Ting would say - they are equivalent in this case. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Maybe not. What if the parameter value had been overridden in the job run request?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Still... would that not be the current value of the parameter in the job's runtime environment?
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Only if the default value in the project were $ENV surely?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Ah... I grok. I was thinking that overriding the value would also change the value of the variable in the job's environment, but you're saying that's not the case - it would just pass the 'new' value in as the parameter's value.

Is there some other way to bring that parameter set value into a transformer derivation? Something 100% correct all the time?
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The default value in the Parameter Set for the parameter can still be $PROJDEF, $ENV or $UNSET.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Druid_Elf
Participant
Posts: 32
Joined: Thu Aug 28, 2008 5:53 am

Post by Druid_Elf »

Currently the default value parameter is set $PROJDEF.
So is there a way to read the parameter value in the transformer ? I'm kinda curious now :)
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Just a parameter reference in an expression should yield the parameter value at run time. The job log will show the value that was passed to the job, annotated that it is the $PROJDEF value if such is the case.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
michaeld
Premium Member
Premium Member
Posts: 88
Joined: Tue Apr 04, 2006 8:42 am
Location: Toronto, Canada

parameter set with $PROJDEF not working in seq file stage

Post by michaeld »

I have a parameter set with a project parameter ppSourceDir which is set to $PROJDEF.

If I use it in a seq file stage to point to the source file then it does not resove the $PROJDEF value from DSParams. However if I click on VIEW DATA then it does resolve it.

example:
source #paramset.$ppSourceDir#test.txt

view data will resolve it to:
d:\folder\test.txt

when I run the job it will resolve to this:
$PROJDEF\test.txt


does anybody else get this error? Is there a patch?
Mike
Post Reply