HowToCompare Data with in a file?

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
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Since it seems that the data content of the file isn't important, you can use Windows/UNIX utilities such as "wc -l" and "tail -1 <yourfile> " to get the information you want and process the logic from there. This can be done easily in a Job Sequence.
ray.wurlod
Participant
Posts: 54595
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

There is technically no such thing as "the 51st row in a table". One of the precepts of normalized databases is that storage order is under control of the engine and neither controllable nor predictable.

Assuming therefore that you have a key by which the data are ordered during extraction, the task can easily be performed with stage variables. One can test the row number (to see whether Mod(@INROWNUM) = 1 And @INROWNUM > 1), another accumulates the total, and another determines whether the control record total matches the accumulated total. This last stage variable is used in (as?) the constraint expression on the two output links from the Transformer stage.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply