* CONVERT.PM.TLD * * 08/20/99 - CONVERT TLD PM FILE * $INCLUDE BP.MASTER GEN.COMMON $INCLUDE BP.MASTER PM * OPEN 'PM' TO PM ELSE ABORT OPEN 'PM.TRANS' TO PM.TRANS ELSE ABORT OPEN 'PM.TRANS.TLD' TO PM.TRANS.TLD ELSE ABORT OPEN 'PM.AUX' TO PM.AUX ELSE ABORT OPEN 'PM.TLD' TO PM.TLD ELSE ABORT OPEN 'PM.PLEDGES' TO PM.PLEDGES ELSE ABORT OPEN 'PM.PLEDGES.TLD' TO PM.PLEDGES.TLD ELSE ABORT OPEN 'GEN.KEYS' TO GEN.KEYS ELSE ABORT OPEN 'GEN.KEYS.TLD' TO GEN.KEYS.TLD ELSE ABORT OPEN 'NOTES.FILE' TO NOTES.FILE ELSE ABORT OPEN 'NOTES.FILE.TLD' TO NOTES.FILE.TLD ELSE ABORT OPEN 'PM.COMBINED' TO PM.COMBINED ELSE ABORT OPEN 'EVENT.FILE' TO EVENT.FILE ELSE ABORT OPEN 'EVENT.FILE.TLD' TO EVENT.FILE.TLD ELSE ABORT OPEN 'FUND.FILE' TO FUND.FILE ELSE ABORT OPEN 'FUND.FILE.TLD' TO FUND.FILE.TLD ELSE ABORT OPEN 'TITLE' TO TITLE ELSE ABORT OPEN 'TITLE.TLD' TO TITLE.TLD ELSE ABORT OPEN 'STATUS.CODES' TO STATUS.CODES ELSE ABORT OPEN 'STATUS.CODES.TLD' TO STATUS.CODES.TLD ELSE ABORT OPEN 'CONVERT.PM.TLD.MESSAGE' TO MESSAGE.FILE ELSE ABORT OPEN 'EMPLOYER.MASTER' TO EMPLOYER.MASTER ELSE ABORT OPEN 'EMPLOYER.MASTER.TLD' TO EMPLOYER.MASTER.TLD ELSE ABORT OPEN 'PM.JOURNAL' TO PM.JOURNAL ELSE ABORT OPEN 'PM.JOURNAL.TLD' TO PM.JOURNAL.TLD ELSE ABORT OPEN 'SG' TO SG ELSE ABORT OPEN 'SG.TLD' TO SG.TLD ELSE ABORT OPEN 'SG.MOVEMENT' TO SG.MOVEMENT ELSE ABORT OPEN 'SG.MOVEMENT.TLD' TO SG.MOVEMENT.TLD ELSE ABORT * * MSG.COUNT=0 HIGHNUM=0 KEY='' STIME=TIME() TOTAL.ARRAY='' TOTAL.ARRAY<01,01>=0 ; TOTAL.ARRAY<02,01>='PM Records Read' TOTAL.ARRAY<01,02>=0 ; TOTAL.ARRAY<02,02>='Combined Records' TOTAL.ARRAY<01,03>=0 ; TOTAL.ARRAY<02,03>='PM Records Written' TOTAL.ARRAY<01,04>=0 ; TOTAL.ARRAY<02,04>='Notes Records Converted' TOTAL.ARRAY<01,05>=0 ; TOTAL.ARRAY<02,05>='New Notes Created Comments' TOTAL.ARRAY<01,06>=0 ; TOTAL.ARRAY<02,06>='Note Records Not Converted' TOTAL.ARRAY<01,07>=0 ; TOTAL.ARRAY<02,07>='Event Records Converted' TOTAL.ARRAY<01,08>=0 ; TOTAL.ARRAY<02,08>='Fund Record Converted' TOTAL.ARRAY<01,09>=0 ; TOTAL.ARRAY<02,09>='Pledge Records Converted' TOTAL.ARRAY<01,10>=0 ; TOTAL.ARRAY<02,10>='Pledge Records Skipped' TOTAL.ARRAY<01,11>=0 ; TOTAL.ARRAY<02,11>='Title Codes Converted' TOTAL.ARRAY<01,12>=0 ; TOTAL.ARRAY<02,12>='Status Codes Converted' TOTAL.ARRAY<01,13>=0 ; TOTAL.ARRAY<02,13>='Employer Master Records Converted' TOTAL.ARRAY<01,14>=0 ; TOTAL.ARRAY<02,14>='Journal Records Converted' TOTAL.ARRAY<01,15>=0 ; TOTAL.ARRAY<02,15>='Journal Records Skipped' * TOTAL.ARRAY<01,19>=0 ; TOTAL.ARRAY<02,19>='Message Log Entries' TOTAL.ARRAY<01,20>=0 ; TOTAL.ARRAY<02,20>='Highest PM Number' TTRANSIN=0 CDATE=DATE() * CRT CS CRT @(0,4):"Enter 'Y' to clear PM file and convert TLD: ": ANS='' INPUT ANS IF ANS # 'Y' THEN STOP * CRT @(0,22):CL:BEEP:"NOW CLEARING FILES - PLEASE WAIT!!!" * CLEARFILE NOTES.FILE ;* TEMP CLEARFILE PM CLEARFILE PM.AUX CLEARFILE NOTES.FILE CLEARFILE PM.COMBINED *CLEARFILE EVENT.FILE ;* DO NOT CLEAR-SAVE 3 INITIAL EVENT DEF CODES CLEARFILE FUND.FILE CLEARFILE PM.PLEDGES CLEARFILE MESSAGE.FILE CLEARFILE STATUS.CODES CLEARFILE TITLE CLEARFILE EMPLOYER.MASTER CLEARFILE SG CLEARFILE SG.MOVEMENT * CLEARFILE PM.TRANS WRITE 'NEW' ON GEN.KEYS,"CONVERT.PM.TLD" * CRT @(0,22):CL * SELECT FUND.FILE.TLD 50 READNEXT FUNDKEY THEN READ FUNDREC FROM FUND.FILE.TLD,FUNDKEY THEN WRITE FUNDREC ON FUND.FILE,FUNDKEY TOTAL.ARRAY<1,8>=TOTAL.ARRAY<1,8>+1 END GO 50 END GOSUB 1000 * SELECT EVENT.FILE.TLD 75 READNEXT EVENTKEY THEN READ EVENTREC FROM EVENT.FILE.TLD,EVENTKEY THEN IF REM(TOTAL.ARRAY<1,7>,500)=0 THEN GOSUB 1000 * * ABS 04-13-98 three fields that need to be changed. * * EVENTREC<24>=EVENTREC<20> ; EVENTREC<20>="" * EVENTREC<25>=EVENTREC<21> ; EVENTREC<21>="" * EVENTREC<26>=EVENTREC<22> ; EVENTREC<22>="" * WRITE EVENTREC ON EVENT.FILE,EVENTKEY TOTAL.ARRAY<1,7>=TOTAL.ARRAY<1,7>+1 END GO 75 END GOSUB 1000 * SELECT TITLE.TLD 85 READNEXT TITLEKEY THEN READ TITLEREC FROM TITLE.TLD,TITLEKEY THEN WRITE TITLEREC ON TITLE,TITLEKEY TOTAL.ARRAY<1,11>=TOTAL.ARRAY<1,11>+1 END GO 85 END READ TITLEREC FROM GEN.KEYS.TLD,"TITLE" THEN WRITE TITLEREC ON GEN.KEYS,"TITLE" END ELSE MSG='GEN.KEYS TITLE RECORD MISSING' END GOSUB 1000 * SELECT STATUS.CODES.TLD 90 READNEXT STAKEY THEN READ STAREC FROM STATUS.CODES.TLD,STAKEY THEN WRITE STAREC ON STATUS.CODES,STAKEY TOTAL.ARRAY<1,12>=TOTAL.ARRAY<1,12>+1 END GO 90 END GOSUB 1000 * * SELECT SG.TLD 92 READNEXT SGKEY THEN READ SGREC FROM SG.TLD,SGKEY THEN WRITE SGREC ON SG,SGKEY END GO 92 END GOSUB 1000 * SELECT SG.MOVEMENT.TLD 94 READNEXT SGKEY THEN READ SGREC FROM SG.MOVEMENT.TLD,SGKEY THEN WRITE SGREC ON SG.MOVEMENT,SGKEY END GO 94 END GOSUB 1000 * * 999 * *EXECUTE 'SELECT PM "6781792.1"' ;* TEMP SELECT PM.TLD ;* TEMP 100 READNEXT KEY ELSE GO 200 READ OREC FROM PM.TLD,KEY ELSE GO 100 IF REM(TOTAL.ARRAY<1,1>,2000)=0 THEN GOSUB 1000 *IF TOTAL.ARRAY<1,1> > 2000 THEN GO 199 TOTAL.ARRAY<1,1>=TOTAL.ARRAY<1,1>+1 LOCATE("95",OREC,PM$STATUS;FND) THEN TOTAL.ARRAY<1,2>=TOTAL.ARRAY<1,2>+1 WRITE OREC ON PM.COMBINED,KEY GO 100 END PMREC='' PMAUX='' PMKEY=KEY WK=OCONV(PMKEY,"G0.1") IF WK > HIGHNUM THEN TOTAL.ARRAY<1,20>=WK ; HIGHNUM=WK END PMREC=OREC PMREC=OREC PMREC=OREC PMREC=OREC PMREC=OREC PMREC=OREC PMREC=OREC PMREC=OREC PMREC=OREC *IF OREC # '' THEN * PMREC=OREC:'|H' *END PMREC=OREC PMREC=OREC PMREC=OREC PMREC=OREC PMREC=OREC PMREC=OREC * IF OREC<16> # '' THEN * LAST.NOTE=OREC * IF LAST.NOTE='' THEN LAST.NOTE=0 * LAST.NOTE=LAST.NOTE+1 * PMREC=1 * OREC=LAST.NOTE ;* ADD ONE TO LAST.NOTE FIELD * NOTEREC='' * NOTEREC<1>=CDATE * NOTEREC<3>=OREC<16> * NOTEREC<6>='99999 - ROOT SYSADMIN' * NOTEREC<7>='CNV' * NOTEREC<8>='GEN' * WRITE NOTEREC ON NOTES.FILE,PMKEY:"*":LAST.NOTE * TOTAL.ARRAY<1,5>=TOTAL.ARRAY<1,5>+1 * END PMREC=OREC PMREC=OREC PMREC=OREC PMREC=OREC PMREC=OREC PMREC=OREC PMREC=OREC PMREC=OREC PMREC=OREC IF PMREC='00000' THEN PMREC='' PMREC='FOR' END IF PMREC[1,3] MATCHES "1A0N1A" THEN PMREC='CAN' ;*SPA* set Canadian GEO Code PMREC='CANADA' END ELSE IF PMREC[1,5] MATCHES "5N" THEN PMREC='USA' END END * PMREC=OREC PMREC=OREC PMREC=OREC * CT5=DCOUNT(OREC,VM) FOR XXX = 1 TO CT5 NEWYEAR='19':OREC PMREC=NEWYEAR PMREC=OREC PMREC=OREC NEXT XXX * PMREC=OREC PMREC=OREC PMREC=OREC * PMREC=OREC PMREC=OREC PMREC=OREC * PMREC=OREC * PMREC=OREC * * PMREC=OREC ;* * * IF OREC<43> # '' THEN ;* CCC.RSV.FLAG * PMAUX<2>=OREC<43> * END * * * IF OREC<44> # '' THEN ;* CDIVISION.CODE * PMAUX<3>=OREC<44> * END * IF OREC # '' THEN PMREC=OREC END * IF OREC # '' THEN PMREC=OREC END * IF OREC # '' THEN PMREC=OREC END * * IF OREC # '' THEN PMREC=OREC END * * * IF OREC<68> # '' THEN ;* USING TAX FIELD FOR TRAN CT FOR TLD PMREC=OREC<68> END IF OREC # '' THEN ;* TAX ID PMREC=OREC END IF OREC # '' THEN PMREC=OREC END IF OREC # '' THEN PMREC=OREC END IF OREC # '' THEN PMREC=OREC END IF OREC # '' THEN PMREC=OREC END IF OREC # '' THEN PMREC=OREC END IF OREC # '' THEN PMREC=OREC END IF OREC # '' THEN PMREC=OREC END IF OREC # '' THEN PMREC=OREC END IF OREC # '' THEN PMREC=OREC END IF OREC # '' THEN PMREC=OREC END IF OREC # '' THEN PMREC=OREC END IF OREC # '' THEN PMREC=OREC END IF OREC # '' THEN PMREC=OREC END IF OREC # '' THEN PMREC=OREC END * * * * * * CONVERT EMPLOYER.MASTER RECORD (CONTAINS WORK NUM AND OTHER NEW PM FIELDS) * * READ EMPREC FROM EMPLOYER.MASTER.TLD,PMKEY THEN WRITE EMPREC ON EMPLOYER.MASTER,PMKEY TOTAL.ARRAY<1,13>=TOTAL.ARRAY<1,13>+1 END * TOTAL.ARRAY<1,3>=TOTAL.ARRAY<1,3>+1 * WRITE PMREC ON PM,PMKEY WRITE PMAUX ON PM.AUX,PMKEY GO 100 199 * * *GO 299 200 * CONVERT NOTES FILE *STOP ;* TEMP SELECT NOTES.FILE.TLD 210 * READNEXT NOTEKEY ELSE GO 299 READ OLDNOTE FROM NOTES.FILE.TLD,NOTEKEY ELSE GO 210 IF REM(TOTAL.ARRAY<1,4>,250)=0 THEN GOSUB 1000 PMKEY=OCONV(NOTEKEY,"G0*1") READ PMREC FROM PM,PMKEY THEN READV NOTENUM FROM PM.TLD,PMKEY,PM$LAST.NOTE ELSE ABORT TOTAL.ARRAY<1,4>=TOTAL.ARRAY<1,4>+1 * PMREC=PMREC-1 * PMREC=NOTENUM * WRITE PMREC ON PM,PMKEY NOTEREC=OLDNOTE IF NOTEREC<6>='' THEN NOTEREC<6>='99999 - SYSADMIN ROOT' NOTEREC<7>='CNV' NOTEREC<8>='GEN' END ELSE NOTEREC<9>=OLDNOTE<5> NOTEREC<5>='' END * NOTEKEY=PMKEY:"*":PMREC WRITE NOTEREC ON NOTES.FILE,NOTEKEY END ELSE TOTAL.ARRAY<1,6>=TOTAL.ARRAY<1,6>+1 END GO 210 299 * * STOP ;* TEMP * 300 * CONVERT PM.TRANS SELECT PM.TRANS.TLD 310 READNEXT TRKEY THEN READ TRREC FROM PM.TRANS.TLD,TRKEY THEN IF REM(TTRANSIN,500)=0 THEN GOSUB 1000 TTRANSIN=TTRANSIN+1 READ PMREC FROM PM,TRKEY THEN NEWTR='' NEWTR=TRREC WRITE NEWTR ON PM.TRANS,TRKEY TTRANS=TTRANS+1 END END GO 310 END * 400 * CONVERT PM.PLEDGES SELECT PM.PLEDGES.TLD 410 READNEXT PGKEY THEN READ PGREC FROM PM.PLEDGES.TLD,PGKEY THEN READ PMREC FROM PM,PGKEY THEN IF REM(TOTAL.ARRAY<1,9>,250)=0 THEN GOSUB 1000 TOTAL.ARRAY<1,9>=TOTAL.ARRAY<1,9>+1 WRITE PGREC ON PM.PLEDGES,PGKEY END ELSE TOTAL.ARRAY<1,10>=TOTAL.ARRAY<1,10>+1 END END GO 410 END * 500 * CONVERT PM.JOURNAL SELECT PM.JOURNAL.TLD 510 READNEXT JRKEY THEN READ JREC FROM PM.JOURNAL.TLD,JRKEY THEN READ PMREC FROM PM,JRKEY THEN IF REM(TOTAL.ARRAY<1,14>,250)=0 THEN GOSUB 1000 TOTAL.ARRAY<1,14>=TOTAL.ARRAY<1,14>+1 WRITE JREC ON PM.JOURNAL,JRKEY END ELSE TOTAL.ARRAY<1,15>=TOTAL.ARRAY<1,15>+1 END END GO 510 END * GO 2000 * * 1000 * GKREC='' CTIME=TIME() DTIME=STIME-CTIME GKREC<1>='STARTED: ':OCONV(STIME,"MTH") GKREC<2>='FINISH : ':OCONV(CTIME,"MTH") GKREC<3>='RUN TIME: ':OCONV(DTIME,"MTS") LNNUM=5 DISP=0 FOR TT = 1 TO 20 WK=TOTAL.ARRAY<1,TT>'L#8':' ':TOTAL.ARRAY<2,TT> GKREC<4+TT>=WK NEXT TT WRITE GKREC ON GEN.KEYS,"CONVERT.PM.TLD" FOR TT = 1 TO 24 IF REM(TT,13)=0 THEN DISP=40 ; LNNUM=5 CRT @(0+DISP,LNNUM):GKREC'L#40' LNNUM=LNNUM+1 NEXT TT RETURN * 2000 * GOSUB 1000 STOP * 3000 * WRITE TO MESSAGE.FILE MSG.COUNT=MSG.COUNT+1 MSGLN=KEY'L#12':" ":MSG WRITE MSGLN ON MESSAGE.FILE,MSG.COUNT'R%5' RETURN * 4000 * ADD TO DEMOG FIELDS * RETURN