Operating System - OpenVMS
1753474 Members
4851 Online
108794 Solutions
New Discussion юеВ

Re: run sys$system:loginout and output

 
SOLVED
Go to solution
Tristan Gingold
New Member

run sys$system:loginout and output

I want to run a dcl script using
$ run/output=file.out/input=run.com sys$system:loginout
(and some additionnal qualifier to modify quota
or use the mailbox).
Unfortunately, on the output I get both the
lines of my script and the output of the commands. It is possible to have the commands output in a separate file ? What did I miss ?

Thanks.
11 REPLIES 11
Ian Miller.
Honored Contributor
Solution

Re: run sys$system:loginout and output

Perhaps verify is on so start your script with
$ SET NOVERIFY

or
$'F$VERIFY(0)
____________________
Purely Personal Opinion
Hoff
Honored Contributor

Re: run sys$system:loginout and output

That particular RUN command is typically a fairly arcane variation of the SPAWN command.

Did you intend to include /DETACH or mayhap /UIC=[uic.value] on that RUN command, and invoke the DCL command procedure as a separate process? Otherwise, a SPAWN command would be rather more typical usage.

And if you want to suppress verification in a DCL command procedure, that's usually one of the following:

$ SET NOVERIFY
$ vfy = f$verify(0)
$ vfy = F$Verify(F$TrnLnm("GINGOLD_DEBUG"))

Also remember the ON or SET NOON command at the top of the procedure, too; since you're calling this a "script", I'll presume some local familiarity with Unix, and DCL procedures and error handling will work slightly differently here than that of bash shell scripts.

If that's not it, please post up the OpenVMS platform and version information, whether you're current on patches, and a reproducer and/or an example log.
Tristan Gingold
New Member

Re: run sys$system:loginout and output

Thank you to both Ian and Hoff.

I have to use RUN because I want to control
quota and use mailbox notification.
Wim Van den Wyngaert
Honored Contributor

Re: run sys$system:loginout and output

Note that sys$scratch and sys$login are missing in detached mode. But you can define them yourself when needed.

Wim
Wim
John Gillings
Honored Contributor

Re: run sys$system:loginout and output

Wim,

Note that this process is NOT detached. It's using the RUN command *without* /DETACHED or /UIC. As Hoff pointed out, that means it creates a subprocess.

SYS$SCRATCH and SYS$LOGIN are defined, and the job table is shared with the creator process. However, unlike SPAWN, neither process logical names nor symbols are copied. Also unlike SPAWN, the default for this type of process is verification enabled.

Odd usage, but as Tristan has pointed out, RUNH/MAILBOX is the only simple way from DCL to get a process termination message.

Tristan,
I'll some other options to Hoff's suggestions for turning verification off:

$ v='F$VERIFY(0)'
$ v= 'F$VERIFY(F$TRNLNM(F$PARSE(F$ENVIRONMENT("PROCEDURE"),,,"NAME")+"_VERIFY")'

Each of Hoff's options will be verified to SYS$OUTPUT. If that matters, put single quotes around F$VERIFY(0) so it's executed before the verification phase of DCL parsing.
The longer version allows you to define a logical name _VERIFY to enable verification, for example, in the JOB table. If the logical name is not defined, verification will be disabled.

In a more general, modular context, the procedure should end with something like:

$ EXIT F$INTEGER(stat)+(F$VERIFY(v).AND.0)

(where symbol stat contains the final status you want to return to the caller). This will restore verification to its previous state.

A crucible of informative mistakes
Tristan Gingold
New Member

Re: run sys$system:loginout and output

Thanks John for the trick.

I have a slightly related question: the first
lines of a batch output is:

$ Set NoOn
$ VERIFY = F$VERIFY(F$TRNLNM("SYLOGIN_VERIFY"))

However, this lines are not in my batch command
nor in my login.com. Are they internal
commands from dcl or are they defined in some
logicals ?

Thanks.
Thomas Ritter
Respected Contributor

Re: run sys$system:loginout and output

$ Set NoOn
$ VERIFY = F$VERIFY(F$TRNLNM("SYLOGIN_VERIFY"))

Most likely in sylogin.com or the system wide login.com
Hoff
Honored Contributor

Re: run sys$system:loginout and output

If you don't know where a particular string of text might be within your local environment, well, SEARCH for it.

From the string, it can be inferred that this particular DCL command is probably located within the system-wide SYLOGIN command procedure, and SYLOGIN is commonly invoked as part of a login sequence.

That written, I've seen this DCL cut-and-pasted elsewhere, too. Again, SEARCH is your friend.
John Gillings
Honored Contributor

Re: run sys$system:loginout and output

>$ Set NoOn
>$ VERIFY = F$VERIFY(F$TRNLNM("SYLOGIN_VERIFY"))

These are the "normal" first two lines in SYLOGIN.COM (see SYS$STARTUP:SYLOGIN.TEMPLATE).

The "$ SET NoOn" in batch, network and RUN subprocesses because verification is on by default. The F$VERIFY line appears because it doesn't include the leading single quote to turn verification off before the line is verified.

If it were me, I'd have written it as:

$ VERIFY = 'F$VERIFY(F$TRNLNM("SYLOGIN_VERIFY"))'
$ Set NoOn

because I don't like superfluous text from login procedures in batch log files. That way around the procedure is silent unless the logical name SYLOGIN_VERIFY is defined as TRUE.

Remember the template is just a suggestion. You're free to change your SYLOGIN.COM to whatever you please.

FWIW, our site has exactly the above modification in all our SYLOGIN.COM procedures.
A crucible of informative mistakes