>*This Program Will Update New_bill.dbf with New Target Path >SELECT New_bills >LOCATE >SCAN WHILE .NOT. EOF() >F=Filename >SELECT Master >LOCATE FOR accountno=F >IF FOUND()=.T. >E=ALLTRIM(Exchange) >ME=1 && Denotes that the exchgange is Not missing >ELSE >E="Missing Exchange" >ME=0 && Denotes that the exchange is Missing >ENDIF > >SELECT New_bills >P='&tDirectory'+'&pBillmonth'+'-'+ALLTRIM(STR(pbillyear))+'\'+E+'\'+STR(filename)+'.ps' >Replace Newpath WITH P >Replace Missexg WITH ME >Disp_percent=Alltrim(Str(Recno()/RecordsForSelectA*100)) >Wait Wind "Step-3 [Updating Target Path Information..."+Disp_percent+"%"+" Completed]" Nowait >ENDSCAN >RETURN >>
cPath = ADDBS(tDirectory+pBillmonth+'-'+ALLTRIM(STR(pbillyear))) * Handle the ones that match first. UPDATE NewBills ; SET MissExg = 1, ; NewPath = FORCEPATH(FORCEEXT(FileName, "PS"), m.cPath) ; FROM Master ; WHERE NewBills.FileName = Master.AccountNo * Handle the ones with no match. UPDATE NewBills ; SET MissExg = 0, ; NewPath = "Missing Exchange"; WHERE FileName NOT IN (SELECT AccountNo FROM Master)If this isn't exactly it, it should send you in the right direction.