Computing.Net > Forums > OpenVMS > Node Name

Node Name

Reply to Message Icon

Original Message
Name: amsedelm
Date: January 21, 2008 at 12:04:15 Pacific
Subject: Node Name
OS: OpenVMS V7.3-2
CPU/Ram: 4/16GB
Model/Manufacturer: HP/ES 45
Comment:

How would you extract just the NODE name from the command sh sys ? I'm kind of stumped.
Thanks


Report Offensive Message For Removal

Response Number 1
Name: HakZan
Date: January 21, 2008 at 23:34:42 Pacific
Subject: Node Name
Reply: (edit)

I'm not sure what you are trying to do.....

But if you only want to get the nodename for the node you are logged into.

$ node = f$getsyi("nodename")

or

$ write sys$output f$getsyi("nodename")


To give a direct answer to your question.

$ pipe show system/noproc | -
( inquire str ; -
nodename = f$element(4," ",str) ; -
define/job node &nodename )
$ node = f$trnlnm("node")

regards,

Hakan Zanderau
HA-solutions

Please supply more information when asking for help.....


Report Offensive Follow Up For Removal

Response Number 2
Name: amsedelm
Date: January 22, 2008 at 05:46:47 Pacific
Subject: Node Name
Reply: (edit)

Thanks, Haka! That's just what I needed.
Mike Ledesma
Petro Heating Oil


Report Offensive Follow Up For Removal

Response Number 3
Name: Bob Gezelter
Date: February 2, 2008 at 06:13:50 Pacific
Subject: Node Name
Reply: (edit)

Mike,

Actually, a far safer way of getting the nodename from a script is to use the F$GETSYI lexical function. For example:

$ WRITE SYS$OUTPUT F$GETSYI("NODENAME")

Almost all of the information that is displayed by the various show commands is available from one DCL lexical function or another. Of particular interest are the F$GETxxxI series (F$GETSYI, F$GETDVI, and F$GETJPI), and various others include F$ENVIRONMENT.

Using the lexicals is a FAR superior approach to getting information than parsing the output of the SHOW commands.

In fact, one can write implementations of most of the SHOW commands using the lexical functions to get information. See "DCL Lexicals: OpenVMS Jujitsu", slides available at http://www.rlgsc.com/decus/usf95/in... , for some comments.

- Bob Gezelter, CSA, CSE, http://www.rlgsc.com
Flushing, New York


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Node Name

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software