SUBROUTINE TSKLOG(LUNTI,TSKNAM,TIMES,NPAGES) C C Subroutine to log the information passed about the C task TSKNAM to the COT logfile CONSOLE.LOG. With C this information logged, a monthly report of user C task activity can be assembled. The input parameters C are as follows: C C LUNTI - Integer value of the logical unit number C of TI: (usually defined as INP or OUT) C TSKNAM - 8 byte value of the ascii name of the C task that did the call (EG. CAL501-P). C TIMES - 8 byte value of the time elapsed running C the task (usually an output from the TIMER C routine in CALLIB). C NPAGES - Integer value of the number of pages printed C in running the task. If not applicable just C use 0. C C Basis of operation: First, a call to the system routine C GETLUN is made with the lun passed in LUNTI. This allows C the routine to determine the device characteristics C (usually all we want is the terminal unit number, since C the report generator will queue on the terminal number of C of the login sequence). Once we have the terminal number, C the lun is closed and reopened with an assignment to the C psuedo device CO:. Then we write the passed information C to CO: and the task COT logs the line to the file CONSOLE.LOG. C Of course the command ELI /LOG must have C been issued to the system before this is to work. This is C done here in the STARTUP.CMD file. Once the information is C logged, the lun is again closed and reopened with an assignment C to the original TI:. This implies that TI: must have been C the original assignment or things could really get messy! C C AUTHOR: Brad L. Tinney C DATE: 31-JAN-81 C INTEGER LUNTI,NPAGES,LUNBUF(6),TERMNO BYTE TSKNAM(8),TIMES(8) C CALL GETLUN (LUNTI,LUNBUF) ! Get the device info TERMNO = IAND(LUNBUF(2),"77) ! Strip off flags byte CLOSE(UNIT=LUNTI) ! Close out TI: CALL ASSIGN(LUNTI,'CO:',3) ! Redirect to CO: WRITE (LUNTI,1) TSKNAM,TIMES,NPAGES, $ TERMNO ! Log the info 1 FORMAT (' Task log: ',8A1,' Time: ', $ 8A1,' Pages: ',I8,' Terminal: TT',O2,':') CLOSE(UNIT=LUNTI) ! Close it again CALL ASSIGN(LUNTI,'TI:',3) ! And redirect back RETURN END