Author: Bill Woodger
Subject: Reply to: Updating the counters after eliminating duplicates
Posted: Tue Nov 22, 2016 2:43 pm (GMT 5.5)
Yes, Arun, that looks good. I got confused with the END because the trailer was being treated as a separate group by Rohit :-)
I'd rearrange the order of the IFTHENs, so that the data-one is treated first, it'll avoid a lot of tests for when the header/trailer when most of the records will be data. Multiple IFTHEN=(WHEN=(logicalexpression) are like an EVALUATE in COBOL, so cease the processing of that construct as soon as there is a "hit". That behaviour can be modified, when needed (for two entirely independent operations on the same record) by using HIT=NEXT.
Subject: Reply to: Updating the counters after eliminating duplicates
Posted: Tue Nov 22, 2016 2:43 pm (GMT 5.5)
Yes, Arun, that looks good. I got confused with the END because the trailer was being treated as a separate group by Rohit :-)
I'd rearrange the order of the IFTHENs, so that the data-one is treated first, it'll avoid a lot of tests for when the header/trailer when most of the records will be data. Multiple IFTHEN=(WHEN=(logicalexpression) are like an EVALUATE in COBOL, so cease the processing of that construct as soon as there is a "hit". That behaviour can be modified, when needed (for two entirely independent operations on the same record) by using HIT=NEXT.