Page 1 of 1

Datastage userid as parameter

Posted: Wed Mar 21, 2007 12:43 am
by vivekreddy
Hi.

Could anyone of you tell me how I can get the value of the userid that I use to log into Datastage Designer as a parameter to be used in processing?

Posted: Wed Mar 21, 2007 5:14 am
by jhmckeever
Hi vivekreddy ,

I'm on Unix so can't check this for you at the moment but I believe under Windows you should be able to use the environment variables NAME, USER, or USERNAME.

(For the record it's 'LOGNAME' under Unix)

HTH,
John.

Posted: Wed Mar 21, 2007 5:27 am
by vivekreddy
Hi.

I was unable to find any environmental variables named like what you had mentioned. Any other suggestions?

Posted: Wed Mar 21, 2007 5:48 am
by Sreedhar
Let us know how you are scheduling you jobs.


If you are running the job using the control M script then use a param file and pass the user name as a parameter with in file and use the same in your processing.

Posted: Wed Mar 21, 2007 6:11 am
by vivekreddy
Hi.

Am scheduling through Datastage. How do I achieve this in this case?

Posted: Wed Mar 21, 2007 6:12 am
by jhmckeever
vivekreddy,

Where are you looking for the environment variables? Try this:

- In Job Properties Parameters tab click "Add Environment Variable"

- Click 'New' (at the top) and create the variable USER, then select it from the list to add it to your job

- In your job give the USER parameter the default value $ENV

Let us know how this goes.

HTH,
John.

Posted: Wed Mar 21, 2007 6:13 am
by ray.wurlod
If it's in a job sequence you can use the system variable @LOGNAME in an expression, or use an Execute Command activity to retrieve the value of the environment variable that contains your user ID. Since you're in the parallel forum, I'm guessing you are on 7.5x2, and can therefore retrieve it from the MKS Toolkit shell with echo $USERNAME

Posted: Wed Mar 21, 2007 6:19 am
by vivekreddy
Hi.

Sorry, but I can't read the premium content part. :oops:

Is there some way you could explain it to me without that part disappearing behind the premium content curtain?

Posted: Wed Mar 21, 2007 6:20 am
by jhmckeever
You might also want to take a look at the FAQ here:
viewtopic.php?t=92038

J.

Posted: Wed Mar 21, 2007 6:27 am
by vivekreddy
Hi.

I am not looking at Environment Variables per se, as they would require some sort of default value et al either at the Job level or the project level.

Is there some way of either creating a DSMacro or a DSRoutine to achieve the same, and to retrieve the value at runtime?

Posted: Wed Mar 21, 2007 7:37 am
by rameshrr3
Hi.

Sorry, but I can't read the premium content part.

Is there some way you could explain it to me without that part disappearing behind the premium content curtain?

_________________
Regards,
Vivek D. Reddy
Why dont you ask your organization to go in for Corporate membership? That way they can help themselves. And you can see the premium content too.

Posted: Wed Mar 21, 2007 7:45 am
by vivekreddy
I will try to get that done, but till such time, any suggestions on how I can achieve what I need to do?