Folder Stage, Ereplace and Field Marks (@FM)
Posted: Thu Sep 14, 2006 8:34 pm
Hi All
Back again and totally confused as usual.
We have a job which reads from a folder stage into a transformer and out to a sequential file.
Folder ---> Transform ---> Seq File
In the transform stage there are several stage variables whose aim is to append a prefix to each row.
The variables are as follows
So what is supposed to be happening is
1) 1 row per input file comes from the folder stage, into the transformer with each row of raw data inferred by an @FM
2) The variables will:
I am pretty sure it has something to do with the interaction between the ereplaces in the variables ReplacedFirstRow and Outputdata.
During debug I noticed that ReplacedFirstRow had a value of just the first new inferred row - ie all the other output data was missing?
Am I missing something? Am I misunderstanding how stage variables process data?
Any ideas how to overcome this issue would be greatly appreciated
Thanks in advance![Smile :)](./images/smilies/icon_smile.gif)
Back again and totally confused as usual.
We have a job which reads from a folder stage into a transformer and out to a sequential file.
Folder ---> Transform ---> Seq File
In the transform stage there are several stage variables whose aim is to append a prefix to each row.
The variables are as follows
Code: Select all
a) AddPrefixtoFirstRow = Prefix : "," : Field(input.data, @FM, 1)
b) LINESEP = LINESEP
c) AddPrefixtoFM = LINESEP : Prefix : ","
d) ReplacedFirstRow = EREPLACE(input.data, Field(input.data, @FM, 1), AddPrefixToFirstRow)
e) Outputdata = EREPLACE(ReplacedFirstRow, @FM, AddPrefixToFM)
1) 1 row per input file comes from the folder stage, into the transformer with each row of raw data inferred by an @FM
2) The variables will:
- a) create a new inferred first row with the prefix
c) create a prefix including a row seperation
d) replace the first inferred row the new one created above
e) replace all @FM with AddPrefixtoFM
I am pretty sure it has something to do with the interaction between the ereplaces in the variables ReplacedFirstRow and Outputdata.
During debug I noticed that ReplacedFirstRow had a value of just the first new inferred row - ie all the other output data was missing?
Am I missing something? Am I misunderstanding how stage variables process data?
Any ideas how to overcome this issue would be greatly appreciated
Thanks in advance
![Smile :)](./images/smilies/icon_smile.gif)