User Tools

Site Tools


cdc:nos2.source:nam5871:netstc

NETSTC

Table Of Contents

  • [00005] PROC NETSTC((OPTION),STSTAT)
  • [00069] PROC NP$CLK
  • [00070] PROC NP$DATE
  • [00071] PROC NP$PIOE
  • [00072] PROC NP$SPRT
  • [00073] PROC NP$TIM
  • [00074] PROC NP$WRTW
  • [00098] ENTRY PROC QTSTC((OPTION),STSTAT)

Source Code

NETSTC.txt
  1. *DECK NETSTC
  2. *IF,DEF,STAT
  3. USETEXT NP$STAT
  4. *ENDIF
  5. PROC NETSTC((OPTION),STSTAT);
  6. *IF DEF,IMS
  7. #
  8. *1DC NETSTC
  9. * 1. PROC NAME AUTHOR DATE
  10. * NETSTC S. KRULEVITCH 77/07/11
  11. *
  12. * 2. FUNCTIONAL DESCRIPTION
  13. * PROCESSES THE NETSTC CALL FROM AN APPLICATION. STATISTICS
  14. * LOGGING IS STARTED OR TERMINATED ACCORDING TO OPTION = 0
  15. * OR 1, WHEN AIP IS COMPILED WITH *DEFINE STAT. OTHERWISE
  16. * STATUS = 1 IS RETURNED INDICATING THE STATISTICS LOGGING
  17. * OPTION IS NOT ON.
  18. *
  19. * 3. METHOD USED
  20. * MOST OF THE LOGIC IN THIS PROCEDURE IS CONDITIONALLY COMPILED.
  21. * WHEN *DEFINE,STAT IS NOT USED, STSTAT IS SET EQUAL TO 1 AND
  22. * CONTROL IS RETURNED TO CALLER. WHEN *DEFINE, STAT IS USED,
  23. * STATISTICS LOGGING IS TURNED ON IF OPTION = 0 OR OFF IF
  24. * OPTION = 1, AND STSTAT IS SET EQUAL TO ZERO. THE CALL TO NETSTC
  25. * IS LOGGED ON FILE ZZZZZSN.
  26. *
  27. * 4. ENTRY CONDITIONS
  28. * OPTION=0 TURN STATISTICS LOGGING ON
  29. * NOT 0 TURN STATISTICS LOGGING OFF
  30. *
  31. * 5. EXIT CONDITIONS
  32. * STSTAT = 0 STATISTICS LOGGING AVAILABLE
  33. * NOT 0 STATISTICS LOGGING NOT AVAILABLE.
  34. * STATON IS SET TRUE OR FALSE AS REQUESTED BY OPTION EQUAL TO
  35. * 0 OR 1.
  36. *
  37. * 6. COMDECKS CALLED AND SYMPL TEXTS USED.
  38. * NP$CRT NP$STAT
  39. *
  40. * 7. PROCEDURES/FUNCTIONS CALLED
  41. * NP$CLK
  42. * NP$DATE
  43. * NP$PIOE - PROCESS I/O ERROR ON FILE
  44. * NP$SPRT
  45. * NP$TIM
  46. * NP$WRTW
  47. *
  48. * 8. DAYFILE/DIAGNOSTIC MESSAGES
  49. * NONE
  50. *
  51. *
  52.  #
  53. CONTROL EJECT;
  54. *ENDIF
  55. BEGIN
  56. *CALL NP$CRT
  57. # #
  58. # FORMAL PARAMETERS #
  59. # #
  60. ITEM
  61. OPTION I, #0 TO TURN ON LOGGING,ELSE 1 #
  62. STSTAT I; #0 IF STAT IS DEFINED,ELSE 1 #
  63. *IF DEF,STAT
  64. # #
  65. # EXTERNAL ROUTINES #
  66. # #
  67. XREF
  68. BEGIN
  69. PROC NP$CLK;
  70. PROC NP$DATE;
  71. PROC NP$PIOE; # PROCESS I/O ERROR #
  72. PROC NP$SPRT; #DUMPS STATISTICS TO ZZZZZSN #
  73. PROC NP$TIM; #GETS ACCUMULATED CPU TIME #
  74. PROC NP$WRTW;
  75. END
  76. # #
  77. # LOCAL DECLARATIONS #
  78. # #
  79. ITEM CHARWD C(10);
  80. ARRAY STMSG P(5);
  81. ITEM
  82. ST$CC C(0,0,10)=["0 "], #DOUBLE SPACE #
  83. ST$MSG1 C(1,0,35)=["NAM STATISTICS GATHERING "],
  84. ST$MSG2 C(3,30,10);
  85. ARRAY STMSGA P(6);
  86. ITEM
  87. ST$CCA C(0,0,10)=[" "], #SINGLE SPACE #
  88. ST$MSG3 C(1,0,13)=["NETSTC DATE "],
  89. ST$DATE C(2,18,10),
  90. ST$MSG4 C(3,18,7)=[" TIME"],
  91. ST$TIME C(4,0,10),
  92. ST$EOLA I(5,0,60)=[0];
  93. *ENDIF
  94. # #
  95. # NETSTC EXECUTION BEGINS HERE #
  96. # #
  97.  
  98. ENTRY PROC QTSTC((OPTION),STSTAT); # QTRM ENTRY POINT FOR PROC #
  99.  
  100. STSTAT = 1;
  101. *IF DEF,STAT
  102. IF OPTION EQ 0
  103. THEN
  104. BEGIN
  105. ST$MSG2 = "STARTED ";
  106. STATON = TRUE; #TURN ON STATISTICS GATHERING #
  107. NP$TIM(ST$CLK[0]); #CPU STARTING TIME #
  108. END
  109. ELSE
  110. BEGIN
  111. ST$MSG2 = "TERMINATED";
  112. STATON = FALSE;
  113. END
  114. NP$DATE(CHARWD); #PUT CURRENT DATE IN OUTPUT LINE #
  115. ST$DATE = CHARWD;
  116. NP$CLK(CHARWD); #GET TIME IN DISPLAY CODE #
  117. ST$TIME = CHARWD; #PUT DISPLAY CODE TIME IN CHARACTER ARRAY #
  118. NP$WRTW(SN$FET,STMSG,5);
  119. NP$WRTW (SN$FET,STMSGA,6);
  120. #
  121.   CHECK FOR I/O ERROR IN STATISTICS FILE
  122. #
  123. IF SN$AT[0] NQ 0
  124. THEN # I/O ERROR HAS OCCURRED ON FILE#
  125. BEGIN
  126. NP$PIOE(SN$FET); # PROCESS I/O ERROR #
  127. END
  128. IF NOT STATON
  129. THEN
  130. NP$SPRT; #WHEN STATISTIC GATHERING IS TERMINATED THEN DUMP #
  131. #STATISTICS TO ZZZZZSN. #
  132. STSTAT = 0;
  133. *ENDIF
  134. RETURN;
  135. END #NETSTC#
  136. TERM
cdc/nos2.source/nam5871/netstc.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator