Program name

HP/ES 45
January 31, 2008 at 12:29:26
Specs: OpenVMS V7.3-2, 4/16GB
How do you return the current program name of a vms program? For instance., in unix it's $0. I'm writing a script that will be installed on different nodes with slightly different script names. But, I want this script to have the same code for all nodes.
Thanks.

See More: Program name

Report •


#1
February 1, 2008 at 02:44:55
I'm not a frequent UNIX-user so I have to make some guesses......

in Unix $ is used to translate variables.
$0 is the first variable and vill return the running image/file.

There are eight reserved parameters in VMS ( P1 - P8 ), but they are used to pass parameters into a commandfile.


example,

TEST.COM
$ SHOW SYMBOL P%


$ @TEST
P1 = ""
P2 = ""
P3 = ""
P4 = ""
P5 = ""
P6 = ""
P7 = ""
P8 = ""

$ @TEST hello 5 vms 123
P1 = "HELLO"
P2 = "5"
P3 = "VMS"
P4 = "123"
P5 = ""
P6 = ""
P7 = ""
P8 = ""

To get the name of the executing commandfile, you have to use a lexical function called F$ENVIRONMENT

$ file = f$environment("procedure")
$ show symbol file

regards,

Hakan Zanderau
HA-solutions


Report •

#2
February 1, 2008 at 02:49:30
Using the lexical f$environment outside a commandfile ( $-prompt ) will return the name of your terminal.

Hakan Zanderau
HA-solutions

$ HELP LEXICALS for more help


Report •

#3
February 1, 2008 at 12:01:55
Thanks, Hakan! I'm a Unix/Linux/IBM Mainframe guy on a crash course in VMS. Much apperciated!
Mike
Petro Heating Oil
IT Dept.

Report •

Related Solutions

#4
February 1, 2008 at 16:59:48
Mike,

You may want to take a look at some of my presentations on using lexical functions. One such presentation, "DCL Lexicals: OpenVMS Jujitsu", can be found at http://www.rlgsc.com/decus/usf95/in... .

There is also a series of columns that appeared on OpenVMS.org on logical names, an often related area when parameterizing scripts. Links to these columns appear on http://www.rlgsc.com/publications.html

- Bob Gezelter, http://www.rlgsc.com


Report •

#5
March 31, 2011 at 04:51:43
Thanks a lot Bob!

Michael Ledesma
System Administrator
Petro Heating Oil Svc's


Report •


Ask Question