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.
Thanks

See More: Node Name

Report •


#1
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")

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 •

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

Report •

#3
February 2, 2008 at 06:13:50
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 •

Related Solutions

#4
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