Wednesday, September 20, 2017

Utilities to alter Files-11 attributes on VMS and RSX


  Files on most systems these days are just a bag of bytes. Just bytes in 
a row, maybe with an occasional Carriage Return and/or Line Feed character
thrown in to provide some sort of notion of records or readability. 

  That's not the way RSX and VMS did things. Bytes are stored in a file, 
sure enough, but files have metadata associated with them (and often extra
bytes in the file as well) to support the concept of records. Several
types of records are supported - undefined, variable length, fixed size,
and like that. Carriage control for records isn't totally left to embedded
CR/LFs - it too is an attribute, supporting None, Fortran style, printer
control style, or implied (if you are displaying the file, a CR/LF gets
automatically displayed on output). VMS/RSX also have varying levels of
support for files with different sorts of random and keyed access built in
- sequential, relative and indexed. Interestingly enough, the system
definitions indicate that there was thought of adding a Hashed file type,
but it was never developed. 

  One thing is pretty certain - when a file gets transferred to/from a VMS 
or RSX system and one of these other types of systems, something is going 
to get hurt. Record lengths, types and carriage control are almost certain 
to go wrong or go away in the process.

  I wrote the ICONV utility back in 1988 to deal with this on VMS. Since 
then, VMS has added a SET FILE /ATTRIBUTE command to deal with these 
problems, so I  only occasionally have to use ICONV, when working on older 
versions of VMS. These days, I work a lot more on RSX than VMS, so I
recently coded up a version of ICONV for RSX to help fix transfer damage
there. 


iconv.mac

  To build the RSX version of ICONV
>mac iconv=iconv
>tkb
TKB>iconv=iconv
TKB>/
Enter Options:
TASK=...ICV
//

  To use...
>INS ICONV
or
run iconv
ICV>file /sw:val /sw:val

 Switches are:
 /HE prints this help text
 /LI prints the file attributes
 /VE prints out program version
 /ORG:val values are SEQUENTIAL, RELATIVE, INDEXED, or HASHED
 /REC:val values are UNDEFINED,FIXED, VARIABLE, SEQUENCED or STREAM
 /CC:val  values are NONE, FORTRAN, CARRIAGE_RETURN or PRINT
 /BLK or -/BLK - sets or clears the "records can't span
    blocks" flag
 /MRS:val value is decimal size of maximum record size
 /RSZ:val value is decimal size of records

  Like I said above, ICONV for VMS is useful only on older VMS systems, 
but, waddahell, I'm including it here in case someone needs to adjust 
attributes on an old VAX somewhere. It's also a middlin' good example of 
how to use TPARSE, and how to programmatically change file attributes.

iconv.mar

iconv.hlp

  To build...

$ mac iconv
$ link iconv
$ iconv :== $diskx:[diry]iconv.exe

then,

$ iconv z.tmp/type=fixed  etc...

or $ iconv
or $ run iconv
Yes?>

to be prompted for the command line.

  If you want to use the built in help in ICONV, build the help library

$ libr/create/help iconv.hlb
$ libr/insert iconv.hlb iconv.hlp


 Then define a logical ICONV_HELP to point to the location of the HLB file

$ def/system iconv_help dua0:[somwdir]

 The help info is invoked by, logically enough the help command

$ iconv help                                         

ICONV

    This is ICONV, a program for changing the attributes of a file.
    Use at your own risk - this is serious business.

    Format:


      ICONV input-file-spec



  Additional information available:

  Parameters Command_Qualifiers
  /TYPE      /ORG       /CC        /SPAN      /RSIZE     /VFCSIZE   
/MAXREC
  /CREDATE   /BAKDATE   /REVDATE   /EXPDATE

ICONV Subtopic?

  Regarding both of these versions of ICONV...you are assumed to know what 
you're doing...either one of them could be used to scramble up a file's 
attributes pretty thoroughly...so be careful...

1 comment:

Comments?