Routine Testing in Manager

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
DS_SUPPORT
Premium Member
Premium Member
Posts: 232
Joined: Fri Aug 04, 2006 1:20 am
Location: Bangalore

Routine Testing in Manager

Post 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?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Probably, but you've have to give us a clue what 'environment variable' you are testing for first.
-craig

"You can never have too many knives" -- Logan Nine Fingers
DS_SUPPORT
Premium Member
Premium Member
Posts: 232
Joined: Fri Aug 04, 2006 1:20 am
Location: Bangalore

Post by DS_SUPPORT »

We have a Project Level ENvironment Variable, $TGT_DB_CONNECTION, and i was trying to fetch that value from DS Manager.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply