Hello,
This is a pretty stupid question but I've not been shown otherwise - Quick example program, probably made a couple of mistakes please ignore them;
Is there a way to check for a record in and/or check & then write to the file I am reading, without losing my place set by SetLl/ReadE? Or is the best way to do this just to have a logical with a matching key and check/write to that?
I guess I could use select count(*) into :count for checking or define the same file twice with rename but I was wondering what other alternative options there are?
Cheers,
Ryan
This is a pretty stupid question but I've not been shown otherwise - Quick example program, probably made a couple of mistakes please ignore them;
Code:
fFILE1 IF A E K DISK Prefix(pf_) fFILE1L1 IF A E K DISK Prefix(l1_) f Rename(FILE1R : FILE1R1) d Level S 2p 0 Inz(1) d NextLevel S Like(Level) /Free SetLl (Level) FILE1; ReadE (Level) FILE1; DoW Not %EoF(FILE1); If pf_Object = 'Bad'; SetLl (Level : pf_Object) FILE1L1; If not %Equal(FILE1L1); Clear FILE1R1; l1_Object = pf_Object; l1_Level = pf_Level + 1; Write FILE1R1; EndIf; ReadE (Level) FILE1; EndDo; *Inlr = *On; Return; /End-Free
Is there a way to check for a record in and/or check & then write to the file I am reading, without losing my place set by SetLl/ReadE? Or is the best way to do this just to have a logical with a matching key and check/write to that?
I guess I could use select count(*) into :count for checking or define the same file twice with rename but I was wondering what other alternative options there are?
Cheers,
Ryan
Comment