Operating System - OpenVMS
1832757 Members
3030 Online
110045 Solutions
New Discussion

Can a logical be defined within another logical?

 
SOLVED
Go to solution
Kenneth Toler
Frequent Advisor

Can a logical be defined within another logical?

define/process logical1 "_dka100"
define/process logical2 "'logical1':[data]"

dir 'logical2'

deassign logical1
deassign logical2

Why does this not work?
15 REPLIES 15
Uwe Zessin
Honored Contributor
Solution

Re: Can a logical be defined within another logical?

It works after a few changes:

$ define logical1 _dkb0:
$ define logical2 logical1:[data]
$
$ directory logical2

Directory _DKB0:[DATA]

A.TMP;1

Total of 1 file.
$
.
Uwe Zessin
Honored Contributor

Re: Can a logical be defined within another logical?

While viewing your question again, it looks like you have confused logical names and symbols - here is an example using symbols:

$ SYMBOL1 = "_DKB0"
$ SYMBOL2 = "''SYMBOL1':[DATA]"
$ directory 'SYMBOL2'

Directory _DKB0:[DATA]

A.TMP;1

Total of 1 file.
$
.
Uwe Zessin
Honored Contributor

Re: Can a logical be defined within another logical?

Hm, one of the lines is hard to read in a proportional font. You can try a cut&paste into a local editor or view the following line and ignore the underscores - I hope it displays better:
$ SYMBOL2 = _"_'_'_SYMBOL1_'_:[DATA]_"_
.
Robert_Boyd
Respected Contributor

Re: Can a logical be defined within another logical?

Uwe,

I think your first example is more what Kenneth was looking for.

copying the original example, it should actually look like this:

$ define/process logical1 "_DKA100:"
$ define/process logical2 "LOGICAL1:[data]"

$ dir logical2:

$ deassign logical1
$ deassign logical2

Cheers,
Robert
Master you were right about 1 thing -- the negotiations were SHORT!
Uwe Zessin
Honored Contributor

Re: Can a logical be defined within another logical?

Robert,
my output was a real session log, that's why I used a different disk name.
.
Robert_Boyd
Respected Contributor

Re: Can a logical be defined within another logical?

Uwe,

You know you could have used this trick :-)

$ define _DKA100 /trans=conc sys$sysdevice:
$ define logical1 _dka100:
$ define logical2 logical1:[DATA]
$ dir logical2:

Directory _DKA100:[DATA]

JUNK.TMP;1

Total of 1 file.

$ deassign logical1
$ deassign logical2
$ deassign _DKA100

(actual commands on the system, except for the missing commands to create the directory and the file)


Master you were right about 1 thing -- the negotiations were SHORT!
John Gillings
Honored Contributor

Re: Can a logical be defined within another logical?

Kenneth,

Yes logical names can be nested multiple times. Translation will continue down to 10 nesting levels. For example, try:

$ DEFINE X X
$ SHOW LOGICAL X

There is a condition TOOMANYLNAM (see $ HELP/MESSAGE TOOMANYLNAM) which DCL used to issue for the above sequence, but in recent versions it's considered "success".

The limit of 10 is hardcoded - and "should be enough for anyone" :-)

As others have pointed out, your command is failing because you're confusing symbols and logical names. In this context, symbols need to be explicitly translated by enclosing them in quotes. Logical names will be automatically translated.

BTW, for future reference, describing something as "not working" isn't very helpful. Please post the exact command, exact error message, and what you're expecting instead of the error.
A crucible of informative mistakes
Bojan Nemec
Honored Contributor

Re: Can a logical be defined within another logical?

Kenneth,

Maybe this was what you search:

define/process logical1 "_dka100"
define/process logical2 "''f$trnlnm("logical1")':[data]"

Bojan
Joseph Huber_1
Honored Contributor

Re: Can a logical be defined within another logical?

Although it is correct to define
logical2 'f$trnlnm("LOGICAL1")'[dir]
it has the disadvantage of the need to redefine logica2 when logical1 is changing.
The beauty of defining a logical containing other logicals is the fact that all containing logicals are translated at the time when it is used; so only the "root" logicals needs redefinition in case.
http://www.mpp.mpg.de/~huber
Bojan Nemec
Honored Contributor

Re: Can a logical be defined within another logical?

Joseph,

You are right. But sometimes this is not possible. With sometimes I mean rooted logical names which have the physical name restriction.

Bojan
Joseph Huber_1
Honored Contributor

Re: Can a logical be defined within another logical?

Bojan:
Yes, rooted logicals are a problem, but it is a misunderstanding to assume the root ALWAYS must be a physical device. Only if the TERMINAL attribute is needed for some reason.
Example: this definition of WWW works well:

$ sh log/full www
"WWW" [super] = "DISK$WWW:[WWW.]" [concealed] (LNM$SYSTEM_TABLE)
$ sh log/full disk$www
"DISK$WWW" [exec] = "AVMP01$DKB100:" [concealed,terminal] (LNM$SYSTEM_TABLE)

So I can mount the volume WWW on a different drive without redefining the concealed logical WWW.
http://www.mpp.mpg.de/~huber
Bojan Nemec
Honored Contributor

Re: Can a logical be defined within another logical?

Joseph,

It works but it is unsupported! Please see this thread:

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=859052

Bojan
Peter Quodling
Trusted Contributor

Re: Can a logical be defined within another logical?

I find it hard to believe that rooted logicals would cease to work/be supported. They used to be an integral part of the versatility of the configuration of the Star:: and VMSint:: clusters in Spitbrook Rd.

q
Leave the Money on the Fridge.
Joseph Huber_1
Honored Contributor

Re: Can a logical be defined within another logical?

I hope this case is handled as "customers rely on this feature, so will not break it", even if documented otherwise!
http://www.mpp.mpg.de/~huber
Jan van den Ende
Honored Contributor

Re: Can a logical be defined within another logical?

Kenneth,

from your Forum Profile:


I have assigned points to 15 of 35 responses to my questions.


Maybe you can find some time to do some assigning?

Mind, I do NOT say you necessarily need to give lots of points. It is fully up to _YOU_ to decide how many. If you consider an answer is not deserving any points, you can also assign 0 ( = zero ) points, and then that answer will no longer be counted as unassigned.
Consider, that every poster took at least the trouble of posting for you!

To easily find your streams with unassigned points, click your own name somewhere.
This will bring up your profile.
Near the bottom of that page, under the caption â My Question(s)â you will find â questions or topics with unassigned points â Clicking that will give all, and only, your questions that still have unassigned postings.

Thanks on behalf of your Forum colleagues.

PS. â nothing personal in this. I try to post it to everyone with this kind of assignment ratio in this forum. If you have received a posting like this before â please do not take offence â none is intended!

Proost.

Have one on me.

Jan
Don't rust yours pelled jacker to fine doll missed aches.