you say tha half a million records go thru this monthly? what is the concern then of creating a value of zero vs leaving a CUMM element null? it would seem highly unlikely that not a single record you process has no value. just element the tests for null that only stop a single addition and are not truely conditional.
jay Message: 10 Date: Wed, 2 Mar 2011 11:43:58 -0500 From: "Dave Laansma" <[email protected]> To: <[email protected]> Subject: [U2] Is this worth rewriting? Message-ID: <071256f97fa0fa498115009ae88175b2017b9...@hubmail2.hubbardsupply.com> Content-Type: text/plain; charset="US-ASCII" This is some old code that I didn't write, so please don't use it for anything profitable ... The proposal to the group is: Due to the repeated references deep into the PARMS tables, if this were rewritten to reference these locations as few times as possible, IN YOUR OPINION, would there be a significant improvement in the performance of this subroutine? All in favor of rewrite, say AYE All opposed, say NAY (I'm testing some U2UG-Denver skills) MONTHLY.USAGE: CM=MONTH+LY.CNT FOR M=1 TO 12 IF PARMS(12)<101,CM>#'' OR PARMS(12)<133,CM>#'' OR PARMS(12)<134,CM>#'' THEN CUM(M)=PARMS(12)<101,CM>+PARMS(12)<133,CM>+PARMS(12)<134,CM> END IF PARMS(7)<100,CM>#'' OR PARMS(7)<101,CM>#'' OR PARMS(7)<102,CM>#'' THEN IF PARMS(7)<100,CM>#'' THEN CUMO(M)=CUMO(M)+PARMS(7)<100,CM> ELSE CUMO(M)=CUMO(M)+PARMS(12)<101,CM> END IF PARMS(7)<101,CM>#'' THEN CUMO(M)=CUMO(M)+PARMS(7)<101,CM> ELSE CUMO(M)=CUMO(M)+PARMS(12)<133,CM> END IF PARMS(7)<102,CM>#'' THEN CUMO(M)=CUMO(M)+PARMS(7)<102,CM> ELSE CUMO(M)=CUMO(M)+PARMS(12)<134,CM> END END CM=CM-1; IF CM=0 THEN CM=24 NEXT M RETURN ======================================================================================================================================================= _______________________________________________ U2-Users mailing list [email protected] http://listserver.u2ug.org/mailman/listinfo/u2-users
