* CMSD.ORDER.CONV * AUTHOR: STEVEN ADAMS * DATE: 10/23/95 * PURPOSE: TO CONVERT PM.ORDERS RECORDS TO NEW FORMAT (NEW NAME/ADDRESS LAYOUT) * $INCLUDE BP.MASTER GEN.COMMON $INCLUDE BP.MASTER CMSD.IVD * EQU IVD$SHIP.TO.STREET TO 56 EQU IVD$SHIP.TO.ATTN1 TO 57 EQU IVD$SHIP.TO.ATTN2 TO 58 EQU IVD$SHIP.TO.CITY TO 59 EQU IVD$SHIP.TO.STATE TO 60 EQU IVD$SHIP.TO.ZIP TO 61 EQU IVD$SHIP.TO.COUNTRY TO 62 * OPEN 'PM.ORDERS' TO PM.ORDERS ELSE ABORT 201,'PM.ORDERS' * CRT CS CRT @(1,1):RV:' CMSD.ORDER.CONV ':ERV CRT @(25,3):'ORDER CONVERSION TO NEW NAME/ADDRESS LAYOUT' EOL=0 ; CT=0 ; NONE=0 ; OK=0 ; CNV=0 ; USA=0 ; CAN=0 ; FOR=0 SELECT PM.ORDERS LOOP READNEXT ID ELSE EOL=1 UNTIL EOL DO IF REM(CT,100)=0 THEN GOSUB 2000 READU ORAY FROM PM.ORDERS,ID THEN CT=CT+1 GOSUB 1000 RELEASE PM.ORDERS,ID END REPEAT GOSUB 2000 CRT STOP * 1000 * IF ORAY = '' THEN NONE=NONE+1 END ELSE IF ORAY # '' THEN OK=OK+1 END ELSE CNV=CNV+1 PNAME=ORAY PATTN1=ORAY PATTN2=ORAY PSTREET=ORAY PCITY=ORAY PSTATE=ORAY PZIP=ORAY PCOUNTRY=ORAY ORAY='' ORAY=PNAME ORAY='' ORAY='' ORAY='' ORAY='' ORAY='' ORAY='' ORAY='' ORAY='' ORAY=PATTN1 ORAY=PATTN2 ORAY=PSTREET ORAY=PCITY ORAY=PSTATE BEGIN CASE CASE PZIP[1,5] MATCHES '5N' PGEO='USA' PCOUNTRY='' USA=USA+1 CASE PZIP[1,3] MATCHES '1N1A1N' PGEO='CAN' PCOUNTRY='CAN' CAN=CAN+1 CASE PZIP='00000' PZIP='' PGEO='FOR' FOR=FOR+1 CASE 1 PGEO='FOR' FOR=FOR+1 END CASE ORAY=PZIP ORAY=PCOUNTRY ORAY=PGEO WRITE ORAY ON PM.ORDERS,ID END END RETURN * 2000 * CRT @(10,08):"Number of orders read: ":CT CRT @(10,09):"Number of orders without SHIPTO: ":NONE CRT @(10,10):"Number of orders OK: ":OK CRT @(10,11):"Number of orders converted: ":CNV CRT @(10,13):"Number of USA orders converted: ":USA CRT @(10,14):"Number of CANADA orders converted: ":CAN CRT @(10,15):"Number of FOREIGN orders converted: ":FOR RETURN