Page 1 of 1

Using $PROJDEF in basic

Posted: Mon Apr 08, 2013 4:04 am
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.

Posted: Mon Apr 08, 2013 7:16 am
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?

Posted: Mon Apr 08, 2013 8:17 am
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

Posted: Mon Apr 08, 2013 8:26 am
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.

Posted: Mon Apr 08, 2013 2:19 pm
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.

Posted: Mon Apr 08, 2013 2:23 pm
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.

Posted: Mon Apr 08, 2013 7:01 pm
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.

Posted: Thu Apr 11, 2013 9:44 am
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

Posted: Thu Apr 11, 2013 2:37 pm
by ray.wurlod
You can find a decryption algorithm by searching DSXchange, but I didn't tell you that it's there. :wink:

Posted: Tue Jan 07, 2014 4:49 am
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