Reading Envrironment Variable in Local Variable

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
neeraj
Participant
Posts: 107
Joined: Tue May 24, 2005 4:09 am

Reading Envrironment Variable in Local Variable

Post by neeraj »

Hello,

I have a required where I need to assign the environment variable into local variable..

For e.g.
Environment Variable
$NM_USER=U1
$NM_USER1=U2

In Master Sequncer I have one variable USER. Based on the condition I want to read the value as
USER=$NM_USER or USER=$NM_USER. The output should be Either U1 or U4, Please advise how can I get it done.

I tried the above mentioned point and the output I am getting is $NM_USER not U1.

Regards
Neeraj
ShaneMuir
Premium Member
Premium Member
Posts: 508
Joined: Tue Jun 15, 2004 5:00 am
Location: London

Post by ShaneMuir »

You could just add them to the parameter list and pass them as a parameter?

Or you could try GetEnvironment("NM_USER") - but not sure if that works in a sequence.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Use an Execute Command activity to echo $NM_USER
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
FranklinE
Premium Member
Premium Member
Posts: 739
Joined: Tue Nov 25, 2008 2:19 pm
Location: Malvern, PA

Post by FranklinE »

This may not help you, but Job Activity stage on the job sequence pallate gives you the same derivation functions found in the Transformer stage. You can assign to a local variable any value you want, including environment variables listed in the job sequence properties parameters.
Franklin Evans
"Shared pain is lessened, shared joy increased. Thus do we refute entropy." -- Spider Robinson

Using mainframe data FAQ: viewtopic.php?t=143596 Using CFF FAQ: viewtopic.php?t=157872
neeraj
Participant
Posts: 107
Joined: Tue May 24, 2005 4:09 am

Post by neeraj »

Thanks for the reply. We have used the user variable activity stage and able to read the env variables.
Post Reply