User Tools

Site Tools


cdc:nos2.source:nam5871:csesda

CSESDA

Table Of Contents

  • [00007] PROC CSESDA
  • [00008] SEND DI ACCOUNTING DATA.
  • [00011] SEND DI ACCOUNTING DATA.
  • [00061] PROC MESSAGE
  • [00062] PROC SSBEBF
  • [00063] PROC SSBSBF
  • [00064] FUNC SSDCAD U
  • [00065] FUNC XCDD U

Source Code

CSESDA.txt
  1. *DECK CSESDA
  2. USETEXT TEXTOV
  3. USETEXT TEXTCS
  4. USETEXT TEXTSS
  5. USETEXT TXTAPSS
  6. USETEXT TXTSMCS
  7. PROC CSESDA;
  8. # TITLE - SEND DI ACCOUNTING DATA. #
  9. BEGIN
  10. #
  11. ** CSESDA - SEND DI ACCOUNTING DATA.
  12. *
  13. * D.K. ENDO 84/11/19
  14. *
  15. * THIS PROCEDURE FORMATS STATISTICS INFORMATION FROM THE DI. IT
  16. * THEN SENDS IT OUT TO THE SYSTEM ACCOUNT FILES.
  17. *
  18. * PROC CSESDA
  19. *
  20. * ENTRY 1. STI/TE/U AND STI/AP/U FROM THE EVENT QUEUE.
  21. *
  22. * EXIT 1. STATISTICS INFO SENT TO THE SYSTEM ACCOUNT FILES.
  23. *
  24. *
  25. * ACCOUNT DAYFILE MESSAGE FORMATS:
  26. *
  27. * *SCTE, C1, DEVICE_NAME.
  28. * *SCTE, C2, DEVICE_TYPE.
  29. * *SCTE, C3, DESTINATION_SERVICE.
  30. * *SCTE, C4, DI_NAME_OR_ADDRESS.
  31. * *SCTE, C5, LIM, PRT, VVVV.
  32. * *SCTE, C6, TTTTTTRRRRRRSSSSSS.
  33. * *SCTE, C7, CCCCCC.
  34. * *SCTE, C8, CONNECT_TIME.
  35. *
  36. * *SCAP, C1, SOURCE_SERVICE.
  37. * *SCAP, C2, DESTINATION_SERVICE.
  38. * *SCAP, C3, DI_NAME_OR_ADDRESS.
  39. * *SCAP, C4, MMM, PRT, VVVV.
  40. * *SCAP, C5, TTTTTTRRRRRRSSSSSS.
  41. * *SCAP, C6, CCCCCC.
  42. * *SCAP, C7, CONNECT_TIME.
  43. *
  44. * WHERE:
  45. *
  46. * LIM = LINE INTERFACE MODULE
  47. * MMM = LIM OR MAINFRAME CHANNEL INTERFACE
  48. * PRT = PORT NUMBER ON THE LIM
  49. * VVVV = X.25 VIRTUAL CIRCUIT NUMBER
  50. * TTTTTT = BLOCKS/PACKETS TRANSFERRED
  51. * RRRRRR = BLOCKS/PACKETS RECEIVED
  52. * SSSSSS = CHARACTERS TRANSFERRED
  53. * CCCCCC = CHARACTERS RECEIVED.
  54. *
  55. #
  56. #
  57. **** PROC CSESDA - XREF LIST BEGINS.
  58. #
  59. XREF
  60. BEGIN
  61. PROC MESSAGE; # SEND TEXT TO SYSTEM ACCOUNT FILE #
  62. PROC SSBEBF; # EXTRACT BIT FIELD #
  63. PROC SSBSBF; # STORE BIT FIELD #
  64. FUNC SSDCAD U; # CONVERT ASCII TO DISPLAY CODE #
  65. FUNC XCDD U; # CONVERT DECIMAL VALUE TO DISPLAY CODE #
  66. END
  67. #
  68. ****
  69. #
  70. DEF ACCT$ # 5 #; # IDENTIFIER FOR ACCOUNT FILE #
  71. DEF ABLANK$ # X"20" #; # ASCII BLANK #
  72.  
  73. ITEM BITS; # BIT PRSITION IN WORD -- STORE #
  74. ITEM BITX; # BIT POSITION IN WORD -- EXTRACT #
  75. ITEM CHR I = 0; # TEMPORARY TO STORE CHARACTER IN #
  76. ITEM FINISHED B; # FLAG INDICATING STATUS OF CONVERSION #
  77. ITEM I; # LOOP VARIABLE #
  78. ITEM WORDS; # WORD POSITION -- STORE #
  79. ITEM WORDX; # WORD POSITION -- EXTRACT #
  80.  
  81. #
  82. * THIS ARRAY DEFINES THE STATISTICS TEXT FORMAT THAT IS SENT WHEN
  83. * THE PROC IS INVOKED.
  84. #
  85. ARRAY DIS$TXT [00:00] S(5);
  86. BEGIN
  87. ITEM DIS$SC C(00,00,02) = ["SC"];
  88. ITEM DIS$TYPE C(00,12,02); # STATISTIC TYPE -- TE/AP #
  89. ITEM DIS$C1 C(00,24,03) = [", C"];
  90. ITEM DIS$CNUM C(00,42,01); # LINE NUMBER #
  91. ITEM DIS$UNUM U(00,42,06);
  92. ITEM DIS$C2 C(00,48,12) = [", "];
  93. ITEM DIS$TEXT C(01,00,31); # TEXT LINES #
  94. ITEM DIS$LIM U(01,00,06); # LINE INTRFACE MODULE (1..7) #
  95. ITEM DIS$COMMA1 C(01,06,02);
  96. ITEM DIS$PORT U(01,18,06); # LIM PORT NUMBER (1..3) #
  97. ITEM DIS$COMMA2 C(01,24,02);
  98. ITEM DIS$VCIR U(01,36,24); # VIRTUAL CIRCUIT NUMBER #
  99. ITEM DIS$CNT1 U(01,00,36); # BLKS XFERRED AND CHARS RCV-ED #
  100. ITEM DIS$CNT21 U(01,36,24); # BLOCKS RECEIVED #
  101. ITEM DIS$CNT22 U(02,00,12);
  102. ITEM DIS$CNT3 U(02,12,36); # CHARACTERS TRANSFERRED #
  103. END
  104. #
  105. * THIS ARRAY IS USED AS A CONSTANT FOR TERMINATING THE ACCOUNT
  106. * MESSAGES.
  107. #
  108. ARRAY END$TXT [00:00] S(1);
  109. BEGIN
  110. ITEM ETX$PER C(00,36,01) = ["."];
  111. ITEM ETX$ZBYT U(00,42,18) = [0];
  112. END
  113. #
  114. * THIS ARRAY IS USED AS A TEMPORARY FOR AN INTEGER ITEM.
  115. #
  116. ARRAY ITEMP2 [00:00] S(1);
  117. BEGIN
  118. ITEM IT2$CNST1 U(00,44,04);
  119. ITEM IT2$CNST2 U(00,48,12);
  120. ITEM IT2$ZERO I(00,00,60) = [0];
  121. END
  122. CONTROL EJECT;
  123. #
  124. * CSESDA CODE BEGINS HERE
  125. #
  126. #
  127. * IF THIS SM IS STI/TE/U, THEN SET THE MESSAGE TYPE TO *TE*, ELSE
  128. * ASSUME THAT THE MESSAGE IS STI/TE/U AND SET THE MESSAGE TYPE TO
  129. * *AP*.
  130. #
  131. IF WCB$SMID[0] EQ SMID"STITE"
  132. THEN
  133. BEGIN
  134. DIS$TYPE[0] = "TE";
  135. END
  136. ELSE
  137. BEGIN
  138. DIS$TYPE[0] = "AP";
  139. END
  140. #
  141. * EXTRACT THE FIRST ASCII STRING IN SM AND STORE IT IN THE
  142. * ACCOUNT MESSAGE BUFFER, SET THE LINE NUMBER, TERMINATE THE
  143. * THE MESSAGE, AND SEND IT TO THE ACCOUNT DAYFILE.
  144. #
  145. DIS$CNUM[0] = "1";
  146.  
  147. FINISHED = FALSE;
  148. WORDX = 0;
  149. BITX = 16;
  150. WORDS = 1;
  151. BITS = 0;
  152. FOR I=1 STEP 1 WHILE NOT FINISHED AND
  153. I LQ 7
  154. DO
  155. BEGIN
  156. SSBEBF(MSGBUF[0],WORDX,BITX,8,CHR);
  157. IF CHR EQ ABLANK$
  158. THEN
  159. BEGIN
  160. FINISHED = TRUE;
  161. END
  162. ELSE
  163. BEGIN
  164. SSBSBF(DIS$TXT,WORDS,BITS,6,SSDCAD(CHR));
  165. END
  166. END
  167.  
  168. SSBSBF(DIS$TXT,WORDS,BITS,24,END$TXT);
  169.  
  170. MESSAGE(DIS$TXT,ACCT$);
  171. #
  172. * IF THE SM IS STI/TE, THEN EXTRACT THE DEVICE TYPE, CONVERT
  173. * IT TO DISPLAY CODE AND STORE IT IN THE MESSAGE BUFFER.
  174. #
  175. IF WCB$SMID[0] EQ SMID"STITE"
  176. THEN
  177. BEGIN
  178. DIS$UNUM[0] = DIS$UNUM[0] + 1;
  179.  
  180. WORDX = 1;
  181. BITX = 12;
  182. WORDS = 1;
  183. BITS = 0;
  184. FOR I=1 STEP 1 UNTIL 3
  185. DO
  186. BEGIN
  187. SSBEBF(MSGBUF[0],WORDX,BITX,8,CHR);
  188. SSBSBF(DIS$TXT,WORDS,BITS,6,SSDCAD(CHR));
  189. END
  190.  
  191. SSBSBF(DIS$TXT,WORDS,BITS,24,END$TXT);
  192.  
  193. MESSAGE(DIS$TXT,ACCT$);
  194. END
  195. #
  196. * EXTRACT THE NEXT ASCII STRING IN SM AND STORE IT IN THE
  197. * ACCOUNT MESSAGE BUFFER, SET THE LINE NUMBER, TERMINATE THE
  198. * THE MESSAGE, AND SEND IT TO THE ACCOUNT DAYFILE.
  199. #
  200. DIS$UNUM[0] = DIS$UNUM[0] + 1;
  201.  
  202. FINISHED = FALSE;
  203. WORDX = 1;
  204. BITX = 36;
  205. WORDS = 1;
  206. BITS = 0;
  207. FOR I=1 STEP 1 WHILE NOT FINISHED AND
  208. I LQ 31
  209. DO
  210. BEGIN
  211. SSBEBF(MSGBUF[0],WORDX,BITX,8,CHR);
  212. IF CHR EQ ABLANK$
  213. THEN
  214. BEGIN
  215. FINISHED = TRUE;
  216. END
  217. ELSE
  218. BEGIN
  219. SSBSBF(DIS$TXT,WORDS,BITS,6,SSDCAD(CHR));
  220. END
  221. END
  222.  
  223. SSBSBF(DIS$TXT,WORDS,BITS,24,END$TXT);
  224.  
  225. MESSAGE(DIS$TXT,ACCT$);
  226. #
  227. * EXTRACT THE NEXT ASCII STRING IN SM AND STORE IT IN THE
  228. * ACCOUNT MESSAGE BUFFER, SET THE LINE NUMBER, TERMINATE THE
  229. * THE MESSAGE, AND SEND IT TO THE ACCOUNT DAYFILE.
  230. #
  231. DIS$UNUM[0] = DIS$UNUM[0] + 1;
  232.  
  233. FINISHED = FALSE;
  234. WORDX = 5;
  235. BITX = 44;
  236. WORDS = 1;
  237. BITS = 0;
  238. FOR I=1 STEP 1 WHILE NOT FINISHED AND
  239. I LQ 31
  240. DO
  241. BEGIN
  242. SSBEBF(MSGBUF[0],WORDX,BITX,8,CHR);
  243. IF CHR EQ ABLANK$
  244. THEN
  245. BEGIN
  246. FINISHED = TRUE;
  247. END
  248. ELSE
  249. BEGIN
  250. SSBSBF(DIS$TXT,WORDS,BITS,6,SSDCAD(CHR));
  251. END
  252. END
  253.  
  254. SSBSBF(DIS$TXT,WORDS,BITS,24,END$TXT);
  255.  
  256. MESSAGE(DIS$TXT,ACCT$);
  257. #
  258. * CONVERT THE LIM/MCI, LIM PORT, AND VIRTUAL CIRCUIT NUMBERS AND
  259. * STORE THEM IN THE ACCOUNTING MESSAGE, SET THE LINE NUMBER, SEPA-
  260. * THE VALUES BY COMMAS, TERMINATE THE MESSAGE, AND SEND IT TO THE
  261. * ACCOUNT DAYFILE.
  262. #
  263. DIS$LIM[0] = XCDD(STILIM[0]);
  264. DIS$PORT[0] = XCDD(STIPN[0]);
  265. DIS$VCIR[0] = XCDD(STIVCN[0]);
  266.  
  267. DIS$UNUM[0] = DIS$UNUM[0] + 1;
  268.  
  269. DIS$COMMA1[0] = ", ";
  270. DIS$COMMA2[0] = ", ";
  271.  
  272. WORDS = 2;
  273. BITS = 0;
  274. SSBSBF(DIS$TXT,WORDS,BITS,24,END$TXT);
  275.  
  276. MESSAGE(DIS$TXT,ACCT$);
  277. #
  278. * CONVERT THE BLOCKS TRANSMITTED, BLOCKS RECEIVED, AND CHARACTERS
  279. * TRANSMETTED VALUES AND PUT THEM IN THE ACCOUNT MESSAGE BUFFER,
  280. * TERMINATE THE MESSAGE, AND SEND IT TO THE ACCOUNT DAYFILE.
  281. #
  282. DIS$CNT1[0] = XCDD(STIDBT[0]);
  283. WORDS = 1;
  284. BITS = 36;
  285. SSBSBF(DIS$TXT,WORDS,BITS,36,XCDD(STIDBR[0]));
  286. IT2$CNST1[0] = STIDCT1[0];
  287. IT2$CNST2[0] = STIDCT2[0];
  288. DIS$CNT3[0] = XCDD(ITEMP2);
  289.  
  290. DIS$UNUM[0] = DIS$UNUM[0] + 1;
  291.  
  292. WORDS = 2;
  293. BITS =48;
  294. SSBSBF(DIS$TXT,WORDS,BITS,24,END$TXT);
  295.  
  296. MESSAGE(DIS$TXT,ACCT$);
  297. #
  298. * EXTRACT THE NUMBER OF CHARACTERS RECEIVED, CONVERT IT, STORE
  299. * IT IN THE ACCOUNT MESSAGE BUFFER, SET THE LINE NUMBER, TER-
  300. * MINATE THE MESSAGE, AND SEND IT THE THE ACCOUNT DAYFILE.
  301. #
  302. DIS$CNT1[0] = XCDD(STIDCR[0]);
  303.  
  304. DIS$UNUM[0] = DIS$UNUM[0] + 1;
  305.  
  306. WORDS = 1;
  307. BITS = 36;
  308. SSBSBF(DIS$TXT,WORDS,BITS,24,END$TXT);
  309.  
  310. MESSAGE(DIS$TXT,ACCT$);
  311. #
  312. * EXTRACT THE CONNECT TIME STRING IN SM AND STORE IT IN THE
  313. * ACCOUNT MESSAGE BUFFER, SET THE LINE NUMBER, TERMINATE THE
  314. * THE MESSAGE, AND SEND IT TO THE ACCOUNT DAYFILE.
  315. #
  316. DIS$CNT1[0] = XCDD(STITI[0]);
  317.  
  318. DIS$UNUM[0] = DIS$UNUM[0] + 1;
  319.  
  320. WORDS = 1;
  321. BITS = 36;
  322. SSBSBF(DIS$TXT,WORDS,BITS,24,END$TXT);
  323.  
  324. MESSAGE(DIS$TXT,ACCT$);
  325.  
  326.  
  327. END # CSESDA #
  328. TERM
cdc/nos2.source/nam5871/csesda.txt ยท Last modified: 2023/08/05 17:21 by Site Administrator