Page 1 of 1

What is @FM

Posted: Wed Jan 11, 2012 12:08 am
by atulgoel
Hi All,

I came across below function in my existing code. I want to analyze what exactly this does and what @FM refers to? Any idea?

Ereplace(Trim(Convert(@FM ,"", cmd_List_Files.$CommandOutput)), p_HrSrcFileDir , "")

Regards,
Atul

Re: What is @FM

Posted: Wed Jan 11, 2012 12:22 am
by kmsekhar
@FM --> Field mark: CHAR(254). Same as @AM.

Posted: Wed Jan 11, 2012 12:23 am
by ray.wurlod
@FM is not a function - it is a system variable, and is preloaded with the ASCII code 254. Historically, in the UniVerse database, this character is the principal delimiter in a special kind of delimited string called a "dynamic array". Since DataStage was originally built on UniVerse, @FM is still seen in many places.

When DataStage reads a multi-line file in a single operation, the line terminators are converted automatically (by DataStage) into field marks. That way it doesn't matter whether you've read a UNIX file or a DOS file - the resulting string is exactly the same. Your Convert() function is removing any field marks (replacing them with "").