HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
Operating System - OpenVMS
Showing results for 
Search instead for 
Did you mean: 

The STREAM Record Format

Go to solution

The STREAM Record Format

Using VAX / VMS 6.1 (Iknow ... it's old)

I'm looking at the manual "Guide to OpenVMS File Applicaions" and on page 2-13 I read about the Stream record format:

"This variation uses a terminator from a limited set of special characters: The carriage return (CR), the carriage-return/line feed combination (CRLF) or the form feed (FF)"

But how do I specify the exact terminator in use?

The specific problem is this: I have a file from the outside (non-VMS), and dir/full shows it is a STREAM, and DUMP shows there is a CR/LF at the end of every record. I can't read the file because I get "Record too long", and I think it's because the program does not know how to find the end of record -- ie, it is looking for the wrong terminator.

Honored Contributor

Re: The STREAM Record Format

do you see "Record too long" using editor (EDT)?
If yes, there is no error. EDT can manager only file with max record len = 254.
To check integrity of file use follow command:
You could see records of file.

Antonio Vigliotti
Antonio Maria Vigliotti
Steve Watts_1
Occasional Visitor

Re: The STREAM Record Format

You likely used ftp to get the file onto VMS, it us therefore possible the file attributes got messed up in thr process.

Try changing the file type attribute to a type that mirrors most closely the orignal format. E.g :-

Set file foo.bar / att = RFM:STM
Set file foo.bar / att = RFM:STMCR
Set file foo.bar / att = RFM:STMLF

Unix is snakeoil
Ian Miller.
Honored Contributor

Re: The STREAM Record Format

Stream should be ok with CRLF has a record terminator. Do you know how long the longest record is ?
Can you type the file ?
Purely Personal Opinion

Re: The STREAM Record Format

Thanks, Antonio. You're right. DUMP sees the records correctly. I get the "Record Too Long" message from a Fortran program, in the read statement. Also, TYPE gives me the following:

%TYPE-F-WRITEERR, error writing SYS$OUTPUT:.;
-RMS-F-SYS, QIO system service request failed
-SYSTEM-F-EXQUOTA, process quota exceeded

But I still have to ask: How does VMS (or DUMP) know that the CRLF is being used as a terminator?

Uwe Zessin
Honored Contributor

Re: The STREAM Record Format

VMS knows it because the information is stored in the file's meta data (the file header).

$ write sys$output f$file_attributes ("t.txt","rfm")
Honored Contributor

Re: The STREAM Record Format

May be record size is really too long for your application.
Because your file is external (no VMS) may also missed some record attribute. You don't refer about this of your dir/full.
I guess you can declare CR with follow command:
You have to see how long is longest record in dir/full. In your fortran software, you must allocate a buffer for biggest record.
To avoid losting of type, before using fortran, try to read with type command. After you can see file with TYPE (without SYSTEM-F-EXQUOTA and ignoring what is displayed), you are able to read with fortran application.

Antonio Vigliotti
Antonio Maria Vigliotti
Hein van den Heuvel
Honored Contributor

Re: The STREAM Record Format

>> But how do I specify the exact terminator in use?

All of them, when found in the file.

>> I can't read the file because I get "Record too long",

That message should probably read "Record too long for use buffer". Some programs dynamically choose a record buffer size based on the minumum of a program provided value (512?) and the "MRS" (maximum record size) of the file and the "LRL" (longest recorded record). Files 'from the outside' sometimes miss this LRL. Just set a reasonably large value with SET FILE/ATTR=LRL=xxx, or try to CONVERT the file to get the real value. (hmmm... convert may need LRL=32767 just to be sure).


Re: The STREAM Record Format

You guys got everything right!

Steve -- I did get the file through ftp
Antonio -- The problem was solved when I changed the fortran program to RECL=3050
Hein -- I didn't know that STREAM meant that all and any of the terminators could be used. I guess I misread the manual.

Thanks again,