- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: newpie question: reassign a symbol
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-28-2008 08:13 AM
тАО05-28-2008 08:13 AM
newpie question: reassign a symbol
I have a newpie question: how to reassign/overwrite global symbol definition. For example, I have a script like:
$! reassign cmd_dir and cfg_dir
$ cmd_dir == "DEV_SRC2:[YLIU.BUILD.ESX.COM]"
$ cfg_dir == "DEV_SRC2:[YLIU.BUILD.ESX.CFG]"
After I execute this script, I notice that cmd_dir and cfg_dir still show the old value as if my assignments didn't happen.
Can you give me some pointers?
YE LIU
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-28-2008 08:32 AM
тАО05-28-2008 08:32 AM
Re: newpie question: reassign a symbol
A symbol can be local
cmd := $ sys$login:myprog.exe
or global
cmd :== $ sys$login:myprog.exe
How is your symbol cmg_dir defined before the procedure and inside your procedure ?
Can you post the result of
$ sh symb /local cmd_dir
$ sh symb/glob cmg_dir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-28-2008 09:39 AM
тАО05-28-2008 09:39 AM
Re: newpie question: reassign a symbol
Two things to be aware of:
1. All symbols are process specific, i.e. a symbol created in one process isn't visible by DCL in another process. It may appear that symbols are visible to subprocesses, but that is only because by default, symbols are copied to the new subprocess process when the SPAWN command is used.
2. Every "level" of DCL (as shown by f$environment("depth") has its own local symbols. @ or call in a command procedure creates a new level. What DCL sees is the highest level local symbol that matches, and if no local symbols exist, then the global symbol that matches will be used.
Can you show the output of
$ show symbol cmd_dir
Before you execute the command procedure (script)?
If the value is separated from the symbol name by a single equal sign " = ", then it is a local symbol, and it has a higher precedence than a global symbol with the name name.
Here's an example:
$ sho symbol top
TOP == "MONITOR PROC/TOPCPU"
$ top="monitor process/topcpu" ! local symbol
$ sho sym top
TOP = "monitor process/topcpu"
$ ! using Brian Schenkenberger's SYMBOL program so we can see all instances of the "TOP" symbol
$ symbol/show top
[-] TOP == "MONITOR PROC/TOPCPU"
[0] TOP = "monitor process/topcpu"
$ top=="Monitor Proc/TOPCPU" ! redefinition of global symbol
$ sho sym top
TOP = "monitor process/topcpu"
$ symbol/show top
[-] TOP == "Monitor Proc/TOPCPU"
[0] TOP = "monitor process/topcpu"
$
Jon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-28-2008 09:41 AM
тАО05-28-2008 09:41 AM
Re: newpie question: reassign a symbol
A common DCL mistake is to use a == global symbol assignment when a = local symbol assignment will do.
You should use local symbols as variables in a DCL .COMmand procedure. They will even be passed INTO a nested @procedure call.
Generally you only need to use global symbols for two cases:
* When you want to RETURN a value from a nested @procedure to the calling procedure.
* When defining a command macro symbol in your LOGIN.COM or a similar procedure that you will be using at the interactive DCL prompt.
(When defining command macro symbols in a procedure for use in that procedure a local symbol will do.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-28-2008 11:02 AM
тАО05-28-2008 11:02 AM
Re: newpie question: reassign a symbol
Something akin to the following (untested) DCL code might be used here:
$ dev = f$parse("DEV_SRC2",,,"DEVICE"-
"NO_CONCEAL")
$ DEFINE/TRAN=(CONC,TERM)/NOLOG -
YLIU_BUILD_ROOT -
'dev'[YLIU.BUILD.ESX.]
$ DIRECTORY YLIU_BUILD_ROOT:[COM]
$ DIRECTORY YLIU_BUILD_ROOT:[CFG]
This gets the device name behind the DEV_SRC2 logical name, and sets up your own concealed terminal rooted logical name -- basically a construct that looks like a device, but that incorporates (and hides) a directory -- and then issues a couple of DIRECTORY commands to demonstrate the use of the logical name.
Depending on exactly how the existing DEV_SRC2 logical name is defined, a tweak or two to the DCL might be needed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-28-2008 12:40 PM
тАО05-28-2008 12:40 PM
Re: newpie question: reassign a symbol
YE LIU