@FM clarification

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
vamsi.4a6
Participant
Posts: 334
Joined: Sun Jan 22, 2012 7:06 am
Contact:

@FM clarification

Post by vamsi.4a6 »

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 ''
Thanks and Regards
Vamsi krishna.v
http://datastage-vamsi.blogspot.in/
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You might want to start here.
-craig

"You can never have too many knives" -- Logan Nine Fingers
vamsi.4a6
Participant
Posts: 334
Joined: Sun Jan 22, 2012 7:06 am
Contact:

Post by vamsi.4a6 »

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?
Thanks and Regards
Vamsi krishna.v
http://datastage-vamsi.blogspot.in/
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

@FM is field mark and is not printable, In execute command activity @FM is generally removed from the output.

for this one consider it as a new line removal.
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

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.
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

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
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Ernie, the values are documented in the link I posted. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

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 Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

Thanks Craig. Happy New Year everyone!
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
vamsi.4a6
Participant
Posts: 334
Joined: Sun Jan 22, 2012 7:06 am
Contact:

Post by vamsi.4a6 »

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?
Thanks and Regards
Vamsi krishna.v
http://datastage-vamsi.blogspot.in/
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
vamsi.4a6
Participant
Posts: 334
Joined: Sun Jan 22, 2012 7:06 am
Contact:

Post by vamsi.4a6 »

anybody help on my clarifications?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Did. :?

But just to beat this pony, when you use EReplace() to replace anything with '' (an empty string) you are removing it from the string in question. And yes that includes Field Marks.
-craig

"You can never have too many knives" -- Logan Nine Fingers
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply