Hello,
I want to create a jobs that reads a row from a file in one column and in an other the row-1..
Ex. Data1, Data2
1 Null()
2 1
3 2
... ...
If you have any advice on how to build something like that?
Thanks,
Read Row -1
Moderators: chulett, rschirm, roy
Sure... but you don't "read row -1". What you can do it hold on to the previous row and then use data from it while processing the current row. End result is the same, just wanted to make that clarification.
Stage variables in a Transformer can do that for you. New versions have more options but this approach is (in my opinion) simpler. Stage variables are evaluated from top to bottom which is key to the technique. I don't have time right now for a Full Wurlod but I'm assuming someone will be along shortly to help.![Wink :wink:](./images/smilies/icon_wink.gif)
Stage variables in a Transformer can do that for you. New versions have more options but this approach is (in my opinion) simpler. Stage variables are evaluated from top to bottom which is key to the technique. I don't have time right now for a Full Wurlod but I'm assuming someone will be along shortly to help.
![Wink :wink:](./images/smilies/icon_wink.gif)
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Premium Member
- Posts: 1735
- Joined: Thu Mar 01, 2007 5:44 am
- Location: Troy, MI
As you know that the stage variables are executed in sequential manner from top to bottom, you can send the current record to one stage variable and then send the value to another stage variable defined above it. So in this was you can hold any value also you can concatenate the columns to hold entire row.
Also if you want to do it for entire set of records ignoring any keys, you might want to run the transformer in sequential mode.
Also if you want to do it for entire set of records ignoring any keys, you might want to run the transformer in sequential mode.
Priyadarshi Kunal
Genius may have its limitations, but stupidity is not thus handicapped.![Wink :wink:](./images/smilies/icon_wink.gif)
Genius may have its limitations, but stupidity is not thus handicapped.
![Wink :wink:](./images/smilies/icon_wink.gif)