Page 1 of 1

Routine Testing in Manager

Posted: Sat Jun 20, 2009 3:47 am
by DS_SUPPORT
I am using this routine provided by Ray

Code: Select all

FUNCTION GetEnvironmentVariable(EnvVarName) 
      If UnAssigned(EnvVarName) Or IsNull(EnvVarName) 
      Then 
         Ans = @NULL 
      End 
      Else 
         Call DSExecute("UV", "ENV", Output, ExitStatus) 
         FindStr EnvVarName In Output Setting FMC,VMC,SMC 
         Then 
            Ans = Field(Output<FMC,VMC,SMC>, "=", 2, 99) 
         End 
         Else 
            Ans = "" 
         End 
      End 
RETURN(Ans)
I have used this code and created a routine, when i call that routine from a server job , i am getting the correct Value, and if the same routine is tested using Datastage Manger's "Test.." Button, I am not getting the desired output.

Why is it so? Is it because the datastage environment variables will be loaded into memory, only when it is called from a job?

Posted: Sat Jun 20, 2009 7:07 am
by chulett
Probably, but you've have to give us a clue what 'environment variable' you are testing for first.

Posted: Sat Jun 20, 2009 9:46 pm
by DS_SUPPORT
We have a Project Level ENvironment Variable, $TGT_DB_CONNECTION, and i was trying to fetch that value from DS Manager.

Posted: Sun Jun 21, 2009 7:48 am
by chulett
Right, any defined there are only instantiated when a job runs. Log into your server and issue the SET command to get a list of all of the variables you can 'Test' for.