1753943 Members
8775 Online
108811 Solutions
New Discussion юеВ

weird logical?

 
SOLVED
Go to solution
Willem Grooters
Honored Contributor

weird logical?

Has anyone seen this behaviour before (VMS 7.3-1):

BPS2004A> sho log x
%SHOW-S-NOTRAN, no translation for logical name X
BPS2004A> def x 1
BPS2004A> sho log x
"X" = "1" (LNM$PROCESS_TABLE)
BPS2004A> def x 'f$trnlnm("x")'
%DCL-I-SUPERSEDE, previous value of X has been superseded
BPS2004A> sho log x
"X" = "1" (LNM$PROCESS_TABLE)
BPS2004A> def x "x"
%DCL-I-SUPERSEDE, previous value of X has been superseded
BPS2004A> sho log x
"X" = "x" (LNM$PROCESS_TABLE)
1 "X" = "x" (LNM$PROCESS_TABLE)
2 "X" = "x" (LNM$PROCESS_TABLE)
3 "X" = "x" (LNM$PROCESS_TABLE)
4 "X" = "x" (LNM$PROCESS_TABLE)
5 "X" = "x" (LNM$PROCESS_TABLE)
6 "X" = "x" (LNM$PROCESS_TABLE)
7 "X" = "x" (LNM$PROCESS_TABLE)
8 "X" = "x" (LNM$PROCESS_TABLE)
9 "X" = "x" (LNM$PROCESS_TABLE)
BPS2004A> def x x
%DCL-I-SUPERSEDE, previous value of X has been superseded
BPS2004A> sho log x
"X" = "X" (LNM$PROCESS_TABLE)
1 "X" = "X" (LNM$PROCESS_TABLE)
2 "X" = "X" (LNM$PROCESS_TABLE)
3 "X" = "X" (LNM$PROCESS_TABLE)
4 "X" = "X" (LNM$PROCESS_TABLE)
5 "X" = "X" (LNM$PROCESS_TABLE)
6 "X" = "X" (LNM$PROCESS_TABLE)
7 "X" = "X" (LNM$PROCESS_TABLE)
8 "X" = "X" (LNM$PROCESS_TABLE)
9 "X" = "X" (LNM$PROCESS_TABLE)
BPS2004A>

(How to rate this: Bug, Undocumented feature or programming error?. Don't ask me why this was used, a collegue just ran into it and I couldn't answer him...)
Willem Grooters
OpenVMS Developer & System Manager
5 REPLIES 5
Lokesh_2
Esteemed Contributor
Solution

Re: weird logical?

Hi Willem ,

This is not a bug. This is similar to following:

$ sho log a
%SHOW-S-NOTRAN, no translation for logical name A
$ def a b
$ def b c
$ def c d
$ def d e
$ def e f
$ def f g
$ def g h
$ def h i
$ def i j
$ def j k
$ def k l
$ def l m
$ def m n
$ def n o
$ sho log a
"A" = "B" (LNM$PROCESS_TABLE)
1 "B" = "C" (LNM$PROCESS_TABLE)
2 "C" = "D" (LNM$PROCESS_TABLE)
3 "D" = "E" (LNM$PROCESS_TABLE)
4 "E" = "F" (LNM$PROCESS_TABLE)
5 "F" = "G" (LNM$PROCESS_TABLE)
6 "G" = "H" (LNM$PROCESS_TABLE)
7 "H" = "I" (LNM$PROCESS_TABLE)
8 "I" = "J" (LNM$PROCESS_TABLE)
9 "J" = "K" (LNM$PROCESS_TABLE)

Only 9 iterations are shown.

$ sho log i
"I" = "J" (LNM$PROCESS_TABLE)
1 "J" = "K" (LNM$PROCESS_TABLE)
2 "K" = "L" (LNM$PROCESS_TABLE)
3 "L" = "M" (LNM$PROCESS_TABLE)
4 "M" = "N" (LNM$PROCESS_TABLE)
5 "N" = "O" (LNM$PROCESS_TABLE)

HTH,
Lokesh
What would you do with your life if you knew you could not fail?
Lokesh_2
Esteemed Contributor

Re: weird logical?

or see below:

$ def x y
%DCL-I-SUPERSEDE, previous value of X has been superseded
$ def y x
$ sho log x
"X" = "Y" (LNM$PROCESS_TABLE)
1 "Y" = "X" (LNM$PROCESS_TABLE)
2 "X" = "Y" (LNM$PROCESS_TABLE)
3 "Y" = "X" (LNM$PROCESS_TABLE)
4 "X" = "Y" (LNM$PROCESS_TABLE)
5 "Y" = "X" (LNM$PROCESS_TABLE)
6 "X" = "Y" (LNM$PROCESS_TABLE)
7 "Y" = "X" (LNM$PROCESS_TABLE)
8 "X" = "Y" (LNM$PROCESS_TABLE)
9 "Y" = "X" (LNM$PROCESS_TABLE)
$ sho log y
"Y" = "X" (LNM$PROCESS_TABLE)
1 "X" = "Y" (LNM$PROCESS_TABLE)
2 "Y" = "X" (LNM$PROCESS_TABLE)
3 "X" = "Y" (LNM$PROCESS_TABLE)
4 "Y" = "X" (LNM$PROCESS_TABLE)
5 "X" = "Y" (LNM$PROCESS_TABLE)
6 "Y" = "X" (LNM$PROCESS_TABLE)
7 "X" = "Y" (LNM$PROCESS_TABLE)
8 "Y" = "X" (LNM$PROCESS_TABLE)
9 "X" = "Y" (LNM$PROCESS_TABLE)

Best regards,
Lokesh
What would you do with your life if you knew you could not fail?
Willem Grooters
Honored Contributor

Re: weird logical?

Thanks Lokesh.

Now you stated your first example, I remembered this is done more often (I use it myself quite often in development area....) but I never looked at it this way.

I raised the question since I was concerned what would happen with any reference to X in DIR, f$SEARCH etcetera. Luckily, VMS will take care of that.

I could have known. VMS is safe...

Your points will be granted.
Willem Grooters
OpenVMS Developer & System Manager
Sheldon Smith
HPE Pro

Re: weird logical?

Documented feature. (Also a programming error. Yours. :)
Since logical names are strings, defining "X" to equate to "X" yields a circular definition. Logical name translation typically stops after 10 expansions. See
http://h71000.www7.hp.com/doc/731FINAL/6489/6489pro_027.html#logicalnametranslation


Note: While I am an HPE Employee, all of my comments (whether noted or not), are my own and are not any official representation of the company

Accept or Kudo

John Gillings
Honored Contributor

Re: weird logical?

Willem,

To answer your specific question:

>Has anyone seen this behaviour before (VMS 7.3-1):

Yes. Every version back to V1.0! (been there, done that, got the error message) There's even a status for it:


TOOMANYLNAM, logical name translation exceeded allowed depth

Facility: SYSTEM, System Services

Explanation: Ten translations were performed on the logical name; however, the name has not been translated.

User Action: Display all logical name tables and remove those entries that caused the problem.

-------------------------

my vague recollection is that early versions of VMS (pre V5?) would have issued a TOOMANYLNAM error for your SHOW LOG commands (or maybe TOOMANYREDS - "Too many redirects"?) I'm not sure why that changed, but it seems to be deeper down than DCL. Neither LIB$GET_LOGICAL or $TRNLNM return TOOMANLNAM for a looped logical name.

A crucible of informative mistakes