is $ISUSER available in server routines?

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
mctny
Charter Member
Charter Member
Posts: 166
Joined: Thu Feb 02, 2006 6:55 am

is $ISUSER available in server routines?

Post by mctny »

Hi,

I was wondering if I can use the $ISUSER environment variable ( either directly or via a function) in a server routine to get the user who execute the job? I am calling the routine from a user variables activity stage within a job sequencer.

Thanks,
Chad
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Sure can. But you have to invoke a command, through DSExecute. You may as well use an operating system shell command (echo) in that case.

Code: Select all

Call DSExecute("SH", "echo $ISUSER", Output, ExitStatus)
Ans = Output<1>
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
mctny
Charter Member
Charter Member
Posts: 166
Joined: Thu Feb 02, 2006 6:55 am

Post by mctny »

Thanks a lot Ray. That works.

----------
thank you,
Chad
mctny
Charter Member
Charter Member
Posts: 166
Joined: Thu Feb 02, 2006 6:55 am

Post by mctny »

I am reopening this because I came across a small issue during a special case.

When someone runs the job $ISUSER thing work but if the job is scheduled then $ISUSER is not available.

I actually looked at the second log entries of the same job in director, one is when the job is run by any user and the other one is when I schedule the job through a crontab wrapper script. in the later case there was no $ISUSER entry.

any ideas as what to do to get the username when the job is scheduled?
Post Reply