Min() Max() from a Sequential file

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
karthi_gana
Premium Member
Premium Member
Posts: 729
Joined: Tue Apr 28, 2009 10:49 pm

Min() Max() from a Sequential file

Post by karthi_gana »

All,

I have a file with header, detail & footer.

Detail record is stored in a different file along with row_num. I want to get the min(row_num) and max(row_num) from the file without using aggregator stage. is it possible?

Thanks
Karthik M
Karthik
qt_ky
Premium Member
Premium Member
Posts: 2895
Joined: Wed Aug 03, 2011 6:16 am
Location: USA

Post by qt_ky »

I suppose you could ensure it is sorted and use stage variables instead of an aggregator...
Choose a job you love, and you will never have to work a day in your life. - Confucius
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Count the lines and subtract 2 to give the max. Use 2 for the min. This assumes one header and one trailer line.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
karthi_gana
Premium Member
Premium Member
Posts: 729
Joined: Tue Apr 28, 2009 10:49 pm

Post by karthi_gana »

Incase If I have multiple headers in the file, I think this logic will not give expected result.
Karthik
Post Reply