[Info-vax] Reopen OPERATOR.LOG from batch?
Jan-Erik Söderholm
jan-erik.soderholm at telia.com
Thu Sep 5 17:41:14 EDT 2019
Den 2019-09-05 kl. 23:29, skrev Jon Pinkley:
> On Thursday, September 5, 2019 at 1:16:25 PM UTC-4, Simon Clubley wrote:
>> I think Jan-Erik has probably worked out what that command does already, :-)
>> but the real question is _why_ does it make a difference ?
>>
>> The answer appears to be that reply/enable checks whether it is running
>> in a batch job by checking whether the current input device is a terminal
>> or not.
>>
>> Unless that behaviour is documented as supported, it seems to me
>> that behaviour is prone to breaking if someone changes the code to
>> check in the proper way for whether the command is being run in a
>> batch job.
>>
>> Question: Can you start up a scripted pseudo terminal session from
>> within a program running in a batch job (I've never tried it) and
>> if so, will the pseudo terminal session appear as an interactive
>> session or as a batch session ?
>>
>> If it's the former, that might be a supported way for Jan-Erik to
>> do this.
>>
>> Simon.
>>
>> --
>> Simon Clubley, clubley at remove_me.eisner.decus.org-Earth.UFP
>> Microsoft: Bringing you 1980s technology to a 21st century world
>
> Using a pseudo terminal may be "supported", but it would definitely be a Rube Goldberg solution compared to the 4 line method.
>
> The method used, define/user, has worked from long before pseudo terminals even existed on VMS. And it is documented, for example, in the OpenVMS System Manager's Manual.
>
> https://www.itec.suny.edu/scsys/vms/ovmsdoc073/v73/6017/6017pro_003.html
>
> see section "2.4.5 Designating Operator Terminals"
>
> "To designate an operator's terminal in batch or in startup command procedures, SYS$COMMAND must be assigned to a valid terminal device."
>
> The use of "reply/log" to open an new version of the log file is a rather esoteric.
>
> If VSI ever breaks it, they should create another way or api to comminicate directly with OPCOM.
>
Ah, right. So as long as SYS$COMMAND is defined to *anything*
that VMS thinks is a "terminal", you are fine.
I was sent on the wrong track since OPA0: was used, but I
understand now why since it is always present. I thought
that it had to be OPA0: specifically...
This also works just fine b.t.w.
$ type reop.com
$ define /user SYS$COMMAND TTA0:
$ reply/enable
$ define /user SYS$COMMAND TTA0:
$ reply/log
Or:
$ type reop.com
$ define /user SYS$COMMAND 'p1'
$ reply/enable
$ define /user SYS$COMMAND 'p1'
$ reply/log
and
$ subm reop.com /param="''f$trnlnm(""TT"")'"
(As long as one do not logoff before the job runs...)
And yes, it surprises me that there is not a more logical
and supported method to repoen the OPERATOR.LOG file from
a batch job. That must not be particular uncommon...
Jan-Erik.
More information about the Info-vax
mailing list