- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: Simply variable problem
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
тАО03-14-2007 11:42 PM
тАО03-14-2007 11:42 PM
If I define a logical like this, which concats two parameters
define test 'P1''P2'
how do I then access test to get the contents?
for example to move a file of that combined name
rename [here]test [there]test
Like in unix you would prefix with a $.
Thanks,
Martin
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-14-2007 11:52 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-14-2007 11:59 PM
тАО03-14-2007 11:59 PM
Re: Simply variable problem
The phrasing in your post is somewhat unclear to me. Some possible interpretations:
Assume the following:
P1 = "A"
P2 = "B"
$ DEFINE TEST 'P1''P2' yields "AB" as the value of TEST
$ DEFINE TEST 'P1','P2' yields two values (accessible using F$TRNLNM with the index parameter) of "A" and "B" respectively. The SHOW LOGICAL command will show the value as "A","B"
The syntax for concatenation is A+B (or A,B) in the COPY command. To build a command to iterate down the contents of the logical name TEST, you would start with a null string and then concatenate the values in TEST one at a time with the appropriate punctuation. Then use the resulting string as the source parameter of the COPY command.
The above presumes that I have interpreted the posting correctly. If I have not, please let me know.
- Bob Gezelter, http://www.rlgsc.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-15-2007 12:09 AM
тАО03-15-2007 12:09 AM
Re: Simply variable problem
You can use this command to execute a rename:
$ define test 'p1','p2' !define logical name
$io1=f$trnlnm("test",,0) !Obtain first value
$io2=f$trnlnm("test",,1) !Obtain second value
$rename [here]'io1' [there]'io2'
(Remember that rename only works on the same physical disk)
Saludos.
Daniel.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-15-2007 12:17 AM
тАО03-15-2007 12:17 AM
Re: Simply variable problem
$ rename [here]'f$trnlnm("test") [there]
Hope that helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-15-2007 12:27 AM
тАО03-15-2007 12:27 AM
Re: Simply variable problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-15-2007 12:39 AM
тАО03-15-2007 12:39 AM
Re: Simply variable problem
$ p1 = "ABC"
$ p2 = ".DAT"
$ define test 'P1''P2'
$ sho log test
"TEST" = "ABC.DAT" (LNM$PROCESS_TABLE)
$ cre/dir disk$jscratch:[here]
$ cre/dir disk$jscratch:[there]
$ set def disk$jscratch:[here]
$ cre test
Exit ! Control Z
$ dir/siz=all/date/wid=(file:38,size=7)
Directory DISK$JSCRATCH:[HERE]
ABC.DAT;1 0/0 15-MAR-2007 08:20:25.17
Total of 1 file, 0/0 blocks.
Appears to have done what you want, but that's not the whole story.
$ ren [here]test [there]test/log
%RENAME-E-SEARCHFAIL, error searching for DISK$JSCRATCH:[HERE]TEST.;
-RMS-E-FNF, file not found
Here filename parsing is confused because of part of the string looks like the directory portion of a file spec.
You probably want to use DCL symbols instead of a logical name.
$ test := 'p1''p2'
$ sho symbol test ! symbols are more like unix environment variables
TEST = "ABC.DAT"
$ ren [here]'test' [there]'test'/log
%RENAME-I-RENAMED, DISK$JSCRATCH:[HERE]ABC.DAT;1 renamed to DISK$JSCRATCH:[THERE]ABC.DAT;1
$
If you have a logical name and you want to convert to a DCL symbol, user F$TRNLNM (see help lexical f$trnlnm)
Other differences between rename and mv. Rename can only rename to the same device. If there is the possibility that [here] and [there] are on different devices, you will need to use something like backup /delete.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-15-2007 12:49 AM
тАО03-15-2007 12:49 AM
Re: Simply variable problem
I considered posting the section here, but it's about a dozen paragraphs, excluding the sections on arguments and argument lists and other such that follow.
The FAQ is available at:
http://www.hoffmanlabs.com/vmsfaq/
See the section "DCL Details"
Stephen Hoffman
HoffmanLabs