@FM clarification
Moderators: chulett, rschirm, roy
@FM clarification
In the execute command activity I have seen following trigger condition.
Ereplace(Cmd_CheckRejectSize.$CommandOutput,@FM,'')>0
I want to see the @FM characters using Unix or Note pad++ or any method.Please let me know how to see those characters.I have idea about @FM characters but not sure how to see those characters.Because in many places we are using Ereplace to repalce @FM with '' in my project.I have confusion where to use this Ereplace command to repalce @FM with ''
Ereplace(Cmd_CheckRejectSize.$CommandOutput,@FM,'')>0
I want to see the @FM characters using Unix or Note pad++ or any method.Please let me know how to see those characters.I have idea about @FM characters but not sure how to see those characters.Because in many places we are using Ereplace to repalce @FM with '' in my project.I have confusion where to use this Ereplace command to repalce @FM with ''
1)I have read the link mentioned in above post but nowhere it is mentioned how to see those characters because in my project they are using Ereplace function to replace @FM with '' in some places not in all places.Without seeing those characters It is difficult to guess when to use Ereplace function?
-
- Premium Member
- Posts: 1735
- Joined: Thu Mar 01, 2007 5:44 am
- Location: Troy, MI
The result of the execute command activity is returned as one string. The <CR><LF> represented new lines in the screen output are replaced with the special @FM character in this string. The EREPLACE() function as called will remove all of these characters from the string.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
Think of it as a convenient placeholder and an easy way to perform replacements with a delimeter that wont be confused with any normal characters..... it's been a long time since I dove into their values specifically, but if memory serves, @FM and its counterparts (such as @VM) are high ascii values with decimal values of at or near 253, 254, and 255......... It is very likely still documented somewhere, and I am sure Ray and others can confirm, and you should be able to yourself, using things like iconv to see hex values.....
Either way, it shoukdnt be something to worry about. Just use it consistently......typically with ereplace one of these field marks is used so that later on, or nested, you can use another UV/Basic command that nicely takes advantage of the field mark. UV/Basic is a super powerful language for text string manipulation, and these marks help with that, allowing you to compose (or twist and turn and transform) some pretty sophisticsted structures. You wont often need those levels of sophistication in your normal ds efforts, but when you do.........
Ernie
Either way, it shoukdnt be something to worry about. Just use it consistently......typically with ereplace one of these field marks is used so that later on, or nested, you can use another UV/Basic command that nicely takes advantage of the field mark. UV/Basic is a super powerful language for text string manipulation, and these marks help with that, allowing you to compose (or twist and turn and transform) some pretty sophisticsted structures. You wont often need those levels of sophistication in your normal ds efforts, but when you do.........
Ernie
Ernie Ostic
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
Thanks Craig. I'm on my phone today and the browser is lame, so I am not able to easily go there, let alone do dsxchange..... : ) Was I close?
Ernie
Ernie
Ernie Ostic
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
Yup! :D
(just don't ask me what exactly each of them are)
@TM A text mark, Char(251)
@SM A subvalue mark, Char(252)
@VM A value mark, Char(253)
@FM A field mark, Char(254)
@IM An item mark, Char(255)
Thought it was kind of obvious that high order values like that weren't really 'displayable' but you could dump the intact values to a file and then use a hex editor or a utility like 'od' to see them, that or go the other direction with the EReplace - for example, change an @FM to the string "@FM" just for educational purposes.
(just don't ask me what exactly each of them are)
@TM A text mark, Char(251)
@SM A subvalue mark, Char(252)
@VM A value mark, Char(253)
@FM A field mark, Char(254)
@IM An item mark, Char(255)
Thought it was kind of obvious that high order values like that weren't really 'displayable' but you could dump the intact values to a file and then use a hex editor or a utility like 'od' to see them, that or go the other direction with the EReplace - for example, change an @FM to the string "@FM" just for educational purposes.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Thanks Craig. Happy New Year everyone!
Ernie Ostic
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
Thanks all for input and just want to know my understanding correct or not.
1)cat temp.txt
1,2
3,4
In notepad++ i can see above file as
1,2CRLF
3,4CRLF
As per ArndW,datastage will replace @FM[CRLF] with ''
when i use Ereplace(Cmd_CheckRejectSize.$CommandOutput,@FM,'').Is my understanding is correct?
Clarifications:
@chulett
1)Why u told me to change an @FM to the string "@FM" just for educational purposes?
As of now i have readonly access to datastage and i can not check this
scenario
2)Let us assume the following below content in notepad++
1,2LF
3,4LF
In the above case will the Ereplace(Cmd_CheckRejectSize.$CommandOutput,@FM,'') function will work?
1)cat temp.txt
1,2
3,4
In notepad++ i can see above file as
1,2CRLF
3,4CRLF
As per ArndW,datastage will replace @FM[CRLF] with ''
when i use Ereplace(Cmd_CheckRejectSize.$CommandOutput,@FM,'').Is my understanding is correct?
Clarifications:
@chulett
1)Why u told me to change an @FM to the string "@FM" just for educational purposes?
As of now i have readonly access to datastage and i can not check this
scenario
2)Let us assume the following below content in notepad++
1,2LF
3,4LF
In the above case will the Ereplace(Cmd_CheckRejectSize.$CommandOutput,@FM,'') function will work?
1) As noted, to educate yourself. To make them 'visible'.
As to your other questions, understand that DataStage returns Command Output in a dynamic array with each line sent as output to the screen as an element in that array. The newlines in the output are automatically converted to Field Marks by DataStage. If you are returning a single line of output, you could use that EReplace function to remove the @FM from the end of it. Or sometimes people substring it off. Or you could use array notation so it's not an issue:
Cmd_CheckRejectSize.$CommandOutput<1>
To get only the first array element of the returned output. Also note that this means for multiple line results you could use that notation to iterate through the returned array.
As to your other questions, understand that DataStage returns Command Output in a dynamic array with each line sent as output to the screen as an element in that array. The newlines in the output are automatically converted to Field Marks by DataStage. If you are returning a single line of output, you could use that EReplace function to remove the @FM from the end of it. Or sometimes people substring it off. Or you could use array notation so it's not an issue:
Cmd_CheckRejectSize.$CommandOutput<1>
To get only the first array element of the returned output. Also note that this means for multiple line results you could use that notation to iterate through the returned array.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Sorry, just wanted to add that I had hoped you would take the information provided here by folks and apply it to your questions, work things out. This rather than wanting to be spoon fed.
Anywho, see what other questions come to mind now and let us know if you still need help with this.
Anywho, see what other questions come to mind now and let us know if you still need help with this.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers