Computing.Net > Forums > OpenVMS > Program name

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Program name

Reply to Message Icon

Name: amsedelm
Date: January 31, 2008 at 12:29:26 Pacific
OS: OpenVMS V7.3-2
CPU/Ram: 4/16GB
Product: HP/ES 45
Comment:

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.



Sponsored Link
Ads by Google

Response Number 1
Name: HakZan
Date: February 1, 2008 at 02:44:55 Pacific
Reply:

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


0

Response Number 2
Name: HakZan
Date: February 1, 2008 at 02:49:30 Pacific
Reply:

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


0

Response Number 3
Name: amsedelm
Date: February 1, 2008 at 12:01:55 Pacific
Reply:

Thanks, Hakan! I'm a Unix/Linux/IBM Mainframe guy on a crash course in VMS. Much apperciated!
Mike
Petro Heating Oil
IT Dept.


0

Response Number 4
Name: Bob Gezelter
Date: February 1, 2008 at 16:59:48 Pacific
Reply:

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


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


show device d equivalent setting date


Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: Program name

Auto login from vms/ucx to linux box www.computing.net/answers/openvms/auto-login-from-vmsucx-to-linux-box/86.html

Node name decnet www.computing.net/answers/openvms/node-name-decnet/155.html

Optical Disk Volume Name www.computing.net/answers/openvms/optical-disk-volume-name/449.html