Node Name

HP/ES 45
January 21, 2008 at 12:04:15
Specs: OpenVMS V7.3-2, 4/16GB
How would you extract just the NODE name from the command sh sys ? I'm kind of stumped.

See More: Node Name

Report •

January 21, 2008 at 23:34:42
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")


$ 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")


Hakan Zanderau

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

Report •

January 22, 2008 at 05:46:47
Thanks, Haka! That's just what I needed.
Mike Ledesma
Petro Heating Oil

Report •

February 2, 2008 at 06:13:50

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


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 , for some comments.

- Bob Gezelter, CSA, CSE,
Flushing, New York

Report •

Related Solutions

February 16, 2011 at 10:50:38
Thanks, Bob. BTW, I'm from East Elmhurst, NY.

Michael Ledesma
System Administrator
Petro Heating Oil Svc's

Report •

Ask Question