|
From: andrej.panjkov on 23 Apr 2008 01:26 Please ignore my last post, I hit the send button before it was finished. (Hence the indices not being incremented, the branching not shown, and no counter, and other stuff.) Anyway, one reason I like to set a flag is that instead of stopping at the first bad read, I can keep trying to read records and count how reads set the error flag.
From: Luka Djigas on 23 Apr 2008 16:59 On Tue, 22 Apr 2008 22:08:40 -0700 (PDT), Terence <tbwright(a)cantv.net> wrote: >Dzien dobre, Luka. >You can find which CWxx.DAT files exist and what size they are and so >how mnay records in each by using the directory enquiry via a SYSTEM >(DIR CW??.DAT> mydir) call and reading back the created file. If the >records are fixed length you simple divide file size by record length, >for each file. > >You can also find the length of any file via another service call (an >API one). >If the records are not fixed length you will have to read them and >count them first as suggested above. Yes, that may work. I do, however, although I'm not a portable-at-all-costs type, try to use the system call as little as possible, since you never know what on system will someone try to run it. Morever, although the data lines are more-or-less of the same lenght, the first 14 lines are not (depending on the experiment they differ). But nevertheless, thank you for the effort. regards Luka
From: Luka Djigas on 23 Apr 2008 17:05 On Tue, 22 Apr 2008 21:17:54 -0700, nospam(a)see.signature (Richard Maine) wrote: > >Um... by counting them? Start a counter at zero and increment it for >every successful read. I hope that I don't need to post an example of >counting? :-( Ugnnng, I hate this. While complicating on how to solve this, the simple solution was right in front of me (thanks epc :-( No, you don't need to post an example of counting :-) The files are relatively short so going through the lines twice is not a problem. Problem solved! Thank you, and all whom I didn't reply. regards Luka
First
|
Prev
|
Pages: 1 2 Prev: curious about 8 byte LOGICAL... Next: Interpretation of RECL resolution; help file in CVF |