DS Function to retrieve Project Level Environment Variable?
Moderators: chulett, rschirm, roy
DS Function to retrieve Project Level Environment Variable?
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!
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.DSguru2B wrote:Did you try searching?
Hi Sreedhar,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....
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
Last edited by reddyla on Thu Mar 15, 2007 3:33 pm, edited 1 time in total.
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?
Code: Select all
#$SrcDir#
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Hi Craig, yes I tried that, it didn't work. It produces an error when I try to compile the routine.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?Code: Select all
#$SrcDir#
Not Brian, that's what I was wondering. Thanks very much everyone.
Last edited by reddyla on Thu Mar 15, 2007 3:41 pm, edited 1 time in total.
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?
Can you tell I've never had much need for environment variables?
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.