HP OpenVMS Systems

ask the wizard
Content starts here

Record Length and File Format?

» close window

The Question is:

i have a stream_lf file downloaded from tape from a unix box. i can't read it
 because the length of the record ='s the total lenght of the file.  how can i
 read it?  rms has a 65K buffer limit...any way around this?  do i need to do
 physical qio's to 'deb
lock' the file?

The Answer is :

  Without some idea of the file contents, this may simply involve
  resetting the file attributes to, say, stream LF, via the DCL
  command SET FILE/ATTRIBUTES.  This could also involve raw access
  to the contents of the file, or potentially a CONVERT/FDL pass.
  If the file has the attribute stream_lf and there is no terminator
  ('lf') in the first 32K bytes, then RMS does not view the file as
  being valid.
  If this is the case, the workaround is to change the file attributes
  to more closely match the actual contents of the file, probably with
  a file attribute setting that has no overhead and no meta data.  One
  suggestion would be to mark the file as fixed length record file with
  an EVEN (and it must be even) record size, such as 512 or 8192 bytes:
    	$SET FILE /ATT=(RFM=FIX,LRL=512,MRS=512)
  This will allow any program to read it, one a record at a time.  An
  alternative is to mark is as UNDEFINED.  Here RMS simply returns the
  number of bytes requested by the program.  (RAB$W_USZ contains the
  record buffer size requested by the application, though this value
  be be hidden in an RTL layer.)
  Using SYS$QIO or SYS$READ is typically not needed, as the operation
  approximates a fixed-length record $GET operation.

answer written or last revised on ( 16-NOV-2000 )

» close window