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

SET HOST /LOG logfile

 
Michael Moroney
Frequent Advisor

Re: SET HOST /LOG logfile

I tried the OPEN/WRITE/SHARE and OPEN/APPEND/SHARE a PPF and using that as the log before I wrote the first message, and didn't see anything in the file until the SET HOST session ended, in other words, no better than a regular file. I don't know why it didn't work for me.

The customer doesn't care for software needing godlike powers to run, but they do like the pseudoterminal. I didn't think of the RS232 loopback, even though I did that myself once long ago (to copy a file from another system) They have an RS232 adapter with plenty of spare ports. Now off to try to figure out which pins should go where.
John Gillings
Honored Contributor

Re: SET HOST /LOG logfile

Michael,

Sorry, maybe I didn't explain clearly enough. You need to OPEN/APPEND/SHARE then CLOSE the file to bring the EOF up to date AT THE TIME OF THAT CLOSE. It will then stay there until you repeat the OPEN/APPEND/SHARE & CLOSE. There's no way to have it "automatically" update.

Here's a sample transcript - it's V7.3-2 so I'm not depending on anything recent. It's also a bit confusing since the process is looking at its own logfile.

$ open/write/share mylog whatever.log
$ set host 0/log=mylog

Username: jg
Password:

Unauthorized Access Prohibited

Last interactive login on Thursday, 17-JUL-2008 12:02:14.34
Last non-interactive login on Thursday, 17-JUL-2008 05:00:28.90

$ dir/size=all whatever.log

Directory DSA1:[OMEX_SYS_ASX]

WHATEVER.LOG;1 0/37 17-JUL-2008 12:05:12.61

Total of 1 file, 0/37 blocks.
$ type whatever.log
$
! Nothing

$ open/append/share tmp whatever.log
$ close tmp
$ dir/size=all whatever.log

Directory DSA1:[OMEX_SYS_ASX]

WHATEVER.LOG;1 2/37 17-JUL-2008 12:05:12.61

Total of 1 file, 2/37 blocks.
$
! EOF has moved

$ type whatever.log

Username: omex_sys_asx
Password:

Unauthorized Access Prohibited

Last interactive login on Thursday, 17-JUL-2008 12:02:14.34
Last non-interactive login on Thursday, 17-JUL-2008 05:00:28.90

%DCL-S-SPAWNED, process ALIVE_202044A9 spawned
$ dir/size=all whatever.log
Subprocess ALIVE_202044A9 has completed

Directory DSA1:[OMEX_SYS_ASX]

WHATEVER.LOG;1 0/37 17-JUL-2008 12:05:12.61

Total of 1 file, 0/37 blocks.
$ type whatever.log
$ open/append/share tmp whatever.log
$ close tmp

! File is now up to the point of the CLOSE

$ logout
JG logged out at 17-JUL-2008 12:07:50.11
%REM-S-END, control returned to node LOCAL:.JG000::
$
$ type mylog
$
! Nothing visible via the PPF
$
$ type whatever.log

Username: omex_sys_asx
Password:

Unauthorized Access Prohibited

Last interactive login on Thursday, 17-JUL-2008 12:02:14.34
Last non-interactive login on Thursday, 17-JUL-2008 05:00:28.90

%DCL-S-SPAWNED, process ALIVE_202044A9 spawned
$ dir/size=all whatever.log
Subprocess ALIVE_202044A9 has completed

Directory DSA1:[OMEX_SYS_ASX]

WHATEVER.LOG;1 0/37 17-JUL-2008 12:05:12.61

Total of 1 file, 0/37 blocks.
$ type whatever.log
$ open/append/share tmp whatever.log
$ close tmp

! But via the file name, the EOF is up to the last CLOSE

$ OPEN/APPEND/SHARE tmp whatever.log
$ CLOSE tmp

! Reset EOF to current location

$ type whatever.log
Username: jg
Password:

Unauthorized Access Prohibited

Last interactive login on Thursday, 17-JUL-2008 12:02:14.34
Last non-interactive login on Thursday, 17-JUL-2008 05:00:28.90

$ dir/size=all whatever.log

Directory DSA1:[OMEX_SYS_ASX]

WHATEVER.LOG;1 0/37 17-JUL-2008 12:05:12.61

Total of 1 file, 0/37 blocks.
$ type whatever.log
$ open/append/share tmp whatever.log
$ close tmp
$ dir/size=all whatever.log

Directory DSA1:[OMEX_SYS_ASX]

WHATEVER.LOG;1 2/37 17-JUL-2008 12:05:12.61

Total of 1 file, 2/37 blocks.
$
$ type whatever.log

Username: jg
Password:

Unauthorized Access Prohibited

Last interactive login on Thursday, 17-JUL-2008 12:02:14.34
Last non-interactive login on Thursday, 17-JUL-2008 05:00:28.90

?$ dir/size=all whatever.log?

Directory DSA1:[OMEX_SYS_ASX]
WHATEVER.LOG;1 0/37 17-JUL-2008 12:05:12.61

Total of 1 file, 0/37 blocks.
$ type whatever.log
$ open/append/share tmp whatever.log
$ close tmp
$ dir/size=all whatever.log

Directory DSA1:[OMEX_SYS_ASX]

WHATEVER.LOG;1 2/37 17-JUL-2008 12:05:12.61

Total of 1 file, 2/37 blocks.
$
$ type whatever.log

Username: jg
Password:

Unauthorized Access Prohibited

Last interactive login on Thursday, 17-JUL-2008 12:02:14.34
Last non-interactive login on Thursday, 17-JUL-2008 05:00:28.90

$ dir/size=all whatever.log

Directory DSA1:[OMEX_SYS_ASX]

WHATEVER.LOG;1 0/37 17-JUL-2008 12:05:12.61

Total of 1 file, 0/37 blocks.
$ type whatever.log
$ open/append/share tmp whatever.log
$ close tmp
$ logout

JG logged out at 17-JUL-2008 12:07:50.11

$ CLOSE mylog
A crucible of informative mistakes
Michael Moroney
Frequent Advisor

Re: SET HOST /LOG logfile

No, I didn't try that.
Highlighted
Hein van den Heuvel
Honored Contributor

Re: SET HOST /LOG logfile

Nice trick with the shared PPF john!

Here is an other direction for a work-around.
SET HOST /LOG will happily write into a mailbox... which a program, or 'type', can read. See attachment.

I thought It would be enough for a tool to create a mailbox, read and put into a file allowing sharing. However... it seems you still need a home-grown tool, or the OPEN-for-append + close John suggests to get the EOF. Tools like SEARCH and TYPE and CONVERT all use UPI sharing and do not trigger a flush. I guess I'm not smart enough tonite to come up with a standard tool to do this, other than a simple DLC loop as below.

Try it....

$cc mbx
$link mbx
$spawn/nowait run mbx
$set host /log=MBX
blah blah

And in an other session:
$open/read/share=write x 'p1
$loop:
$read/end=done x record
$write sys$output record
$goto loop
$done:
$close x

Or
$ ope/read/appe/share=write x sethost.lis
$ typ sethost.lis
$ close x
$ typ sethost.lis

Hein.
Michael Moroney
Frequent Advisor

Re: SET HOST /LOG logfile

We're going to use a logging program which uses a pseudoterminal to capture the output.

Thanks for all the interesting suggestions.