Datastage userid as parameter

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
vivekreddy
Participant
Posts: 43
Joined: Mon Jan 15, 2007 10:53 pm

Datastage userid as parameter

Post 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?
Regards,
Vivek D. Reddy

__________________________________________
If knowledge can create problems, it is not through ignorance that we can solve them. - Isaac Asimov
jhmckeever
Premium Member
Premium Member
Posts: 301
Joined: Thu Jul 14, 2005 10:27 am
Location: Melbourne, Australia
Contact:

Post 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.
<b>John McKeever</b>
Data Migrators
<b><a href="https://www.mettleci.com">MettleCI</a> - DevOps for DataStage</b>
<a href="http://www.datamigrators.com/"><img src="https://www.datamigrators.com/assets/im ... l.png"></a>
vivekreddy
Participant
Posts: 43
Joined: Mon Jan 15, 2007 10:53 pm

Post by vivekreddy »

Hi.

I was unable to find any environmental variables named like what you had mentioned. Any other suggestions?
Regards,
Vivek D. Reddy

__________________________________________
If knowledge can create problems, it is not through ignorance that we can solve them. - Isaac Asimov
Sreedhar
Participant
Posts: 187
Joined: Mon Oct 30, 2006 12:16 am

Post 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.
Regards,
Shree
785-816-0728
vivekreddy
Participant
Posts: 43
Joined: Mon Jan 15, 2007 10:53 pm

Post by vivekreddy »

Hi.

Am scheduling through Datastage. How do I achieve this in this case?
Regards,
Vivek D. Reddy

__________________________________________
If knowledge can create problems, it is not through ignorance that we can solve them. - Isaac Asimov
jhmckeever
Premium Member
Premium Member
Posts: 301
Joined: Thu Jul 14, 2005 10:27 am
Location: Melbourne, Australia
Contact:

Post 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.
<b>John McKeever</b>
Data Migrators
<b><a href="https://www.mettleci.com">MettleCI</a> - DevOps for DataStage</b>
<a href="http://www.datamigrators.com/"><img src="https://www.datamigrators.com/assets/im ... l.png"></a>
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
vivekreddy
Participant
Posts: 43
Joined: Mon Jan 15, 2007 10:53 pm

Post 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?
Regards,
Vivek D. Reddy

__________________________________________
If knowledge can create problems, it is not through ignorance that we can solve them. - Isaac Asimov
jhmckeever
Premium Member
Premium Member
Posts: 301
Joined: Thu Jul 14, 2005 10:27 am
Location: Melbourne, Australia
Contact:

Post by jhmckeever »

You might also want to take a look at the FAQ here:
viewtopic.php?t=92038

J.
<b>John McKeever</b>
Data Migrators
<b><a href="https://www.mettleci.com">MettleCI</a> - DevOps for DataStage</b>
<a href="http://www.datamigrators.com/"><img src="https://www.datamigrators.com/assets/im ... l.png"></a>
vivekreddy
Participant
Posts: 43
Joined: Mon Jan 15, 2007 10:53 pm

Post 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?
Regards,
Vivek D. Reddy

__________________________________________
If knowledge can create problems, it is not through ignorance that we can solve them. - Isaac Asimov
rameshrr3
Premium Member
Premium Member
Posts: 609
Joined: Mon May 10, 2004 3:32 am
Location: BRENTWOOD, TN

Post 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.
vivekreddy
Participant
Posts: 43
Joined: Mon Jan 15, 2007 10:53 pm

Post 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?
Regards,
Vivek D. Reddy

__________________________________________
If knowledge can create problems, it is not through ignorance that we can solve them. - Isaac Asimov
Post Reply