Param values not being inserted?

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
val
Participant
Posts: 21
Joined: Tue Jun 05, 2007 4:11 pm

Param values not being inserted?

Post by val »

I'm having trouble using parameters and environment variables in a job, and can't find info in the docs or here on the forums to get unstuck.

I have a sequence that calls a job. The job writes a sequential file. The output path should come from an environment variable named $SOURCE_PATH, which is currently set to the value "d:\data".

In my project, I created a parameter set named "IDS_params". In one of the params I added the $SOURCE_PATH environment variable; its value "d:\data" showed up in the Default Value field of the Parameters tab.

On the Values tab, I created three rows, with Value File Names of "dev", "prod", "test". For the value of $SOURCE_PATH I specified "$PROJDEF" for each row; from what I understand, that should pick up the current environment's value for the param set chosen at runtime, so whether I spec "dev" or "prod", $SOURCE_PATH should have the value of the current runtime environment.

I have another param named "PathCompliantTimestamp" that's the return value from a routine.

In the sequence, I create a Job stage, and give it the "IDS_params" set, with the value expression set to "dev".

Now, I go to my job, and in the Sequential File stage's Input tab, use the following for File Name:

Code: Select all

#IDS_params.$SOURCE_PATH#\insurance_#PathCompliantJobStartTimestamp#.csv
My job aborts with an error like:

Code: Select all

SVR_ICD0006_IDS_to_SAP..SEQ_write_intermediate_file.IDENT1: |SVR_ICD0006_IDS_to_SAP..SEQ_write_intermediate_file.IDS_file_OUT: DSD.SEQOpen Unable to create file $PROJDEF\insurance_2007-07-13_18-14-22.csv|
I get similar results if I use

Code: Select all

#$SOURCE_PATH#
(it's an environment var, so should be accessible even without reference to the param set, yes?)
or

Code: Select all

$SOURCE_PATH
(I guessed perhaps the ## aren't needed for $variables?)

In those cases the error says "Unable to create file $SOURCE_PATH" rather than "Unable to create file $PROJDEF", but it's basically the same problem -- no variable interpolation.

If I hard-code the path, the other param (the timestamp) is getting replaced properly, so the general param-passing setup seems OK. This works:

Code: Select all

D:\data\insurance_#PathCompliantJobStartTimestamp#.csv
creates a file named

Code: Select all

D:\data\insurance_2007-07-13_18-04-59.csv
But obviously I don't want hard-coded paths in my job! Can anyone tell me why my environment var isn't getting resolved?

Thanks!

- Val
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

There is very little experience with parameter sets here, since they are new in version 8.0.

Please bounce this back to your support provider - ideally with a reproducible case that they can send to IBM when asked to - and keep us informed about what they say.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
gomez
Premium Member
Premium Member
Posts: 83
Joined: Tue Jun 22, 2004 6:11 am

Post by gomez »

Durn, I should have posted on DeveloperWorks at the same time -- heading over there now, and will contact IBM support as well. I'll update this thread when I get resolution.

- Val
ray.wurlod wrote:Please bounce this back to your support provider - ideally with a reproducible case that they can send to IBM when asked to - and keep us informed about what they say.
hamzaqk
Participant
Posts: 249
Joined: Tue Apr 17, 2007 5:50 am
Location: islamabad

Post by hamzaqk »

You DO need a ## when you refer to environment variables i.e. #$EnvVar#

have u set the variables in sequence so they point to the parameters in the job activity at the sequence level ?
Post Reply