T.R | Title | User | Personal Name | Date | Lines |
---|
501.1 | A very simple kludge... | ALBANY::KOZAKIEWICZ | You can call me Al... | Thu Jun 18 1987 13:23 | 2 |
| Submit another batch job at exit which runs in a minute or so (to ensure
that the log file gets closed) and have it do the mailing.
|
501.2 | Another possiblity... | QBUS::MITCHAM | Andy in Atlanta | Thu Jun 18 1987 16:40 | 10 |
| Have your command file write and submit another command file that simply
mails the log file to yourself...
$ OPEN/WRITE FILE BAR.COM
$ SELF = F$EDIT(F$GETJPI("","USERNAME"),"TRIM")
$ WRITE FILE "$MAIL FOO.LOG ''self'"
$ CLOSE FILE
$ SUBMIT BAR.COM
-Andy
|
501.3 | 1+ | ERIS::CALLAS | CO in the war between the sexes | Fri Jun 19 1987 12:49 | 5 |
| If you use another batch job, have it SYNCHRONIZE with the first
one so that you don't get errors from that. It should also probably
delete itself.
Jon
|
501.4 | Synchronizing and such... | QBUS::MITCHAM | Andy in Atlanta | Fri Jun 19 1987 14:08 | 5 |
| Re: < Note 501.3 by ERIS::CALLAS "CO in the war between the sexes" >
Jon, I'm not familiar with this. Would you mind posting an example?
-Andy
|
501.5 | Facile ... | VISA::BIJAOUI | Tomorrow Never Knows | Mon Jun 22 1987 07:41 | 23 |
| Re: .0
Aow, come on, don't bother with another batch job.
I already had to cope with the problem, and this is the way I solved
it:
At the beginning of your command procedure, set the output rate
to 1 second:
$ SET OUTPUT_RATE = ::1
Just before your mail, do :
$ WAIT ::2 ! To have the log file written
$ CONVERT/SHARE 'Your_log_file' X.DAT ! To avoid the $%&#@ error
! 'File currently ...'
$ MAIL X.DAT NOEUD::MACHIN ! Mail your file.
And that's it !
Let me know if you have any problem,
Pierre.
|
501.6 | Stream is used on different jobs | PSGMKH::SMITH | Never say never, I always say. | Mon Jun 22 1987 10:15 | 14 |
|
The Base Note was submitted on behalf of another person, and they
hadn't given me all the facts the first time. Here's the scoop :
They have a need for a Com Stream, which they will insert, or not
insert, in any given Production Job as needed, that will mail a
copy of the Log to whomever they specify in a parameter of the
Com Stream. Since this Stream will not always be used in the same
Job, it needs to be able to determine what the name of the Job it
was inserted in, so it can mail the correct Log. I hope this is a
little clearer than before. Thanks.
Mike
|
501.7 | | ERIS::CALLAS | CO in the war between the sexes | Mon Jun 22 1987 11:55 | 21 |
| re .4:
From the help files:
SYNCHRONIZE
Places the process issuing this command in a wait state until a
specified job completes execution.
Format:
SYNCHRONIZE [job-name]
Additional information available:
Parameters Command_Qualifiers
/ENTRY /QUEUE
Examples
|
501.8 | f$pid, f$environment, show dev/file | VIDEO::OSMAN | type video::user$7:[osman]eric.six | Mon Jun 22 1987 16:04 | 28 |
| If I understand your latest questions correctly, you now understand how
to mail your own .LOG file *once* you know what it's called, and you're
stuck on how to figure out what your log file is called.
This has been discussed before, and the method involves combining
the following pieces of information:
o F$GETJPI("","PID")
Find out what your process id is.
o F$ENVIRONMENT("PROCEDURE")
Find out what your command procedure name is. But don't be mislead
by this! You might have been @'ed from another procedure.
o SHOW DEVICE/FILE/OUT=filespec
Find out list of open files and process id's. The sought .LOG filename
is one of the ones labelled with your process id.
o SHOW QUEUE/BATCH/FULL/ALL/OUT=filespec
Find out what log file the batch job is writing to.
"The rest is left as an exercise for the student".
/Eric
|
501.9 | Done! (for many cases...) | LEDS::BECKER | | Tue Jun 30 1987 11:28 | 21 |
| $ !
$ ! This command file finds the LOG output file name for Batch Jobs.
$ !
$ ! It assumes: 1) Current job has opened no other *.log files
$ ! 2) LOG file is on the default disk i.e. same as login.com
$ ! 3) The Log file is a *.log file
$ !
$ ! Disadvantages: 1) Not exactly fast.
$ !
$ set verify
$ pid = f$getjpi ("","pid")
$ show device/file/out=open_files.dat
$ search open_files.dat 'pid' , ".log"/match=and/output=log_info_file.dat
$ open/read log_info_file log_info_file.dat
$ read log_info_file log_info_record
$ log_file_path == f$parse ( "[" + f$element (1,"[",log_info_record))
$ write sys$output "And the anser is.... ''log_file_path'"
$ close log_info_file
$ delete log_info_file.dat.*
$ delete open_files.dat.*
$ exit
|