System variables

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
jagadhish
Participant
Posts: 14
Joined: Thu Jan 19, 2006 6:05 am

System variables

Post 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?
REGARDS,
JAGS
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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.
jagadhish
Participant
Posts: 14
Joined: Thu Jan 19, 2006 6:05 am

System environment variables

Post 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.
REGARDS,
JAGS
jagadhish
Participant
Posts: 14
Joined: Thu Jan 19, 2006 6:05 am

System environment variables

Post 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.
REGARDS,
JAGS
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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.
Post Reply