Page 1 of 1

System variables

Posted: Wed Mar 15, 2006 3:42 am
by jagadhish
Hi Everyone,

Need some help with accessing system variables in datastage.
I know that we can access a pre-definded system variables using @LOGNAME, @PATH and so on.
But if I create a new system variable, how can I access that variable in datastage?

Posted: Wed Mar 15, 2006 3:51 am
by ArndW
You cannot create your own system variables in DataStage.

You can create and access your own environment variables. You can create your own routines and functions which can be accessed as if they were system variables.

System environment variables

Posted: Wed Mar 15, 2006 4:10 am
by jagadhish
Thanks Arnd.

Just to make things a little more clear,
I have created a system environment variable in Windows (say, Variable Name = username and Variable Value = abc).
Can I use this environment variable(i.e. username) in a DataStage job.

From what I made out from your previous reply, you said that this can't be done. Is that correct?

Thanks.

System environment variables

Posted: Wed Mar 15, 2006 4:10 am
by jagadhish
Thanks Arnd.

Just to make things a little more clear,
I have created a system environment variable in Windows (say, Variable Name = username and Variable Value = abc).
Can I use this environment variable(i.e. username) in a DataStage job.

From what I made out from your previous reply, you said that this can't be done. Is that correct?

Thanks.

Posted: Wed Mar 15, 2006 6:06 am
by ray.wurlod
There are six system variables there for you to use. Their names are @USER.RETURN.CODE and @USER0 through @USER4. They are automatically initialized to zero, but remain untouched by DataStage after that.

You CAN use environment variables as job parameters in DataStage jobs. Beware, however, that some Windows operating systems require you to re-boot after changing/setting an environment variable through the Control Panel. It may be better to create them through the DataStage Administrator client: select your project, go to the Properties window and click the Environment button.

Posted: Wed Mar 15, 2006 6:55 am
by ArndW
Jags,

that is not what I said, in fact I said
You can create and access your own environment variables
. As Ray has shown, you can use the DataStage environment variables. Another option is to write a small routine which SHells out to the operating system and gets the value of a runtime environment variable and then returns that to the caller.