[an error occurred while processing this directive]

HP OpenVMS Systems

ask the wizard
Content starts here

updating RMS files with fixed length records?

» close window

The Question is:

 
How to edit Fixed Length Record files. I want to replace a 6 characters date
filed within a fixed length record file with different 6 characters. EDT
fails because of record size and TPU & TECO editors seem to change file
format. Appreciate your help....t
hanks
 


The Answer is :

 
  PATCH/ABSOLUTE is the Wizard's favorite OpenVMS VAX text editor, and it
  would certainly be applicable here.
 
  You could use CONVERT/FDL to alter the file format from the current
  fixed-length format into a format more directly suited for editing (if
  the editor cannot correctly handle your current file format) and then
  using CONVERT again to convert back into the original format.  The tool
  ANALYZE/RMS/FDL can be used to generate FDL files from the fixed-length
  source file, as part of this conversion process.  An example:
 
    $ ANALYZE/RMS/FDL/OUT=test.FDL test.DAT
    $ EDIT test.DAT
    $ CONVERT/FDL=test.FDL [ /TRUNCATE/PAD ] test.DAT test.DAT
 
  Alternatives include using a program to open the existing file as input
  and a new (and similarly-organized) output file, loop through the input
  file reading records and rewriting them to the output file -- with any
  edits applied as required.  An example:
 
    $ OPEN/READ/WRITE...
    $loop: READ...
    $ IF not_the_right_record THEN GOTO loop
    $ record[x,y] := new_date...
    $ WRITE/UPDATE...
    $ CLOSE...
 

answer written or last revised on ( 27-AUG-1998 )

» close window