[Info-vax] Streaming a File on OpenVMS with Caché

cmexec at gmail.com cmexec at gmail.com
Thu Jan 15 13:40:23 EST 2015


On Thursday, January 15, 2015 at 9:14:54 AM UTC-5, Mack Altman III wrote:

> At this moment, I have a BIN file with the following DIR/FULL. In doing a DUMP/REC, each record is terminated at 512 bytes. When reading the file, the CR,LF also terminates the record.

> Record format:      Fixed length 512 byte records

This looks like the source of your problems.  When the other computer is putting
CR,LF between records it is a text file.  VMS FTP software created fixed length 512
byte records when the file is transmitted as in binary mode.

For some clients it doesn't matter because the file system hasn't the foggiest idea
what a record is and the I/O code just looks for CR,LF.  This leads many users to
the INCORRECT belief that "binary always works".  VMS, however, does know
what a record is and does not look for CR,LF unless it has been told to expect
it.  According to the FTP standard, someone lied to the VMS software.  They
transferred a text file in binary mode, which means FTP thinks there are no "records",
so the VMS FTP software stores the data as 512 bytes "records" in which some of
the data bytes happen to be CR,LF.

VMS software reading this does not parse out records separated by CR,LF, it
parses out 512 bytes.

In the future, the file needs to be transferred in ASCII mode.  FTP will then send
the data as records separated by CR,LF because that is the FTP standard for ASCII.
The VMS FTP software will see the data, throw out the CR,LF and store the text as
variable length records, which will look like the original file to the software that
uses it.

As for files that have already been transferred, you can manually correct the lie
by using the commands "set file/attributes=rmf:stm" on each file.  VMS will not
change anything inside the data when you do that, but it will then know that the
file consists of variable length records separated by CR,LF and the software
reading the file will see that it expects.



More information about the Info-vax mailing list