GETST Get Job Statistics via XCALL LIB$STAT_TIMER 5-DEC-1990 17:51:34 VAX DIBOL V4.1-00 Page 1 Data Division 5-DEC-1990 15:23:18 DUB0:[DECUS]GETST.SBL;1 .title 'Get Job Statistics via XCALL LIB$STAT_TIMER' ; ; ; G E T S T . S B L ; ; 1 SUBROUTINE GETST 2 FUNCTION ,D ;Function to perform ; 0 - Initialize Timer ; ** Must always do first ** ; 1 - Obtain Statistics ; Elapsed Time ; CPU Time ; Buffered I/O ; Direct I/O ; Page Faults ; $DBD GETST.DBD ; 12-May-1987 ; MRS Development 3 COMMON STATS 4 ,A1,'|' 5 ZONED_ELAPSED_TIME ,D10 ;Zoned Decimal Value of Elapsed Time 6 ,A1,'|' 7 ZONED_CPU_TIME ,D10 ;Zoned Decimal Value of CPU Time 8 ,A1,'|' 9 ZONED_BUFFERED_IO ,D10 ;Zoned Decimal Value of Buffered I/O 10 ,A1,'|' 11 ZONED_DIRECT_IO ,D10 ;Zoned Decimal Value of Direct I/O 12 ,A1,'|' 13 ZONED_PAGE_FAULTS ,D10 ;Zoned Decimal Value of Page Faults 14 ,A1,'|' 15 ELAPSED_TIME_STRING ,A11 ;Elapsed Time as a formatted ;ASCII string "hh:mm:ss.cc" 16 ,A1,'|' 17 CURRENT_TIME_STRING ,A23 ;Current Date & Time as a formatted ;ASCII string "dd-mmm-yyyy hh:mm:ss.cc" 18 ,A1,'|' ;$End of Definition .page GETST Get Job Statistics via XCALL LIB$STAT_TIMER 5-DEC-1990 17:51:34 VAX DIBOL V4.1-00 Page 2 Data Division 5-DEC-1990 15:23:18 DUB0:[DECUS]GETST.SBL;1 ; $SBL GETST.SBL ; 12-May-1987 ; MRS Development 19 RECORD 20 INT_VAL_1 ,I4,1 ;Longword Integer Value of Decimal "1" 21 INT_VAL_2 ,I4,2 ;Longword Integer Value of Decimal "2" 22 INT_VAL_3 ,I4,3 ;Longword Integer Value of Decimal "3" 23 INT_VAL_4 ,I4,4 ;Longword Integer Value of Decimal "4" 24 INT_VAL_5 ,I4,5 ;Longword Integer Value of Decimal "5" 25 RECORD 26 INT_ELAPSED_TIME ,I8 ;Address of a Quadword that ;contains Elapsed Real Time. 27 INT_CPU_TIME ,I4 ;Address of a Longword that ;contains elapsed CPU Time. 28 INT_BUFFERED_IO ,I4 ;Address of a Longword that ;contains count of Buffered I/O. 29 INT_DIRECT_IO ,I4 ;Address of a Longword that ;contains count of Direct I/O. 30 INT_PAGE_FAULTS ,I4 ;Address of a Longword that ;contains count of Page Faults. 31 RECORD 32 INT_TIME_LENGTH ,I2 ;Address of a Word containing ;the length of "ELAPSED_TIME_STRING" 33 ZONED_TIME_LENGTH ,D2 ;Zoned Decimal Value of length of ;"ELAPSED_TIME_STRING" returned. GETST Get Job Statistics via XCALL LIB$STAT_TIMER 5-DEC-1990 17:51:34 VAX DIBOL V4.1-00 Page 3 Procedure Division 5-DEC-1990 15:23:18 DUB0:[DECUS]GETST.SBL;1 34 PROC 35 BEGIN_SUBROUTINE, ;Always Obtain current Date and Time. 36 XCALL SYS$ASCTIM (%REF(INT_TIME_LENGTH) & ,%DESCR(CURRENT_TIME_STRING),,) ;Check Length of Current Time String Returned, it should be 23. 37 ZONED_TIME_LENGTH = INT_TIME_LENGTH 38 IF (FUNCTION) THEN 39 1 BEGIN ;Obtain Elapsed Real Time. 40 1 XCALL LIB$STAT_TIMER (%REF(INT_VAL_1),%REF(INT_ELAPSED_TIME)) 41 1 ZONED_ELAPSED_TIME = INT_ELAPSED_TIME ;Re-format Elapsed Time as "hh:mm:ss.cc". 42 1 XCALL SYS$ASCTIM (%REF(INT_ELAPSED_TIME) & ,%DESCR(ELAPSED_TIME_STRING) & ,%REF(INT_ELAPSED_TIME) & ,%VAL(1)) ;Check Length of Elapsed Time String Returned, it should be 11. 43 1 ZONED_TIME_LENGTH = INT_TIME_LENGTH ;Obtain Elapsed CPU Time. 44 1 XCALL LIB$STAT_TIMER (%REF(INT_VAL_2),%REF(INT_CPU_TIME)) 45 1 ZONED_CPU_TIME = INT_CPU_TIME ;Obtain Count of Buffered I/O Operations. 46 1 XCALL LIB$STAT_TIMER (%REF(INT_VAL_3),%REF(INT_BUFFERED_IO)) 47 1 ZONED_BUFFERED_IO = INT_BUFFERED_IO ;Obtain Count of Direct I/I Operations. 48 1 XCALL LIB$STAT_TIMER (%REF(INT_VAL_4),%REF(INT_DIRECT_IO)) 49 1 ZONED_DIRECT_IO = INT_DIRECT_IO ;Obtain Count of Page Faults. 50 1 XCALL LIB$STAT_TIMER (%REF(INT_VAL_5),%REF(INT_PAGE_FAULTS)) 51 1 ZONED_PAGE_FAULTS = INT_PAGE_FAULTS 52 1 END 53 ELSE 54 1 BEGIN 55 1 XCALL LIB$INIT_TIMER 56 1 END 57 SUB_RETURN, 58 RETURN ;$End No errors detected DIBOL/NOSTAND/NOOB/LIS GETST.SBL