Page 1 of 1
DS Function to retrieve Project Level Environment Variable?
Posted: Thu Mar 15, 2007 1:12 pm
by reddyla
Hi, I'm trying to retrieve a project environment variable from within a routine. I would like to avoid passing the value in as an argument to the routine so was hoping there would be a DS Function I could use. There is a function DSGetParamInfo, but that retrieves job level params, I'd like project level. Thanks!
Posted: Thu Mar 15, 2007 1:21 pm
by DSguru2B
Did you try searching?
Posted: Thu Mar 15, 2007 1:51 pm
by reddyla
DSguru2B wrote:Did you try searching?
I did. I could only find what sounded like a workaround - a Call DSExecute to do an echo in unix. It never mentions whether there is or isn't a function for project info. I thought there would be, but if not, that's fine, will get the info I need from the unix env.
Posted: Thu Mar 15, 2007 2:05 pm
by Sreedhar
HI
Yes we can get the job level parameter information from the unix environtment. The command to be used is
dsjob -lparam <project name > <job name>
for further help do go though the server.pdf document under the heading
Command Line Interface near about 700 page....
Posted: Thu Mar 15, 2007 2:11 pm
by reddyla
Sreedhar wrote:HI
Yes we can get the job level parameter information from the unix environtment. The command to be used is
dsjob -lparam <project name > <job name>
for further help do go though the server.pdf document under the heading
Command Line Interface near about 700 page....
Hi Sreedhar,
Thanks, that is good to know.
But what I was trying to do was get a project environment variable from within a routine. I was hoping a function existed.
If it does not, I will use Call DSExecute("UNIX", "echo $SrcFileDir",ReturnVal,ReturnCd)
I learned from the other post I found that project env variables become unix env variables at runtime. But, one last time, I was just wondering if there was a DS function that you pass an project env var name to, and it returns the value.
If not, that's fine, I'll close this. Thanks
Posted: Thu Mar 15, 2007 2:20 pm
by chulett
You want to 'get' as in
use the variable in your routine? What happens when you just reference it? Pretty sure the reference would need hash / pounds signs around it, so:
For example. Or did you try that and it didn't work for you?
Posted: Thu Mar 15, 2007 2:46 pm
by DSguru2B
There is a function present in px jobs, not in ds jobs. The work around is to get it from the unix level by echoing it.
Posted: Thu Mar 15, 2007 3:32 pm
by reddyla
chulett wrote:You want to 'get' as in
use the variable in your routine? What happens when you just reference it? Pretty sure the reference would need hash / pounds signs around it, so:
For example. Or did you try that and it didn't work for you?
Hi Craig, yes I tried that, it didn't work. It produces an error when I try to compile the routine.
Not Brian, that's what I was wondering. Thanks very much everyone.
Posted: Thu Mar 15, 2007 3:38 pm
by chulett
Yah, sorry - Parameters of that nature are not visible to routines. However, I would think you should be able to pass it in as an argument to your routine and then reference it as I suggested in the call itself. Worth a shot.
Can you tell I've never had much need for environment variables?
![Wink :wink:](./images/smilies/icon_wink.gif)
Posted: Thu Mar 15, 2007 5:14 pm
by DSguru2B
Neither do I, dsxchange sort of makes you an expert in all fields, does'nt it
![Wink :wink:](./images/smilies/icon_wink.gif)
Posted: Thu Mar 15, 2007 5:31 pm
by chulett
Hey - what happened? Suddenly we're
Resolved - can you please share with us the resolution?
![Wink :wink:](./images/smilies/icon_wink.gif)
Posted: Thu Mar 15, 2007 5:32 pm
by chulett
reddyla wrote:Not Brian, that's what I was wondering.
Excellent! I think I'll start calling him "Not Brian" too.
![Laughing :lol:](./images/smilies/icon_lol.gif)
Posted: Thu Mar 15, 2007 5:56 pm
by DSguru2B
Yea, funny guys, ha ha ha.
Posted: Thu Mar 15, 2007 8:33 pm
by ray.wurlod
There is a "UniVerse" command called ENVIRONMENT (or just ENV) which returns a list of all current (set) environment variables. You could invoke this through DSExecute.