1820539 Members
3785 Online
109626 Solutions
New Discussion

Re: RMS file

 
mrityunjoy
Advisor

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)
4 REPLIES 4
Phil.Howell
Honored Contributor

Re: RMS file

Put this in a file called LNMFILE.FDL

 

SYSTEM
        SOURCE                  VMS
FILE
        NAME                    LNMFILE
        ORGANIZATION            indexed

RECORD
        FORMAT                  fixed
        SIZE                    315

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

 

$ CREATE/FDL=LNMFILE.FDL LNMFILE.DAT

 

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

http://h71000.www7.hp.com/doc/731final/4506/4506pro_010.html#bottom_010

 

Phil

mrityunjoy
Advisor

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

www.sciinc.com

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

Attunity

 

$ type logicals.com
$! 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?
$then
$  show log */output='logicals_listing'
$else
$  logicals_listing = p1
$endif

$ 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'
$
$loop:
$ 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 first_char.eqs.tab ! 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, -
       f$elem(1,"=",record))
$ endif
$ goto loop
$
$done:
$
$ indexed_record = f$extract(0,60+255,indexed_record)
$ write/error=oops/symb indexed indexed_record ! last one
$oops:
$ s = $status
$ close indexed
$ close logicals
$ exit 's'