Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

If interested with this type of simple solution when dealing with VMS logicals

 
John Gillings
Honored Contributor

Re: If interested with this type of simple solution when dealing with VMS logicals

re Hartmut:

 

 

> Also, user-mode logical names are automatically deleted when invoking and exiting a command procedure.

 

   Hmmm, had me worried for a minute there. The HELP text is wrong! I have numerous procedures that depend on passing a user mode logical name into a procedure. User mode logical names are NOT deleted when INVOKING a command procedure (but they are then exiting).

 

showlog.com
$ WRITE SYS$OUTPUT F$TRNLNM(p1)
$ WRITE SYS$OUTPUT F$TRNLNM(p1)

experiment

$ define test super_mode
$ @showlog test
SUPER_MODE
SUPER_MODE
$ define/user test user_mode
$ write sys$output f$trnlnm("test")
USER_MODE
$  @showlog test
USER_MODE
USER_MODE
$ write sys$output f$trnlnm("test")
SUPER_MODE
$  @showlog test
SUPER_MODE
SUPER_MODE
 

 

 

A crucible of informative mistakes
John Gillings
Honored Contributor

Re: If interested with this type of simple solution when dealing with VMS logicals

Phillipe,

 

> How would you manage for such a much more complex DCL code

 

  Easy!

 

JRUBY.COM

$ self=F$PARSE(";",F$ENVIRONMENT("PROCEDURE"))
$ IF p8.NES."#SELF"
$ THEN
$   PIPE (set process/parse=extended ; -
      DEFINE/NOLOG DECC$EFS_CHARSET           ENABLED ; -
      DEFINE/NOLOG DECC$READDIR_DROPDOTNOTYPE TRUE ; -
      DEFINE/NOLOG DECC$EFS_CASE_PRESERVE     TRUE ; -
      DEFINE/NOLOG JAVA$DELETE_ALL_VERSIONS   TRUE ; -
      @'self' "''p1'" "''p2'" "''p3'" "''p4'" "''p5'" "''p6'" "''p7'" #SELF
         )
$   EXIT
$ ENDIF
(remainder of your JRUBY.COM procedure - minus references to P8)

 You now have a place to perform any environment setups you'll need, confident that you won't pollute the caller's environment, and without the need for a "restore" path.

A crucible of informative mistakes
H.Becker
Honored Contributor

Re: If interested with this type of simple solution when dealing with VMS logicals

>>> Also, user-mode logical names are automatically deleted when invoking and exiting a command procedure.


Yes, this is wrong, or not describing the current behavior. A quick look at the DCL manual on the HP web site shows the same text in the current and 7.3 manuals. I don't know what the intended or right behavior was/is. It seems the current behavior is in place for some time (I verified it on V7.3-2 and 8.3). If it was a bug, it became a feature and the documentation needs to be fixed.

 

At least it seams easier to fix than lib$cvt_atime, but what do I know.

John Gillings
Honored Contributor

Re: If interested with this type of simple solution when dealing with VMS logicals

Hartmut,

 

> I don't know what the intended or right behavior was/is.

 

   You'd have to assume that the current behaviour is as intended. Deleting user mode logical names AFTER using them makes lots of sense, but deleting them BEFORE they might be used is just plain stupid. Regardless, they're stuck with it now!

 

If they won't fix buggy behaviour that has no redeeming purpose, for example silently ignoring DEFINE/EXEC when SYSNAM is missing, how could anyone justify changing useful behaviour to match the documentation?

A crucible of informative mistakes