Not good at this, as you can see, I want to read every record in FileA, Chain to FileB and if not found in FileB, delete the record from FileA. but I am deleting the entire file. sounds simple but I cant see my mistake. Please advise.
FFileA UF E K DISK
FFileB IF E K DISK
/Free
Read FileA;
Dow not %Eof(FileA);
Chain (Inv#) FileB; //field from fileA
If not %Found(FileB);
Delete FileARecFmt;
Endif;
Read FileA;
Enddo;
*INLR = *On;
Return;
/End-Free
FFileA UF E K DISK
FFileB IF E K DISK
/Free
Read FileA;
Dow not %Eof(FileA);
Chain (Inv#) FileB; //field from fileA
If not %Found(FileB);
Delete FileARecFmt;
Endif;
Read FileA;
Enddo;
*INLR = *On;
Return;
/End-Free