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

What is this DCL command doing?

 
SOLVED
Go to solution
Jim D Frederick
Occasional Advisor

What is this DCL command doing?

The command (on OpenVms 7.2-1)
$ SET DEF RUN@REPROC

The Story :
We have a logical named RUN$REPROC where we keep program files that generate reports.
"RUN$REPROC" = "RBASE:[F$REPORT]"
(LNM$GROUP_000042)

A user mistyped a SET DEFAULT command and used an @ instead of a $. I expected this to return an %RMS-F-DIR, error in directory name but instead the decterm hung in an LEF state.

The user tried a CNTRL-Y, and CNTRL-C and CNTRL-Z, but could not get back to the DCL prompt. The user eventually just did a File -> Exit on his Xwindow-Decterm, but even that did not kill off the process.

Using $ANA/SYS I saw it had an open channel to MBA256: which confused me greatly until I discovered that there is also a group logical called REPROC which is set to:
"REPROC" = "MBA256:" (LNM$GROUP_000042)

A $ Stop/ID did kill off the process but not before causing all kinds of serious havoc. :(

This is repeatable, but I don't get it?!? Can anyone tell me what the heck this command is trying to do?

LOL!
Thanks!
5 REPLIES 5
John Gillings
Honored Contributor
Solution

Re: What is this DCL command doing?

Jim,

This is an ancient and rather peculiar feature of DCL. The @ sign executes a procedure even WITHIN a command line, returning the contents of the first line (only) of the procedure as part of the command line. Simple example:

$ CREATE PROC.COM
LOGIN.COM
^Z

Now
$ TYPE @PROC

will display LOGIN.COM. You can even pass parameters:

$ CREATE PROC.COM
LOGIN.COM 'p1' 'p2' 'p3'
^Z

$ TYPE @PROC ,MYFILE.LIS /PAGE

Things get really weird when you add more lines to the procedure, as they get executed after the invoking command

$ CREATE PROC.COM
LOGIN.COM 'p1' 'p2' 'p3'
$ SHOW TIME
^Z


To some extent this is a solution in search of a problem, and causes much more trouble than it's worth. Consider the MAIL command with internet addresses containing "@" signs. I've found occasional uses for it over the years, but nothing that couldn't be done some other way.

Now, in your case, the procedure you're executing is a mailbox, so you're attempting to read commands from the mailbox.

Enter a second ancient and rather peculiar feature of DCL - mailbox reads from DCL cannot be interrupted by ^Y! I've no idea why, that's just the way they are, and have been since V1.0.

If the mailbox isn't being used at the moment, you should be able to complete the read by opening and closing the mailbox from another process. This should send an EOF. Of course, if there are other processes reading the mailbox that might not be a good thing. Also, if there are other processes writing the mailbox, your mistyped command will be eating the messages (and generating errors?)

Example (V8.3):

SESS1$ create/mailbox mymbx
SESS1$ show log mymbx
"MYMBX" = "MBA5858:" (LNM$JOB_8942DC00)


SESS2$ @mba5858:
Interrupt

Interrupt


SESS1$ open/read/write mbx MBA5858:
SESS1$ close mbx

SESS2$ ! (returns to prompt)
SESS2$ set default @mba5858:


SESS1$ open/read/write mbx MBA5858:
SESS1$ write mbx "sys$login"
SESS1$ close mbx

SESS2$ ! (returns to prompt)


A crucible of informative mistakes
Hoff
Honored Contributor

Re: What is this DCL command doing?

This case is most commonly seen with MAIL sent from the command line where the user@example.com (sans the required quotes) goes wonky with a file not found for the example.com file error message

$ mail nla0: user@example.com
%DCL-E-OPENIN, error opening ddcu:[dir]EXAMPLE.COM; as input
-RMS-E-FNF, file not found
$

But then, there's also a trip through the OpenVMS DCL HELP library for the @ invocation, which will find the following...

-- begin HELP quote --

3.$ CREATE FILES.COM
*.FOR, *.OBJ


$ DIRECTORY @FILES

This example shows a command procedure, FILES.COM, that
contains parameters for a DCL command line. The entire file is
treated by DCL as command input. You can execute this procedure
after the DIRECTORY command to get a listing of all FORTRAN
source and object files in your current default directory.

4.$ CREATE QUALIFIERS.COM
/DEBUG/SYMBOL_TABLE/MAP/FULL/CROSS_REFERENCE


$ LINK SYNAPSE@QUALIFIERS

This example shows a command procedure, QUALIFIERS.COM, that
contains qualifiers for the LINK command. When you enter the
LINK command, specify the command procedure immediately after
the file specification of the file you are linking. Do not type
a space between the file specification and the @ command.

5.$ CREATE SUBPROCES.COM
$ RUN 'P1' -
/BUFFER_LIMIT=1024 -
/FILE_LIMIT=4 -
/PAGE_FILES=256 -
/QUEUE_LIMIT=2 -
/SUBPROCESS_LIMIT=2 -
'P2' 'P3' 'P4' 'P5' 'P6' 'P7' 'P8'


-- end HELP quote --

I cover this case in the DCL book as well, IIRC. It's occasionally useful for some commands, such as grabbing a specific and set list of files for BACKUP or such.
Wim Van den Wyngaert
Honored Contributor

Re: What is this DCL command doing?

Also consider improving protection on mailboxes (and other devices). Should your process have read access to them ?

Over here, I must confess, mailboxes are wide open and available for abuse. And not only here.

Wim
Wim
Jim D Frederick
Occasional Advisor

Re: What is this DCL command doing?

Thank you all for great explainations and examples.

I've been using DCL for 18+ years and hadn't run across this. :)

Setting the security on the mailbox is a suggestion worth looking into.

Thanks.
Jim D Frederick
Occasional Advisor

Re: What is this DCL command doing?

Closed.