[Info-vax] MAX record size in a sequential file
Johnny Billquist
bqt at softjar.se
Tue May 15 03:09:42 EDT 2012
On 2012-05-14 23.18, StGallen wrote:
> Dear All,
>
> I need to read records from a sequential file using DEC BASIC (version 1.3).
> The said sequential file has the below structure (from ANALYZE/RMS):
>
> RMS FILE ATTRIBUTES
>
> File Organization: sequential
> Record Format: stream-LF
> Record Attributes: carriage-return
> Maximum Record Size: 0
> Longest Record: 32767
> Blocks Allocated: 192, Default Extend Size: 0
> End-of-File VBN: 39, Offset: %X'0192'
> File Monitoring: disabled
> Global Buffer Count: 0
>
> QUESTION:
> How does RMS come up with a value of 32767 for the Longest Record?
>
> I did write a DCL procedure to check the size of each record and the largest record is 300. The total length of all records is 19125. Is RMS reporting 32767 as the largest record RMS can possibly fit in a record?
>
> QUESTION:
> IN DEC BASIC, I use:
>
> MAP (ABC) STRING all_in_all=2048%
>
> OPEN FILE_NAME FOR INPUT AS FILE #118%,&
> ORGANIZATION SEQUENTIAL STREAM,&
> ACCESS READ,&
> ALLOW NONE,&
> MAP ABC
>
> This does not work and I get a run time error of :
> BADRECVAL, Bad RECORDSIZE value on OPEN (ERR=148)
>
> I feel it would be inelegant to set the MAP to 32767?
>
> QUESTION:
> I am having problem understanding the below :
> Record Format: stream-LF
> Record Attributes: carriage-return
> Maximum Record Size: 0
> Longest Record: 32767
>
> Record Format: The records in this case are seperated by a LF character.
> What is the Record Attribute? What does carriage_return mean here?
>
>
> Thanks for all your answers.
> Best
I think your basic problem is that the file do not have a fixed record
length, so how do you expect the map to work?
When dealing with variable record lengths, you need to be more clever.
(What's wrong with just opening the file and doing LINPUT on it?)
Johnny
More information about the Info-vax
mailing list