From:	CRDGW2::CRDGW2::MRGATE::"SMTP::CRVAX.SRI.COM::RELAY-INFO-VAX" 13-DEC-1989 08:51
To:	MRGATE::"ARISIA::EVERHART"
Subj:	DECnet Node number -> DECnet Node Name

Received: From MATRIX.GSFC.NASA.GOV by CRVAX.SRI.COM with TCP; Wed, 13 DEC 89 05:10:23 PDT
Date:    Wed, 13 Dec 1989 8:09:57 EST
From: FASTEDDY@MATRIX.GSFC.NASA.GOV   (John McMahon - NASA GSFC ADFTO - 301-286-2045)
Message-Id: <891213080957.212006e4@MATRIX.GSFC.NASA.GOV>
Subject: DECnet Node number -> DECnet Node Name
To: info-vax@sri.com
X-Vmsmail-To: SMTP%"info-vax@sri.com"

After a little experimentation, I discovered that the DECnet permanent database
file that contains nodenames (usually SYS$SYSTEM:NETNODE_REMOTE.DAT) is keyed
on the nodename, and the numeric address.

Index = 0	Key = Numeric Address (Integer*2)
Index = 1	Key = Name (Character*6)

+-----------------+---------------+----------------+
! Numeric Address ! Node Name     ! Other Stuff... !
! (Integer*2)     ! (Character*6) !                !
+-----------------+---------------+----------------+

The following DCL routines demonstrate how you can convert from nodename to
number and back again.

Nodename to Number Routine.  KEY is the nodename (without colons), Node_Number
is the resulting nodenumber.  Note: SYS$SYSTEM:NETNODE_REMOTE.DAT may be
protected on your system.

$ Open/Read/Share Input_File Sys$System:Netnode_Remote.Dat
$ Read/Index=1/Key="''Key'" Input_File Dataline
$ Close Input_File
$ Node_Number = F$CVUI(0,16,Dataline)

Number to Nodename Routine.  Node_Number is the node number.  Node_Name is the
resulting nodename.

$ Open/Read/Share Input_File Sys$System:Netnode_Remote.Dat
$ Key = ""
$ Key[0,16] = Node_Number
$ Read/Index=0/Key="''Key'" Input_File Dataline
$ Close Input_File
$ Node_Name = F$Extract(2,6,Dataline)
$ Write Sys$Output       "Node Name:          ",Node_Name
$ Xit:
$ If F$Trnlnm("Input_File") .nes. "" Then Close Input_File

Have fun...

/-------------------------------------+----------------------------------------\
| John "Fast Eddie" McMahon           |    Span: SDCDCL::FASTEDDY (Node 6.9)   |
| Advanced Data Flow Technology Office|Internet: FASTEDDY@DFTNIC.GSFC.NASA.GOV |
| Code 630.4 - Building 28/W255       |  Bitnet: FASTEDDY@DFTBIT               |
| NASA Goddard Space Flight Center    |GSFCmail: JMCMAHON                      |
| Greenbelt, Maryland 20771           |   Phone: 301-286-2045 (FTS: 888-2045)  |
+-------------------------------------+----------------------------------------+
|X.400 Telenet: (C=USA,ADMD=TELEMAIL,PRMD=GSFC,O=GSFCMAIL,S=MCMAHON,G=JOHN,I=J)|
|GSFC XNS (3+Mail):               {FASTEDDY@DFTNIC.GSFC.NASA.GOV}:INTERNET:GSFC|
+------------------------------------------------------------------------------+
| "Living a 9600 Baud Lifestyle in a 1200 Baud World" - R.A.J.                 |
\------------------------------------------------------------------------------/

