Problem in getting environment variable in routines...
Moderators: chulett, rschirm, roy
Problem in getting environment variable in routines...
Hi
I am trying to use environment variables in Routine(Transform Function).
I got some idea from this forum as to use echo statements to get the env values and I use modified UtilityHashLookup Routine to read. It works fine If I hard code the path of hash file like following
HashTable=/dir/dir/dir/Translation_hsf
but it gives me "Table Not Found" error If I do the follwoing...
HashTable = HashFilePath:"/Translation_hsf"
where HashFilePath has the actual path derived from the echo command which works fine.
Does anyone know the reason ?
Thanks
I am trying to use environment variables in Routine(Transform Function).
I got some idea from this forum as to use echo statements to get the env values and I use modified UtilityHashLookup Routine to read. It works fine If I hard code the path of hash file like following
HashTable=/dir/dir/dir/Translation_hsf
but it gives me "Table Not Found" error If I do the follwoing...
HashTable = HashFilePath:"/Translation_hsf"
where HashFilePath has the actual path derived from the echo command which works fine.
Does anyone know the reason ?
Thanks
You sure your not sending in any spaces. Try
Code: Select all
HashTable = TRIM(HashFilePath):'/Translation_hsf'
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Ahh....The field markers. Then how about the OP tries this
Code: Select all
HashTable = Field(HashFilePath1,@FM,1):'/Translation_hsf'
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
-
- Premium Member
- Posts: 1255
- Joined: Wed Feb 02, 2005 11:54 am
- Location: United States of America
Why is the same thing being posted twice under different member_id's?kaps wrote:Thanks for the response.
Arnd - This is the code I am using to get the env variables...
Call DSExecute("UNIX","echo $prm_project_path$prm_path_common",UnixOutput,SystemReturnCode)
HashFilePath = Trim(UnixOutput)
DSGuru - I am getting the same error when I tried your second mathod.\
Thanks
Anything that won't sell, I don't want to invent. Its sale is proof of utility, and utility is success.
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
Ok. Try one of these. They should work
OR
Code: Select all
Call DSExecute("UNIX","echo $prm_project_path$prm_path_common",UnixOutput,SystemReturnCode)
HashFilePath = Field(UnixOutput, @FM,1)
Code: Select all
Call DSExecute("UNIX","echo $prm_project_path$prm_path_common",UnixOutput,SystemReturnCode)
HashFilePath = UnixOutput<1>
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
I don't know what's going on...The code which worked few hours before is not working now...
Even this small piece of code is not working now...I just have the following code in a test routine...which does not give me the output...
Call DSExecute("UNIX","echo $prm_project_path",UnixOutput,SystemReturnCode)
Ans = Trim(UnixOutput)
Thanks
Even this small piece of code is not working now...I just have the following code in a test routine...which does not give me the output...
Call DSExecute("UNIX","echo $prm_project_path",UnixOutput,SystemReturnCode)
Ans = Trim(UnixOutput)
Thanks
NO. It wont. Thats what i wanted to find out. If it does'nt work from command line, it wont work from DSExecute() either.
Go to your unix prompt, type env. What ever variables you see there, only they can be called.
I wonder how it was working before.
Go to your unix prompt, type env. What ever variables you see there, only they can be called.
I wonder how it was working before.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.