12100 !-------------------------------------------------------------------- & ! & ! Convert Sublist Definition Dates and Numeric Fields & ! & !-------------------------------------------------------------------- & ! & ! & ! input: SEL.- sublist selection criteria & ! HDR.CAT.TYPE$(10%) array which indicates type & ! (A, D, or N) of each category & ! HDR.SYS.DEF.PRIME.ID$ Is the Primary ID system & ! defined? & ! HDR.FIELD.LEN%(20%) array which contains the & ! length of all address fields & ! M11.LAST.LINE% number of sublist definition & ! lines & ! & ! output: SEL.- converted sublist selection criteria & ! & ! M11.FIELD.WAS.CNVTD% A flag which is true if at & ! least one field was converted & ! & ! Assumptions: & ! & ! - Sublist definition is already in memory (MAPSEL) & ! - Order of sublist fields: Primary ID, Alt. ID, Counter, ZIP, & ! categories & ! - Order of address fields (see M11INT line 4800) & ! - (Not) between = op code 4 & ! & ! Variables Local to this Subroutine & ! & ! F.LEN% Length of the current sublist def field value & ! FIELD.NUM% Integer between 1-10 to indicate which field & ! is specified in the current sublist def line & ! FIELD.TYPE$ A = Alphanumeric, D = Date, N = Numeric & ! LINE% Line number of sublist def line currently & ! being processed & ! & ! NOTE: The following constants must be initialized by the & ! calling module (or by M11INT): & ! & ! TRUE% Constant value for logical TRUE & ! FALSE% Constant value for logical FALSE & ! & ! NOTE: This subroutine also uses the following functions & ! which must be appended into the calling module: & ! & ! FN.DATE.CNV$ converts a date from DD-MMM-YY to YYMMDD & ! FN.RJZF$ converts a left justified string to a right & ! justified, zero filled numeric string & ! & !-------------------------------------------------------------------- & 12120 LINE% = 1% & \ M11.FIELD.WAS.CNVTD% = FALSE% & ! Initialize sublist definition line counter. Set field was & ! converted flag to false. & 12140 FIELD.NUM% = VAL(SEL.FIELD.NUM$(LINE%)) & \ FIELD.TYPE$ = "A" & \ FIELD.TYPE$ = "N" & IF (FIELD.NUM% = 1% AND HDR.SYS.DEF.PRIME.ID$ = "Y") & OR (FIELD.NUM% = 1% AND HDR.SYS.DEF.PRIME.ID$ = "1") & OR FIELD.NUM% = 3% ! Counter & \ FIELD.TYPE$ = HDR.CAT.TYPE$(FIELD.NUM% - 4%) & IF FIELD.NUM% > 4% & AND FIELD.NUM% < 11% & & \ GO TO 12180 IF FIELD.TYPE$ = "A" OR FIELD.TYPE$ = "Y" & \ GO TO 12180 IF FIELD.TYPE$ = "C" & ! This line added 12-Apr-84 for 'coded' category type & \ GO TO 12160 IF FIELD.TYPE$ = "D" & & \ F.LEN% = HDR.FIELD.LEN%(FIELD.NUM%) & \ F.LEN% = HDR.FIELD.LEN%(FIELD.NUM% + 6%) IF FIELD.NUM% > 3% & \ SEL.VALUE.1$(LINE%) = FN.RJZF$(SEL.VALUE.1$(LINE%),F.LEN%) & \ SEL.VALUE.2$(LINE%) = FN.RJZF$(SEL.VALUE.2$(LINE%),F.LEN%) & IF SEL.OP.CODE$(LINE%) = "4" & \ M11.FIELD.WAS.CNVTD% = TRUE% & \ GO TO 12180 & ! Get field number and determine field type. If field type is "A", & ! then no conversion is necessary. Go to 12160 if date conversion is & ! required. Otherwise, perform numeric conversion (convert both & ! value fields if this is a "between" condition test). & 12160 SEL.VALUE.1$(LINE%) = FN.DATE.CNV$(SEL.VALUE.1$(LINE%)) & \ SEL.VALUE.2$(LINE%) = FN.DATE.CNV$(SEL.VALUE.2$(LINE%)) & IF SEL.OP.CODE$(LINE%) = "4" & \ M11.FIELD.WAS.CNVTD% = TRUE% & ! Perform date conversion (convert both value fields if this is a & ! "between" condition test). & 12180 LINE% = LINE% + 1% & \ GO TO 12140 IF LINE% <= M11.LAST.LINE% & ! Increment the sublist definition line counter. If it's greater than & ! the total number of sublist def lines, then we're done. & & 12190 RETURN &