Page 1 of 2

Adding enviornmental Variable

Posted: Mon Apr 02, 2007 3:03 am
by sjordery
Hi All,

Can any body will suggest me ow to add enviornment variable in datastage parallel job.

Posted: Mon Apr 02, 2007 3:11 am
by kumar_s
Could you explain bit more on you question.
You can add User defined Variable through Datastage Adminstrator client.
And you can use the same in jobs, optionally with $PROJDEF default value.
$ENV is used to access the OS variables in you jobs.

Posted: Mon Apr 02, 2007 4:54 am
by sjordery
Hi,

Actually I want to assign some values to the enviornment variables from a particular job during run time and I want to refer these values in the sequence job.
please let me know whether it will work or not.

Posted: Mon Apr 02, 2007 6:45 am
by Narayana
you can create the env variable under user-defined category either in the job properties option or in the DS administrator and can pass defalut values during run time.

Posted: Mon Apr 02, 2007 7:44 am
by sjordery
okay.
but there are several options avaliable in job properties like

1-general
2-parallel
3-compiler
4-operator specific
5-reporting

so please be specific how I have to add the enviornment variable.

I am using recent 7.5x ds version parallel job in unix platform.
Another thing can reffer these variables in sequence job.

please suggest me.

Posted: Mon Apr 02, 2007 7:51 am
by DSguru2B
Go to parameters tab in job properties, you will find Add Environment Variable bottom right, click on that and hit on New. Follow the commands then.

Posted: Mon Apr 02, 2007 8:00 am
by chulett
:? I don't believe the question as asked is being addressed:
sjordery wrote:Actually I want to assign some values to the enviornment variables from a particular job during run time
It's not about creating and using variables during runtime but about creating and setting variables during runtime.

Carry on.

Re: Adding enviornmental Variable

Posted: Mon Apr 02, 2007 8:34 am
by ray.wurlod
sjordery wrote:Hi All,

Can any body will suggest me ow to add enviornment variable in datastage parallel job.
Do you mean:
(a) add a new environment variable that a job can use as a job parameter?
(b) add an environment variable to a job as a job parameter?
(c) change the value of an environment variable while a job is running?
(d) something else?

The first requires use of the Administrator client or editing the EnvVarDefns section of your DSParams file (which has implications for promoting into test/production).

The second involves clicking the Add Environment Variable button in the job's properties (Parameters tab).

The third is unsupported.

The fourth involves you responding to this post.

Posted: Thu Apr 05, 2007 5:16 am
by sjordery
Hi Wurlod,

Sorry for late reply.

Actually I want to pass values of some attributes to the enviornmental variable in a parallel job so that I can reffer these values in the sequence job to use in the email notification activity.

So will you please tell me for this purpose how I have to add the enviornmental variable and pass the values to those variables.

Posted: Thu Apr 05, 2007 6:01 am
by chulett
:? Isn't that (c) in Ray's list? If so, you're going to need to take another path.

Posted: Thu Apr 05, 2007 6:06 am
by sjordery
Hi Craig,

About which path you are telling.
Please mention

Posted: Thu Apr 05, 2007 6:16 am
by chulett
Forget about my 'path' statement. You need to resolve the confusion about what exactly it is you are trying to accomplish. Ray posted a list of four possible meanings - which one is correct? Any? None? :?

To me, it sounds like (c) which is the third item in his list and as mentioned, it is unsupported. Hence my assertation that - if (c) is the answer - you'll need to find another way to solve your problem.

Posted: Thu Apr 05, 2007 6:55 am
by sjordery
Hi,
You can take the option (d) (something else)from ray's given options..
Actually I want to assign values to the ENV from a job.
And that value will be reffered in the sequence job.
If without ENV my problem can be solved then please suggest.

Posted: Thu Apr 05, 2007 6:59 am
by DSguru2B
Its similar to passing values between jobs. Write your value to a flat file and in the sequence job activity, define a parameter to the job that needs to read that value. In the derivations you can call a small routine that cats the file and reads its contents using DSExecute().

Posted: Thu Apr 05, 2007 7:13 am
by chulett
sjordery wrote:You can take the option (d) (something else)from ray's given options.. Actually I want to assign values to the ENV from a job.
Umm... that's (c).

As noted, pass this value via a flat file or User Status.