Page 1 of 1

Sequential file processing.

Posted: Tue Jul 09, 2013 8:01 pm
by pinball
Hi,

I'm accessing a SEQUENTIAL file. I reached some 'x' record and now I wish to go to the top of file (1st record) without closing & opening the file. Is that possible?

Re: Sequential fiel processing.

Posted: Tue Jul 09, 2013 9:28 pm
by Robert Sample
No, it is not possible. A sequential file means sequential -- as in, read the first record then read the second record then read the third record then .... If you want to do anything else, you either don't use a sequential file or you close and re-open the sequential file and re-read every record starting with the first one.

Re: Sequential fiel processing.

Posted: Thu Jul 11, 2013 5:27 pm
by Priya
So in case, someone needs a kind of processing, which needs to go to the start of the file -- sequential files are not a good choice but then other than VSAM -- what do we have?

Re: Sequential fiel processing.

Posted: Thu Jul 11, 2013 5:45 pm
by Robert Sample
VSAM KSDS would be the first choice; the second choice would be a data base. IBM used to have ISAM files, which were non-VSAM indexed files, but ISAM is not available any more. If you have a good hash key, using a BDAM or VSAM RRDS would also work; "good hash key" means that one (or more) fields of each record can fairly easily be turned into a sequential number. In such a case reading from the start of the file would merely mean grabbing the record at offset 0 (record 1) via direct read.

Re: Sequential file processing.

Posted: Tue Aug 06, 2013 11:44 pm
by Priya
Thanks Robert.