Using $PROJDEF in basic

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
thurmy34
Premium Member
Premium Member
Posts: 198
Joined: Fri Mar 31, 2006 8:27 am
Location: Paris

Using $PROJDEF in basic

Post by thurmy34 »

Hi all
I would like to pass the $PROJDEF keyword between a job control (in basic) and ordinary jobs.
None of them have environnement variable and the result is that the $PROJDEF is never changed to "real" value.
Do you know a way to force the evaluation of $PROJDEF ?

Thanks fof helping.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

So, actually a job parameter who's defined value is $PROJDEF in the job? Just want to confirm first as it doesn't stand on it's own and I get the impression you are trying to use it that way. :?

Can you be more specific as to how you are passing this around?
-craig

"You can never have too many knives" -- Logan Nine Fingers
thurmy34
Premium Member
Premium Member
Posts: 198
Joined: Fri Mar 31, 2006 8:27 am
Location: Paris

Post by thurmy34 »

Chulett
unfortunately i can't read the premuim content.
Here is what i do :
After reading an ini file who contain :
$My_DB=$PROJDEF
I got exactly the same thing in my job control.
When i use dssetparam(jh1,My_local_DB,$PROJDEF) then $PROJDEF is not set to environnment value but stay '$PROJDEF'.
The job jh1 doesn't have the $My_DB variable in his parameters.

Am i clearer ?

Thank you
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You can't use it in an "ini" file like that, it's just text there nor can you use it as you've shown. If you want the "project default" value just read it from the environment: GetEnvironment(My_DB) is one way.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

$PROJDEF is only used as the default value of a job parameter.

To have it evaluate, simply don't provide any non-default value for that parameter when requesting a job run.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

The value being discussed is not declared as a job parameter, they just want to bring it in from the environment - hence my advice.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Well that's not horribly difficult, but you can't use $PROJDEF.

Getting the value from the environment can be done via the env command (perhaps called through DSExecute), then that value can be used as required.

If the value is not available in the shell environment, then it could be read directly from the DSParams file for the project.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
thurmy34
Premium Member
Premium Member
Posts: 198
Joined: Fri Mar 31, 2006 8:27 am
Location: Paris

Post by thurmy34 »

Ray I found the GetEnvironmentVariable routine that you wrote.
It works fine except for the variable with the encrypted type.
The routine give me the encrypted value which i can't use to connect to my database.
Is there a way to decrypt it ?

Thank you
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You can find a decryption algorithm by searching DSXchange, but I didn't tell you that it's there. :wink:
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
thurmy34
Premium Member
Premium Member
Posts: 198
Joined: Fri Mar 31, 2006 8:27 am
Location: Paris

Post by thurmy34 »

Hi gurus
One of my teammate report me a "bug" in the GetEnvironnementVariable routine.
The commande Call DSExecute("UV", "ENV", Output, ExitStatus) does not retrieve all the Environnement Variable (ex APT_CONFIG_FILE).
My verification does not work for parallel job.

Thank you
Hope This Helps
Regards
Post Reply