From:	CRDGW2::CRDGW2::MRGATE::"SMTP::CRVAX.SRI.COM::RELAY-INFO-VAX" 13-DEC-1989 11:39
To:	MRGATE::"ARISIA::EVERHART"
Subj:	Re: How to convert Node number to name

Received: From CORNELLC.CIT.CORNELL.EDU by CRVAX.SRI.COM with TCP; Tue, 12 DEC 89 23:03:58 PDT
Received: from UALR.BITNET by CORNELLC.cit.cornell.edu (IBM VM SMTP R1.2.1MX) with BSMTP id 3498; Wed, 13 Dec 89 02:01:57 EST
Date: Wed, 13 Dec 89 01:00 CST
From: Dale Miller <DOMILLER%UALR.BITNET@CORNELLC.cit.cornell.edu>
Subject: Re: How to convert Node number to name
To: info-vax@sri.com
Message-Id: <0D33216E3F1F2004F6@UALR.BITNET>
X-Envelope-To: info-vax@sri.com
X-Vms-To: IN%"info-vax@sri.com"

Leichter-Jerry@CS.YALE.EDU writes:
>       What is the best way to get a node name for a given node number from a
>       compiled language (C, FORTRAN, PASCAL, or whatever).
>
>       For example, given node number 47.161, I want to get the node name
>       (say) "MYVAX".
>

Well, not being one to play by the rules, I did an
ANALYZE/RMS/FDL SYS$SYSTEM:NETNODE_REMOTE.DAT.  It seems that it is an indexed
file with two keys, a 16-bit binary and a 6-character string.  Armed with this
information, I hacked the following program.  Note complete lack of
documentation, error-checking, clean exit, etc.  But it DOES get me a node name.
        Dale


        character*128 rec
        integer area,node
        integer*2 nodenum

        open(unit=1,file='sys$system:netnode_remote.dat',
        1   readonly,shared,status='old',access='keyed',
        2   form='formatted')

 1001   format(q,a)

 0010   write(*,*)'Input area'
        read*,area
        write(*,*)'Input node'
        read*,node
        nodenum = area*1024 + node
        read(unit=1,key=nodenum,fmt=1001)l,rec(1:l)
        write(*,*)'Node name is '//rec(3:8)
        go to 10
        end
--------------------------------------------------------------------------
| Dale O. Miller                        | #   #  ###  #     ####         |
| University of Arkansas at Little Rock | #   # #   # #     #   #        |
| 2801 S. University                    | #   # ##### #     ####         |
| Little Rock, AR  72204-1099  USA      | #   # #   # #     #  #         |
| (501)569-8714                         |  ###  #   # ##### #   #        |
| DOMILLER@UALR.BITNET                  | Disclaimer: This does not      |
| 92-20-28 W,34-43-30 N.ICBMNET         | say what I say it doesn't say. |
--------------------------------------------------------------------------

