materializing environment variables in a datastage job

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
DSH
Premium Member
Premium Member
Posts: 4
Joined: Tue Jul 29, 2008 6:52 am
Location: Ohio

materializing environment variables in a datastage job

Post by DSH »

Hi, Is there a way to materialize environment variables (those variables defined in administrator for a project ) in a transformation stage? I see the ability to materialize local variables. I'm looking to place the value of these variables as actual data in a sequential file.

I'm not really set on using a transformation stage if there is some other way to do this. Example would be a environment variable with the database name in it.

thanks!
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

I'm not at a workstation where I can test this now, but if you cannot use the user-defined variables directly, then you declare them as part of your job parameters, call them with a value of "$PROJDEF" and use them in the transform stage.
DSH
Premium Member
Premium Member
Posts: 4
Joined: Tue Jul 29, 2008 6:52 am
Location: Ohio

Post by DSH »

Thanks for the response.. Yes, that is what I was trying. Including them as a job parameter, for example Job parameter $env with a default value of $PROJDEF. Then I'm trying to use $env in the transform.. that is where I'm not able to materialize to the actual value. Thanks.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You need to have created them in the project via the Administrator first, did you do so? If you did, you'd need to expand a teeny bit on the problem you are having. Saying "not able to materialize" doesn't really give us much to go on.
-craig

"You can never have too many knives" -- Logan Nine Fingers
pneumalin
Premium Member
Premium Member
Posts: 125
Joined: Sat May 07, 2005 6:32 am

Post by pneumalin »

I believe you are looking for function: GetEnvironment, because you cannot use Environment Variables directly in a transformer like the job parameter. You have to call the function to return the value for you.
DSH
Premium Member
Premium Member
Posts: 4
Joined: Tue Jul 29, 2008 6:52 am
Location: Ohio

Post by DSH »

Thank you.. I will look into that when I get back to the office tomorrow morning!
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You can if they are defined in the project and then passed in as job parameters. You would need to use the function noted for environment variables not defined / passed in.
-craig

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