Page 1 of 1

Min() Max() from a Sequential file

Posted: Thu Oct 29, 2015 5:26 am
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

Posted: Thu Oct 29, 2015 5:34 am
by qt_ky
I suppose you could ensure it is sorted and use stage variables instead of an aggregator...

Posted: Thu Oct 29, 2015 8:52 am
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.

Posted: Thu Oct 29, 2015 8:17 pm
by karthi_gana
Incase If I have multiple headers in the file, I think this logic will not give expected result.