|
The code below looks duplicated. If modularize is not an option, I might try to consolidate the following into two sub-procs that accept parms. IF %SUBST(XN14:1:MYPARM)=%SUBST(SV_SZIP:1:MYPARM); //6 Pos. Current_Zipcode in Sequence with Previous_Zipcode CALLP CHECK(MYPARM+1); ... ENDIF; -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of fkany@xxxxxxxxxxxxxxxxxx Sent: Tuesday, October 19, 2004 10:45 AM To: RPG400-L@xxxxxxxxxxxx Subject: Trivia: How many lines of code are allowed in an RPG Program? //====================================================================== //First 5 pos. of Current_Zipcode match First 5 pos. of Previous_Zipcode //====================================================================== IF %SUBST(XN14:1:5)=%SUBST(SV_SZIP:1:5); //6 Pos. Current_Zipcode in Sequence with Previous_Zipcode EXSR CHECK_6; IF IN_SEQUENCE = 'Y'; //Yes ENDRANGE = XN14; ITER; ENDIF; IF IN_SEQUENCE = 'N'; //No EXSR WRITE_RECORD; EXSR SAVE_NEWINFO; ITER; ENDIF; ENDIF; //====================================================================== //First 4 pos. of Current_Zipcode match First 4 pos. of Previous_Zipcode //====================================================================== IF %SUBST(XN14:1:4)=%SUBST(SV_SZIP:1:4); //5,6 Pos. Current_Zipcode in Sequence with Previous_Zipcode EXSR CHECK_56; IF IN_SEQUENCE = 'Y'; //Yes ENDRANGE = XN14; ITER; ENDIF; IF IN_SEQUENCE = 'N'; //No EXSR WRITE_RECORD; EXSR SAVE_NEWINFO; ITER; ENDIF; ENDIF; //====================================================================== //First 3 pos. of Current_Zipcode match First 3 pos. of Previous_Zipcode //====================================================================== IF %SUBST(XN14:1:3)=%SUBST(SV_SZIP:1:3); //4,5,6 Pos. Current_Zipcode in Sequence with Previous_Zipcode EXSR CHECK_456; IF IN_SEQUENCE = 'Y'; //Yes ENDRANGE = XN14; ITER; ENDIF; IF IN_SEQUENCE = 'N'; //No EXSR WRITE_RECORD; EXSR SAVE_NEWINFO; ITER; ENDIF; ENDIF; //====================================================================== //First 2 pos. of Current_Zipcode match First 2 pos. of Previous_Zipcode //====================================================================== IF %SUBST(XN14:1:2)=%SUBST(SV_SZIP:1:2); //3,4,5,6 Pos. Current_Zipcode in Sequence with Previous_Zipcode EXSR CHECK_3456; IF IN_SEQUENCE = 'Y'; //Yes ENDRANGE = XN14; ITER; ENDIF; IF IN_SEQUENCE = 'N'; //No EXSR WRITE_RECORD; EXSR SAVE_NEWINFO; ITER; ENDIF; ENDIF; //====================================================================== //First pos. of Current_Zipcode match First pos. of Previous_Zipcode //====================================================================== IF %SUBST(XN14:1:1)=%SUBST(SV_SZIP:1:1); //2,3,4,5,6 Pos. Current_Zipcode in Sequence with Previous_Zipcode EXSR CHECK_23456; IF IN_SEQUENCE = 'Y'; //Yes ENDRANGE = XN14; ITER; ENDIF; IF IN_SEQUENCE = 'N'; //No EXSR WRITE_RECORD; EXSR SAVE_NEWINFO; ITER; ENDIF; ENDIF;
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.