Hi all
I have a following a requirment like this...
I have dsx file of particular job as an input file like this....
This is just a part of the dsx file
BEGIN DSSUBRECORD
Name "sNo"
SqlType "4"
Precision "10"
Scale "0"
Nullable "0"
KeyPosition "1"
DisplaySize "1"
Derivation "DSLink3.sNo"
Group "0"
ParsedDerivation "DSLink3.sNo"
SourceColumn "DSLink3.sNo"
SortKey "0"
SortType "0"
TableDef "Sequential\\Angel\\cnt_in.txt"
AllowCRLF "0"
LevelNo "0"
Occurs "0"
PadNulls "0"
SignOption "0"
SortingOrder "0"
ArrayHandling "0"
SyncIndicator "0"
PadChar ""
ColumnReference "sNo"
APTFieldProp "quote=none"
ExtendedPrecision "0"
TaggedSubrec "0"
OccursVarying "0"
PKeyIsCaseless "0"
END DSSUBRECORD
Now i get the "sNo" ,precision and the value the precision (4 th line) has to take for ex--67 through the paramenter
After getting the record lwith Name and sNo --- first record
How can i move to precision record and change its value to 67...
I have to do this in the transformer..
my stage are as follows..
sequential stage----->transformer------->sequential stage
input sequential stage is " delimited
so the first column is names and the secod column is values...
can i do with stage variables....
can anybody suggest me an idea.....
how to move one record by record
Moderators: chulett, rschirm, roy
I usually do this kind of processing using "states". I will use stage variables to store state information and other relevant values. In your processing you could create a stage variable such as "CurrentType" which is set when a record begins with BEGIN and set to the value of the 2nd word (i.e. field(In.Column,' ',2)). Do the same type of thing to get the name. Then when you reach a record that starts with "Precision" you can check your state to see if you are in a SUBRECORD and have an object named "sNo" and can then modify the output to reflect the new precision.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
I think what Arnd is trying to say also was treat each line as if it is one field. You need several stage variables like
FirstWord = field(InputLine, " ", 1)
SecondWord = field(InputLine, " ", 2)
States = if FirstWord = "OLEType" then SecondWord else States
Name = if FirstWord = "Name" then SecondWord else Name
Now just output every line but change the InputLine when FirstWord = "Precision" and Name = "sNo"
FirstWord = field(InputLine, " ", 1)
SecondWord = field(InputLine, " ", 2)
States = if FirstWord = "OLEType" then SecondWord else States
Name = if FirstWord = "Name" then SecondWord else Name
Now just output every line but change the InputLine when FirstWord = "Precision" and Name = "sNo"
Mamu Kim
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: