How to use an Environment Variable into Userdefine routine

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
ArijitS
Participant
Posts: 24
Joined: Sat Jun 02, 2007 8:58 am
Location: Kolkata

How to use an Environment Variable into Userdefine routine

Post by ArijitS »

Is it possible to use an Environment Variable into any User Define Datastage routine.If so then please help me by a piece of code as an example.
JoshGeorge
Participant
Posts: 612
Joined: Thu May 03, 2007 4:59 am
Location: Melbourne

Post by JoshGeorge »

If you have a job attached inside the routine:

Code: Select all

DSGetParamInfo(hJob1, "$VarName", DSJ.PARAMDEFAULT) 
where hJobName is the job attached using DSAttachJob 
Joshy George
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Or, if not, a simple call to your O/S to 'echo' it and capture the results can be used.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

There is also the "UniVerse" command ENV (that you might execute using DSExecute subroutine), which will return all environment variables, and you could process that string with FINDSTR to locate the one(s) in which you're interested.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post by roy »

How about running the job and assigning that environment variable as a parameter to it?
Roy R.
Time is money but when you don't have money time is all you can afford.

Search before posting:)

Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Image
Post Reply