Hi All,
We are reading environmental parameters from DSRoutine. (Using unix cmd 'echo $ROOT_DIR') The value returned contains a new line character
I have tried using trim functions
as below
var1 = Trim(UnixOutput,'')
var1 = Trim(UnixOutput,'@FM','')
var1 = Trim(UnixOutput,' ','')
can anybody tell me what is @FM
But still I get the same error and the value appended with some spacesand the control goes to the next line
please suggest on this?
Reding Unix Output inDS routine
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 1
- Joined: Tue Feb 13, 2007 8:37 am
@FM is char(254) and is used by DataStage as a separator on many occasions. I think its the separator for arrays, for example.
I would try using the ereplace function:
ereplace(SourceString, SubString2replace, ReplacementSubString)
Its fairly easy to use and the ReplacementSubString in this case is blank.
I would try using the ereplace function:
ereplace(SourceString, SubString2replace, ReplacementSubString)
Its fairly easy to use and the ReplacementSubString in this case is blank.
Bob Oxtoby
UnixOutput, is this the Output from DSExecute() ?
If yes then it is a dynamic array where every element is seperated by @FM which in reality are the line feeds. If you just want the first element you can just request for the same by using
If yes then it is a dynamic array where every element is seperated by @FM which in reality are the line feeds. If you just want the first element you can just request for the same by using
Code: Select all
var1 = UnixOutput<1>
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Re: Reding Unix Output inDS routine
The quotes are your problem, they turn the Field Mark system variable into just another string.Balakrishnan wrote:var1 = Trim(UnixOutput,'@FM','')
Code: Select all
var1 = Trim(UnixOutput,@FM,'')
![Wink :wink:](./images/smilies/icon_wink.gif)
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers