Calling Environment Variables in Basic Transformer

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
gsym
Charter Member
Charter Member
Posts: 118
Joined: Thu Feb 02, 2006 3:05 pm

Calling Environment Variables in Basic Transformer

Post by gsym »

I am using a BASIC Transformer in a Parallel job to generate a calendar table. The values for the start and end dates for the calendar must be obtained from a couple of environment variables.

How do I go about doing this in the BASIC Transformer. Now if it was just a Transformer stage I would create two stage variables and set their initial values as GetEnvironment("Environmentvariablename") but this does not seem to work in BASIC Transformer.

Please help !
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

So... does this need to be a Parallel job?
-craig

"You can never have too many knives" -- Logan Nine Fingers
gsym
Charter Member
Charter Member
Posts: 118
Joined: Thu Feb 02, 2006 3:05 pm

Post by gsym »

chulett wrote:So... does this need to be a Parallel job?

I am using the BASIC Transformer here because of the ease of using Iconv/Oconv functions. But I must use it in a parallel job.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

You pass the environment variable as a job parameter.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
gsym
Charter Member
Charter Member
Posts: 118
Joined: Thu Feb 02, 2006 3:05 pm

Post by gsym »

DSguru2B wrote:You pass the environment variable as a job parameter.

The problem is that I have been asked to only use specific environment variables in the jobs. No job parameters. I am doing it this way because the job is going to be executed using a control file and the values for all the environment variables used in the job is specified in the control file.

So I declare all the environment variables in the job properties>job parameters and both my start dates and end dates are specified there as environment variables.

edited to remove utter stupidity !! :oops: :oops:
Last edited by gsym on Fri Feb 09, 2007 2:25 pm, edited 2 times in total.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

gsym wrote: So I declare all the environment variables in the job properties>job parameters and both my start dates and end dates are specified there as environment variables.
Well if you already have them setup in the job parameters then why not read them inside the transformer.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
gsym
Charter Member
Charter Member
Posts: 118
Joined: Thu Feb 02, 2006 3:05 pm

Post by gsym »

Crap !!

I feel like a complete idiot !!

Ur right, I have already found the solution.

What was I thinking.....

Why don't I just delete this post :oops: :oops: :oops:
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Thats ok buddy. Glad you got it resolved. Just mark it as resolved and have a cup of tea, or coffee :wink:
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
gsym
Charter Member
Charter Member
Posts: 118
Joined: Thu Feb 02, 2006 3:05 pm

Post by gsym »

DSguru2B wrote:Thats ok buddy. Glad you got it resolved. Just mark it as resolved and have a cup of tea, or coffee :wink:
Thanks DSguru ...... I guess sometimes one has to put his problems in writing to realize he's already got the solution or that there was no problem at all in the first place !! :o

Guess I had somehow made the assumption that the environment variable has to be directly called in the BASIC Transformer stage and no job parameters should be used.....
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

That's cool, because my advice was going to be to push back on the daft requirement!
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply