User Tools

Site Tools


cdc:nos2.source:nam5871:nvftiam

NVFTIAM

Table Of Contents

  • [00005] PROC NVFTIAM1)
  • [00006] NVFTIAM - ISSUE ACCOUNTING MESSAGE
  • [00010] ISSUE ACCOUNTING MESSAGE.
  • [00067] PROC MESSAGE
  • [00068] PROC NVFTCCT
  • [00069] PROC SSBEBF
  • [00070] PROC SSBSBF
  • [00255] PROC EXTRACT
  • [00256] EXTRACT - EXTRACT NONZERO AND NONBLANK CHARACTERS
  • [00260] EXTRACT - EXTRACT NONZERO AND NONBLANK CHARACTERS.

Source Code

NVFTIAM.txt
  1. *DECK NVFTIAM
  2. USETEXT TEXTNVF
  3. USETEXT TXTANVF
  4.  
  5. PROC NVFTIAM((PT),(MTYP));
  6. # TITLE NVFTIAM - ISSUE ACCOUNTING MESSAGE #
  7.  
  8. BEGIN # NVFTIAM #
  9. #
  10. ** NVFTIAM - ISSUE ACCOUNTING MESSAGE.
  11. *
  12. * E. THAVIKULWAT 81/10/22
  13. *
  14. * THIS PROCEDURE ISSUES ACCOUNT MESSAGES TO THE SYSTEM'S ACCOUNT
  15. * DAYFILE. IT IS CALLED INTO EXECUTION BY THE FOLLOWING
  16. * PROCEDURES:
  17. * *NVFTACC* *NVFTCRN* *NVFTETC* *NVFTPSV* *NVFTRVD*
  18. * *NVFTPUV*
  19. *
  20. * PROC NVFTIAM((PT),(MTYP))
  21. *
  22. * ENTRY:
  23. * PT = POINTER TO PTAC ENTRY
  24. * MTYP = TYPE OF ACCOUNT MESSAGE TO ISSUE:
  25. * 1 = ABUN
  26. * 2 = AEUN
  27. * 3 = ABAP
  28. * 4 = AEAP
  29. * 5 = ABER
  30. *TEXT
  31. * 6 = ABIC
  32. * 7 = SIPI
  33. *ENDTEXT
  34. *
  35. * EXIT:
  36. * APPROPRIATE ACCOUNT MESSAGE ISSUED TO THE SYSTEM'S ACCOUNT
  37. * DAYFILE.
  38. *
  39. * NOTES:
  40. * FOLLOWING ARE THE FORMATS OF THE ACCOUNT MESSAGES:
  41. * 1) ABUN, USERNUM, FAMNAME, TRMNAME.
  42. * 2) AEUN, C1, USERNUM, FAMNAME, TRMNAME.
  43. * AEUN, C2, XXXXXXSECS.
  44. * 3) ABAP, C1, USERNUM, FAMNAME, TRMNAME.
  45. * ABAP, C2, APPNAME.
  46. * 4) AEAP, C1, USERNUM, FAMNAME, TRMNAME.
  47. * AEAP, C2, APPNAME, XXXXXXSECS.
  48. * 5) ABER, USERNUM, FAMNAME, TRMNAME.
  49. *TEXT
  50. * 6) ABIC, CHARNUMBER, PROJNUMBER, TRMNAME.
  51. * 7) SIPI, PERSONAL IDENTIFIER.
  52. *ENDTEXT
  53. *
  54. * METHOD:
  55. * FOR EACH PARAMETER OF THE ACCOUNT MESSAGE, CALL INTERNAL
  56. * PROCEDURE *EXTRACT* TO DELETE TRAILING ZEROES AND BLANKS.
  57. * WHEN MESSAGE IS COMPLETE, CALL MACREL ROUTINE *MESSAGE* TO
  58. * SEND IT TO THE ACCOUNT DAYFILE.
  59. #
  60.  
  61. #
  62. **** PROC NVFTIAM - XREF LIST.
  63. #
  64.  
  65. XREF
  66. BEGIN
  67. PROC MESSAGE; # SEND MESSAGE #
  68. PROC NVFTCCT; # CALCULATE APPLICATION CONNECT TIME #
  69. PROC SSBEBF; # EXTRACT BIT FIELDS #
  70. PROC SSBSBF; # STORE BIT FIELDS #
  71. END
  72.  
  73. #
  74. ****
  75. #
  76. DEF COMMA$ #O"5655"#; # COMMA FOLLOWED BY ONE BLANK #
  77. DEF PERIOD$ #O"57000000"#; # PERIOD FOLLOWED BY ZERO BYTE #
  78. DEF SECS$ #O"2305032357000000"#; # "SECS." FOLLOWED BY 0 BYTE#
  79.  
  80. ITEM BITSBF I; # STARTING BIT OF MESSAGE ASSEMBLY AREA #
  81. ITEM EBFNAME C(20); # NAME TO BE ENTERED IN MESSAGE #
  82. ITEM I I; # LOOP VARIABLE #
  83. ITEM LEN I; # NUMBER OF BITS TO STORE #
  84. ITEM MTYP I; # TYPE OF ACCOUNT MESSAGE TO ISSUE #
  85. ITEM ORDSBF I; # STARTING WORD OF MESSAGE ASSEMBLY AREA #
  86. ITEM PT I; # SUBSCRIPT FOR ARRAY PTAC #
  87. ITEM CNTYP I; # CONNECTION TYPE INDICATOR #
  88. ITEM TEMP I; # TEMPORARY STORAGE AREA #
  89. ITEM TERMVAL I; # NUMBER OF PARAMS IN ACCOUNT MESSAGE - 1 #
  90.  
  91. #
  92. * FOLLOWING ARRAY IS THE ASSEMBLY AREA FOR THE ACCOUNT MESSAGES.
  93. #
  94. ARRAY ACCMSG[00:00] S(6);
  95. BEGIN
  96. ITEM ACC$TYP C(00,00,10); # MESSAGE TYP #
  97. ITEM ACC$C2 C(00,36,02); # AREA FOR LITERAL C2 #
  98. END
  99.  
  100. #
  101. * FOLLOWING ARRAY DEFINES THE TYPE OF ACCOUNT MESSAGES.
  102. #
  103. ARRAY ACCTYP[00:06] S(1);
  104. BEGIN
  105. ITEM ACT$WORD C(00,00,10); # FULL WORD REFERENCE #
  106. ITEM ACT$TYPE C(00,00,10) =
  107. ["ABUN, ","AEUN, C1, ","ABAP, C1, ","AEAP, C1, ","ABER, ",
  108. "ABIC, ","SIPI, "];
  109. END
  110.  
  111. #
  112. * INFORMATION TO BE ENTERED INTO THE ACCOUNT MESSAGES ARE SAVED
  113. * IN THE FOLLOWING ARRAY.
  114. #
  115. ARRAY VALUES[00:02] S(2);
  116. BEGIN
  117. ITEM VAL$WORD C(00,00,20);
  118. END
  119.  
  120. IF (MTYP EQ SIPI$)
  121. THEN # SET PERSONAL IDENTIFIER #
  122. BEGIN
  123. VAL$WORD[0] = PTA$PID[PT];
  124. END
  125. ELSE
  126. BEGIN
  127. IF (MTYP EQ ABIC$)
  128. THEN # SET CHARGE AND PROJECT NUMBER #
  129. BEGIN
  130. VAL$WORD[0] = PTA$CHGNUM[PT];# CHARGE NUMBER #
  131. VAL$WORD[1] = PTA$PRJNUM[PT];# PROJECT NUMBER #
  132. END
  133. ELSE # SET USER NAME AND FAMILY NAME #
  134. BEGIN
  135. VAL$WORD[0] = PTA$UNUM[PT]; # USER NAME #
  136. VAL$WORD[1] = PTA$FNAM[PT]; # FAMILY NAME #
  137. END
  138. VAL$WORD[2] = PTA$TN[PT]; # SET TERMINAL NAME #
  139. END
  140.  
  141. ACC$TYP[0] = ACT$WORD[MTYP-1]; # MESSAGE TYPE TO ASSEMBLY AREA #
  142. #
  143. * BUILD VARIABLE PORTION OF ACCOUNT MESSAGE.
  144. #
  145. IF (MTYP EQ ABUN$) OR (MTYP EQ ABIC$)
  146. OR (MTYP EQ ABER$) OR (MTYP EQ SIPI$)
  147. THEN # ABUN/ABIC/ABER/SIPI MESG #
  148. BEGIN
  149. ORDSBF = 0;
  150. BITSBF = 36;
  151. END
  152. ELSE # ABAP/AEAP/AEUN ACCOUNT MESSAGE#
  153. BEGIN
  154. ORDSBF = 1;
  155. BITSBF = 0;
  156. END
  157.  
  158. IF (MTYP EQ ABER$) AND PTA$IFU[PT]
  159. THEN
  160. BEGIN
  161. PTA$IFU[PT]=FALSE;
  162. VAL$WORD[0]=0;
  163. VAL$WORD[1]=0;
  164. END
  165.  
  166. TEMP = COMMA$;
  167. LEN = 12;
  168. IF (MTYP EQ SIPI$)
  169. THEN
  170. BEGIN
  171. TERMVAL = 0;
  172. END
  173. ELSE
  174. BEGIN
  175. TERMVAL = 2;
  176. END
  177.  
  178. FOR I = 0 STEP 1 UNTIL TERMVAL
  179. DO
  180. BEGIN
  181. EBFNAME = VAL$WORD[I];
  182. EXTRACT; # EXTRACT NONZERO/NONBLANK CHAR #
  183. #
  184. * UPON RETURN FROM *EXTRACT*, A COMMA FOLLOWED BY ONE BLANK WILL
  185. * BE INSERTED INTO THE MESSAGE STREAM EXCEPT FOR THE LAST
  186. * PARAMETER. FOR THE LAST PARAMETER, A PERIOD FOLLOWED BY 12
  187. * BITS OF ZERO IS INSERTED INTO THE MESSAGE STREAM INSTEAD.
  188. #
  189. IF I EQ TERMVAL
  190. THEN # LAST PARAMETER #
  191. BEGIN
  192. TEMP = PERIOD$;
  193. LEN = 24;
  194. END
  195.  
  196. SSBSBF(ACCMSG,ORDSBF,BITSBF,LEN,TEMP);
  197. END
  198.  
  199. MESSAGE(ACCMSG,5); # MESSAGE TO ACCOUNT DAYFILE #
  200. #
  201. * FOR ABAP AND AEAP AND AEUN FORM A SECOND LINE OF MESSAGE.
  202. #
  203. IF (MTYP EQ ABAP$) OR (MTYP EQ AEAP$) OR (MTYP EQ AEUN$)
  204. THEN
  205. BEGIN
  206. ACC$C2[0] = "C2";
  207. ORDSBF = 1;
  208. BITSBF = 0;
  209. IF (MTYP NQ AEUN$)
  210. THEN
  211. BEGIN
  212. EBFNAME = PTA$SWTAPP[PT];
  213.  
  214. EXTRACT; # EXTRACT NONBLANK CHARACTERS #
  215. END
  216. #
  217. * IF THE ABAP MESSAGE, INSERT A PERIOD AND ZERO BYTE TERMINATIOR.
  218. * IF AEAP, INSERT COMMA AND BLANK AND CALL *NVFTCCT* TO CALCULATE
  219. * APPLICATION CONNECT TIME, IF AEUN, CALL *NVFTCCT* TO CALCULATE
  220. * TERMINAL SESSION CONNECT TIME.
  221. #
  222. IF (MTYP EQ ABAP$)
  223. THEN # ABAP ACCOUNT MESSAGE #
  224. BEGIN
  225. TEMP = PERIOD$;
  226. LEN = 24;
  227. END
  228. ELSE IF (MTYP EQ AEAP$) # AEAP ACCOUNT MESSAGE #
  229. THEN
  230. BEGIN
  231. TEMP = COMMA$;
  232. LEN = 12;
  233. SSBSBF(ACCMSG,ORDSBF,BITSBF,LEN,TEMP);
  234. CNTYP = TATIME$;
  235. NVFTCCT(PT,0,EBFNAME,CNTYP); # CALC APPL CONNECT TIME #
  236. EXTRACT; # EXTRACT NONBLANK CHARACTERS #
  237. TEMP = SECS$;
  238. LEN = 48;
  239. END
  240. ELSE
  241. BEGIN # AEUN ACCOUNT MESSAGE #
  242. CNTYP=TSTIME$;
  243. NVFTCCT(PT,0,EBFNAME,CNTYP); # CALC TERMINAL SESSION CONN TIM#
  244. EXTRACT;
  245. TEMP=SECS$;
  246. LEN=48;
  247. END
  248.  
  249. SSBSBF(ACCMSG,ORDSBF,BITSBF,LEN,TEMP);
  250. MESSAGE(ACCMSG,5); # MESSAGE TO ACCOUNT DAYFILE #
  251. END
  252.  
  253. CONTROL EJECT;
  254.  
  255. PROC EXTRACT;
  256. # TITLE EXTRACT - EXTRACT NONZERO AND NONBLANK CHARACTERS #
  257.  
  258. BEGIN # EXTRACT #
  259. #
  260. ** EXTRACT - EXTRACT NONZERO AND NONBLANK CHARACTERS.
  261. *
  262. * E. THAVIKULWAT 81/10/22
  263. *
  264. * THIS PROCEDURE IS INTERNAL TO PROCEDURE *NVFTIAM* AND IS CALLED
  265. * ONLY BY *NVFTIAM*. IT'S MAIN FUNCTION IS TO DELETE TRAILING
  266. * ZEROES AND BLANKS FROM NAMES AND STORE IT INTO ACCOUNT MESSAGE
  267. * ASSEMBLY AREA.
  268. *
  269. * PROC EXTRACT
  270. *
  271. * ENTRY:
  272. * *EBFNAME* CONTAINS THE NAME, LEFT JUSTIFIED.
  273. * *ORDSBF* CONTAINS THE STARTING WORD OF MESSAGE ASSEMBLY AREA
  274. * *BITSBF* CONTAINS STARTING BIT OF MESSAGE ASSEMBLY AREA
  275. *
  276. * EXIT:
  277. * NAME WITHOUT TRAILING ZEROES AND BLANKS PACKED INTO ACCOUNT
  278. * MESSAGE ASSEMBLY AREA.
  279. *
  280. * NOTES:
  281. * MAXIMUM LENGTH OF NAME IS 20 DISPLAY CODED CHARACTERS.
  282. *
  283. * METHOD:
  284. * CALL *SSBEBF* TO EXTRACT A 6-BIT CHARACTER. IF NONZERO AND
  285. * NONBLANK, CALL *SSBSBF* TO STORE IT INTO THE MESSAGE ASSEMBLY
  286. * AREA.
  287. #
  288.  
  289. ITEM BITEBF I; # STARTING BIT OF NAME #
  290. ITEM ENDSRCH B; # EXIT LOOP VARIABLE #
  291. ITEM I I; # LOOP VARIABLE #
  292. ITEM ORDEBF I; # STARTING WORD OF NAME #
  293. ITEM TMPCHAR I; # TEMPORARY STORAGE AREA #
  294.  
  295. #
  296. * INITIALIZE VARIABLES.
  297. #
  298. ORDEBF = 0;
  299. BITEBF = 0;
  300. ENDSRCH = FALSE;
  301. #
  302. * EXTRACT AND STORE NONZERO/NONBLANK CHARACTERS.
  303. #
  304. FOR I = 0 STEP 1 WHILE (NOT ENDSRCH AND I LS 20)
  305. DO
  306. BEGIN
  307. SSBEBF(EBFNAME,ORDEBF,BITEBF,6,TMPCHAR);
  308. IF (TMPCHAR EQ 0) OR (TMPCHAR EQ " ")
  309. THEN
  310. BEGIN
  311. ENDSRCH = TRUE;
  312. END
  313. ELSE
  314. BEGIN
  315. SSBSBF(ACCMSG,ORDSBF,BITSBF,6,TMPCHAR);
  316. END
  317. END
  318.  
  319. END # END EXTRACT #
  320.  
  321. END # END NVFTIAM #
  322.  
  323. TERM
1)
PT),(MTYP
cdc/nos2.source/nam5871/nvftiam.txt ยท Last modified: 2023/08/05 17:23 by Site Administrator