Calling Custom routine using environment variables

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
Alink
Participant
Posts: 5
Joined: Sun Aug 28, 2005 12:43 am

Calling Custom routine using environment variables

Post by Alink »

If GetFileSize(#$JBrecievepath# , "\PREPAID_BAL_TRACKING.dat") = 1 Then $Oradate[10] Else $Oradate[1,10]


I am trying to call a routine through the transformer. The above statement
this turns red and if i put all expressions between " " the variable is not resolved to its value.

Hence in short the question is how to pass environment variables into a custom routine.
Thanks and Regards

Ali Nazir
PS Consultant
Teradata - A division on NCR
bchau
Charter Member
Charter Member
Posts: 46
Joined: Tue Jan 18, 2005 7:39 am
Location: Japan
Contact:

Post by bchau »

Then environment variable needs to be passed down as a parameter of the job. So you have to have the enviroment variabled defined in job parameter definitions.

if you take out '#', you should be fine.
Alink
Participant
Posts: 5
Joined: Sun Aug 28, 2005 12:43 am

Post by Alink »

Thanks This works fine now :)

If (GetFileSize($JBrcvdpath:"\PREPAID_BAL_TRACKING.dat")) = 1 Then $Oradate[10] Else $Oradate[1,10]
Thanks and Regards

Ali Nazir
PS Consultant
Teradata - A division on NCR
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

This is going to be executed for every single row going thru the Transformer. It would be better to use it in the initialize step of a stage variable so it's done only once. For the derivation of the stage variable, just use the stage variable.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Post Reply