Page 1 of 1

Param values not being inserted?

Posted: Fri Jul 13, 2007 7:39 pm
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

Posted: Fri Jul 13, 2007 8:15 pm
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.

Posted: Mon Jul 16, 2007 10:23 am
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.

Posted: Mon Jul 16, 2007 10:43 pm
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 ?