*DECK NP$SPRT
*IF,DEF,STAT
USETEXT NP$STAT
*ENDIF
PROC NP$SPRT;
*IF,DEF,IMS
#
*1DC NP$SPRT
* 1. PROC NAME AUTHOR DATE
* NP$SPRT E. GEE 86/01/27
*
* 2. FUNCTIONAL DESCRIPTION
* DUMPS STATISTICS TO ZZZZZSN AND THEN CLOSES ZZZZZSN.
*
* 3. METHOD USED
* NP$SPRT CALCULATES THE USED CPU TIME. IT WRITES HEADERS TO
* ZZZZZSN AND CALLS NP$SN TO PRINT OUT THE STAT ARRAY.
*
* 4. ENTRY CONDITONS
* NP$SPRT MAY BE CALLED FROM NETSTC OR NETOFF.
* SN$WRAT = ERROR CODE IF I/O ERROR HAS OCCURRED ON ZZZZZSN FILE
*
* 5. EXIT CONDITIONS
* PRNT - MUST BE FALSE
* SN$WRAT - ABNORMAL TERMINATION CODE FROM I/O ERROR ON ZZZZZSN
*
* 6. COMDECKS CALLED AND SYMPL TEXTS USED.
* NP$CRT CONTROL DATA COPYRIGHT DECK
* NP$STAT AIP STATISTICS TABLE
*
* 7. PROCEDURES CALLED
* NP$MSG ISSUE DAYFILE MESSAGE
* NP$PIOE PROCESS I/O ERROR ON STATISTICS FILE
* NP$SN CONVERT AIP STAT FROM INTEGER TO DECIMAL
* DISPLAY AND WRITE TO STATISTICS FILE
* NP$TIM GET SYSTEM TIME
* NP$WRTR WRITE END OF RECORD TO FILE
* NP$WRTW WRITE WORDS TO CIO BUFFER FROM WSA
* NP$XCDD CONVERT TO DECIMAL DISPLAY
*
* 8. DAYFILE/DIAGNOSTIC MESSAGES
* NONE.
*
#
*ENDIF
BEGIN
*CALL NP$CRT
*IF,DEF,STAT
# #
# ROUTINE CALLED #
# #
XREF
BEGIN
PROC NP$SN; # OUTPUTS LINE TO ZZZZZSN #
PROC NP$MSG; # ISSUE DAYFILE MESSAGE #
PROC NP$PIOE; # PROCESS I/O ERROR ON DISK FILE#
PROC NP$TIM; # GETS ACCUMULATED CPU TIME #
PROC NP$WRTR; # WRITES AN EOR TO OUTPUT FILE #
PROC NP$WRTW; # WRITES A LINE TO OUTPUT FILE #
FUNC NP$XCDD C(10); # CONVERT INT TO DEC DISPLAY #
END
# #
# LOCAL VARIABLES #
# #
ITEM
CHARWD C(10),
I I, # TEMPORARY INDEX #
SPRTAT B; # TRUE IF NP$SPRT DETECT I/O ERR#
ARRAY HEADING P(6);
ITEM
HDNG$CC C(0,0,10)=["0 "],
HDNG$FMT1 C(1,0,16)=["CPU TIME USED: "],
CPU$TIME C(2,36,10),
HDNG$FMT2 C(3,36,1)=["."],
CPU$TIMA C(3,42,3),
HDNG$FMT3 C(4,0,4)=[" SEC"],
HDNG$FMT4 I(5,0,60)=[0];
ARRAY HEADINGA P(7);
ITEM
HDNG$CCA C(0,0,10)=["0 "],
HDNG$FMT1A C(1,0,10)=["NUMBER OF "],
HDNG$MSG C(2,0,40),
HDNG$FMT2A I(6,0,60)=[0];
ARRAY STATMSG [0:7] P(5);
ITEM
STATMSGT U(0,0,60)=[TYPE"GDM",
TYPE"GMM",
TYPE"GSM",
TYPE"GMD",
TYPE"GSD",
TYPE"GMWD",
TYPE"GSWD",
TYPE"GMR"],
STATMSGS C(1,0,40)=["DISCARDED UPLINE MESSAGES",
"GET DATA MSG WORKLIST TRANSFERS",
"GET SUP MSG WORKLIST TRANSFERS",
"DATA MSGS TRANSFERRED TO AIP DATA QUEUE",
"SUP MSGS TRANSFERRED TO AIP SM QUEUE",
"DATA WDS TRANSFERRED TO AIP DATA QUEUE",
"SUP MSG WDS TRANSFERRED TO AIP SM QUEUE",
"TIMES AIP DATA QUEUE RESET"];
CONTROL EJECT;
#**********************************************************************#
# #
# NP$SPRT EXECUTION BEGINS HERE #
# #
SPRTAT = FALSE; # INIT I/O ERR DETECTED FLAG #
NP$TIM(ST$TIM[1]); # GET ACCUMULATED CPU TIME #
IF CPMLSECS[0] GR CPMLSECS[1]
THEN
BEGIN
CPMLSECS[1] = CPMLSECS[1] + 1000;
CPSECS[1] = CPSECS[1] - 1;
END
CHARWD = NP$XCDD(CPSECS[1] - CPSECS[0]);
CPU$TIME = CHARWD;
CHARWD = NP$XCDD(CPMLSECS[1] - CPMLSECS[0]);
CPU$TIMA = C<7,3> CHARWD;
IF C<0,1>CPU$TIMA EQ " " # ZERO LEADING BLANKS #
THEN
C<0,1>CPU$TIMA = "0";
IF C<1,1>CPU$TIMA EQ " "
THEN
C<1,1>CPU$TIMA = "0";
NP$WRTW(SN$FET,HEADING,6); # WRITE CPU TIME ENTRY TO CIO BF#
HDNG$MSG = "PROCEDURE CALLS";
NP$WRTW(SN$FET,HEADINGA,7);
PRNT = TRUE;
FOR I = TYPE"CHEK" STEP 1 UNTIL TYPE"WAIT"
DO
BEGIN
NP$SN(I);
END
HDNG$MSG = "WORKLIST TRANSFER ATTEMPTS";
NP$WRTW(SN$FET,HEADINGA,7);
NP$SN(TYPE"WLX");
NP$SN(TYPE"WLNX");
HDNG$MSG = "INPUT/OUTPUT BLOCKS TRANSFERRED";
NP$WRTW(SN$FET,HEADINGA,7);
FOR I = TYPE"INB" STEP 1 UNTIL TYPE"OSB4"
DO
BEGIN
NP$SN(I);
END
FOR I = 0 STEP 1 UNTIL 7
DO
BEGIN
IF STAT[STATMSGT[I]] NQ 0
THEN # STATISTICS DATA EXISTS #
BEGIN
HDNG$MSG = STATMSGS[I]; # TEXT OF STATISTICS TYPE #
NP$WRTW(SN$FET,HEADINGA,7);
NP$SN(STATMSGT[I]); # OUTPUT STATISTICS DATA #
END
END
IF (STAT[TYPE"ERRS"] NQ 0) OR
(STAT[TYPE"NAKS"] NQ 0)
THEN
BEGIN
HDNG$MSG = "ERRORS";
NP$WRTW(SN$FET,HEADINGA,7);
NP$SN(TYPE"ERRS");
NP$SN(TYPE"NAKS");
END
PRNT = FALSE;
NP$WRTR(SN$FET,1);
IF SN$AT[0] NQ 0
THEN # WRITE ERROR OCCURRED ON FILE #
BEGIN
NP$PIOE(SN$FET); # PROCESS I/O ERROR ON FILE #
END
*ENDIF
RETURN;
END #NP$SPRNT#
TERM