Page 1 of 1

How to use an Environment Variable into Userdefine routine

Posted: Mon Nov 05, 2007 3:53 am
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.

Posted: Mon Nov 05, 2007 6:58 am
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 

Posted: Mon Nov 05, 2007 7:16 am
by chulett
Or, if not, a simple call to your O/S to 'echo' it and capture the results can be used.

Posted: Mon Nov 05, 2007 7:29 am
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.

Posted: Tue Nov 06, 2007 2:29 am
by roy
How about running the job and assigning that environment variable as a parameter to it?