Determining Last Input Record

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
trobinson
Participant
Posts: 208
Joined: Thu Apr 11, 2002 6:02 am
Location: Saint Louis
Contact:

Determining Last Input Record

Post by trobinson »

Is there a method for determining when the last record is traveling down a link? I would like to build a constraint for a link that would only evaluate to TRUE when the last record of an input set is detected. The first row is easy (@INROWNUM = 1). Is there anything like @LASTROWNUM ???
WoMaWil
Participant
Posts: 482
Joined: Thu Mar 13, 2003 7:17 am
Location: Amsterdam

Post by WoMaWil »

Hi,

what you are going to do is possible, but not the way you want to do it. There are two alternatives:

(1) You remember all input in a common variable and then you put the stage after the writing stage and there you can write what was at last remembered.

(2) You put your input in an intermedium Hash-File with the @inrownumber as your index-field and you can select the max(inrow)

Hope this helps you a bit.

Wolfgang
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You could create an extra path with the same data (one column will do) and pass that through an Aggregator stage with the column grouping rule set to Last.
Post Reply