Showing results for 
Search instead for 
Did you mean: 

RMS file


RMS file


 I need to Create a rms indexed file of the format:


Name table      30 chars

Logical name   30 chars

Value               255 chars


With the index consisting of name table + logical name


Parse the output of a show logical/table=*  so that  we can build up the index file. This is required to check the difference of logiacl asignment after reboot

Mrityunjoy Kundu -AST (TCS)
Honored Contributor

Re: RMS file

Put this in a file called LNMFILE.FDL


        SOURCE                  VMS
        NAME                    LNMFILE
        ORGANIZATION            indexed

        FORMAT                  fixed
        SIZE                    315

        CHANGES                 no
        DUPLICATES              no
        PROLOG                  3
        SEG0_LENGTH             60
        SEG0_POSITION           0
        TYPE                    string




See this page on Creating and Populating files (and subsequent pages)




Re: RMS file

Hi Phil,


How to incorporate this in a DCL command procedure.  I need to create a command procedure which will use this index rms file to record all logicals and compare this before and after shutdown.





Mrityunjoy Kundu -AST (TCS)
Brad McCusker
Respected Contributor

Re: RMS file

>How to incorporate this in a DCL command procedure


How about you have your company (or your company's client) hire professional's that know how to write DCL and understand basic VMS concepts?


Our services include tools that monitor changes to the logical name tables, including changes across reboots, and I can tell you that it is more complicated than you're design indicates you understand.


Brad McCusker

Software Concepts International

Brad McCusker
Software Concepts International
Hein van den Heuvel
Honored Contributor

Re: RMS file

Hmmm, I'm largely with Brad.

The question you ask suggests that you are currently not ready to tackle the requirement.

This is too easy to get wrong and then what do you have.

Also, indexed files are unlikely to be the right solution.

Neither from a functional point of view, and certainly not from a performance point of view.

They just look like a handy sorting tool, but that's deceiving.

Using SORT probably leads to a better solution.

Using PERL with its build-in sort and superior parsing is probably better than using DCL.


Still, you mentioned the magic word 'RMS' so I'll give you a starting point.

It is far from complete, but shows the basics of creating a file and formatting records,

For grins, run with SET VERI and watch how slow the first $WRITE is (Using DCL is part of the blame).

SORT would write the whole file in that time.


Anyway, see below for some code..


Hope this helps some,

Hein RMS van den Heuvel



$ type
$! If a SHOW LOG output is provided, then just use it. If not, create.
$ logicals_indexed = "logicals_indexed.tmp"
$ logicals_listing = "logicals_listing.tmp"
$if p1.eqs.""  ! File provided, or generate one?
$  show log */output='logicals_listing'
$  logicals_listing = p1

$ tab=""
$ tab[0,8] = 9 ! TAB
$ indexed_record = ""
$ close/nolog logicals
$ close/nolog logicals
$ open/read/erro=oops logicals 'p1'
$ create/fdl="file; org ind; area 0; buck 16; key 0; seg0_l 60" 'logicals_indexed'
$ open/write/erro=ooop indexed 'logicals_indexed'
$ read/erro=oops/end=done logicals record
$ first_char = f$extr(0,1,record)
$ len = f$len(record)
$ if len.eq.0 then goto loop
$ if ! Search list addition?
$ then
$   indexed_record = indexed_record + f$extr(2,999,record)
$   goto loop
$ endif
$ if indexed_record.nes.""  ! Anything to write out?
$ then
$   indexed_record = f$extract(0,60+255,indexed_record)
$   write/error=oops/symb indexed indexed_record
$   indexed_record = ""
$ endif
$ if first_char.eqs."("   ! Fresh table name ?
$ then
$   table = record - "(" - ")"
$   goto loop
$ endif
$ if first_char.eqs." "  ! Legit new symbol name?
$   then indexed_record = f$fao ( "!30AS!30AS!AS", -
       f$elem(0,"=",record) - "  """ - """ ", table, -
$ endif
$ goto loop
$ indexed_record = f$extract(0,60+255,indexed_record)
$ write/error=oops/symb indexed indexed_record ! last one
$ s = $status
$ close indexed
$ close logicals
$ exit 's'