Computing.Net > Forums > OpenVMS > Program name

Program name

Reply to Message Icon

Original Message
Name: amsedelm
Date: January 31, 2008 at 12:29:26 Pacific
Subject: Program name
OS: OpenVMS V7.3-2
CPU/Ram: 4/16GB
Model/Manufacturer: 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.


Report Offensive Message For Removal

Response Number 1
Name: HakZan
Date: February 1, 2008 at 02:44:55 Pacific
Subject: Program name
Reply: (edit)

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 Offensive Follow Up For Removal

Response Number 2
Name: HakZan
Date: February 1, 2008 at 02:49:30 Pacific
Subject: Program name
Reply: (edit)

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 Offensive Follow Up For Removal

Response Number 3
Name: amsedelm
Date: February 1, 2008 at 12:01:55 Pacific
Subject: Program name
Reply: (edit)

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 Offensive Follow Up For Removal

Response Number 4
Name: Bob Gezelter
Date: February 1, 2008 at 16:59:48 Pacific
Subject: Program name
Reply: (edit)

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 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: Program name

Comments:

 


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