User Tools

Site Tools


cdc:nos2.source:nam5871:bldacb

BLDACB

Table Of Contents

  • [00012] PRGM BLDACB
  • [00092] PROC MGROW
  • [00093] PROC MGETS
  • [00094] PROC XTRACE
  • [00095] PROC BLDKWL
  • [00096] PROC DAYTIME

Source Code

BLDACB.txt
  1. *DECK BLDACB
  2. USETEXT NIPDEF
  3. USETEXT ACB
  4. USETEXT ACNT
  5. USETEXT APPSTAT
  6. USETEXT AT
  7. USETEXT PARAMS
  8. USETEXT PT
  9. USETEXT STATTAB
  10. USETEXT KDIS
  11. USETEXT KSTTAB
  12. PRGM BLDACB; # BULID ACB ACNT FOR APPLICATION. #
  13.  
  14. STARTIMS;
  15. #
  16. *1DC BLDACB
  17. *
  18. * 1. PROC NAME AUTHOR DATE
  19. * BLDACB N. NICHOLAS 80/08/14
  20. *
  21. * 2. FUNCTIONAL DESCRIPTION.
  22. * PROCESS ACB AND ACNT BUFFERS.
  23. * FOR APPLICATION NETTING ON.
  24. *
  25. * 3. METHOD USED.
  26. *
  27. * CHECK FOR DUPLICATE JOB-ID. FIND FREE AT ENTRY.
  28. * IF NO FREE ENTRIES AVAILABLE IN AT THEN REQUEST
  29. * A LARGER BUFFER. UPDATE HIGHEST APPLICATION NUMBER
  30. * IN USE IN THE (AT) HEADER. REQUEST A BUFFER FOR
  31. * A APPLICATION CONTROL BLOCK (ACB). FILL IN ACB
  32. * INFORMATION. LINK ACB TO AT ENTRY. UPDATE
  33. * STATUS DISPLAY BUFFER INFORMATION IF NECESSARY.
  34. * REQUEST A BUFFER FOR A APPLICATION CONNECTION
  35. * TABLE (ACNT). FILL IN ACNT HEADER INFORMATION.
  36. * LINK ACB TO ACNT. RETURN WITH APPLICATION
  37. * NUMBER IN PARAMS1.
  38. *
  39. * 4. ENTRY PARAMETER.
  40. *
  41. * PARAMS1 = MINACN MININUM A C N VALUE
  42. * PARAMS2 = MAXACN MAXIMUM A C N VALUE
  43. * PARAMS3 = ANAME APPLICATION NAME
  44. * PARAMS4 = ONADDR DATA AVAILABE WORD
  45. * JOBID = JOBID APPLICATION JOBID WORD
  46. *
  47. * 5. EXIT PARAMETERS.
  48. *
  49. * PARAMS1 = AN
  50. *
  51. * 6. COMDECKS CALLED AND SYMPL TEXT USED.
  52. *
  53. * ACB ACNT AT APPSTAT NIPDEF
  54. * PARAMS PT KDIS
  55. * STATTAB KSTTAB OSSIZE
  56. *
  57. * 7. ROUTINES AND OVERLAYS CALLED.
  58. *
  59. * MGROW COMPASS- WILL GET NEW (AT) BUFFER,TRANSFER
  60. * INFORMATION FROM OLD ( AT ) TO NEW
  61. * ( AT ) AND RELEASE OLD ( AT ) BUFFER.
  62. *
  63. * MGETS COMPASS- WILL GET NEW BUFFERS FOR THE
  64. * APPLICATION CONTROL BLOCK ( AT ) AND
  65. * APPLICATION CONNECTION TABLE ( ACNT ).
  66. *
  67. * KPUT - UPDATE K-DISPLAY STATUS BUFFER
  68. * KADD - ADD NEW LINE TO STATUS DISPLAY SCREEN
  69. * DAYTIME - TIME IN DISPLAY
  70. * XTRACE - TRACE PROCEDURE CALL
  71. *
  72. * 8. DAYFILE MESSAGES AND OTHER INPORTANT INFORMATION.
  73. *
  74. * NO DAYFILE MESSAGES.
  75. * THIS PROGRAM IS A SECONDARY OVERLAY LOADED
  76. * BY SUBROUTINE OVLCALL. WHEN EXECUTION IS
  77. * COMPLETED A JUMP IS MADE TO LOCATION RJMAIN
  78. * TO RETURN TO THE CALLING PROGRAM.
  79. *
  80. * W A R N I N G-THIS PROGRAM CANNOT EXCEED THE SECONDARY
  81. *CALL OSSIZE
  82. *
  83. * THIS OVERLAY IS CALLED BY - H P N O N -
  84. *
  85.  #
  86. STOPIMS;
  87. #
  88.   E X T E R N A L V A R I A B L E S
  89. #
  90. XREF
  91. BEGIN
  92. PROC MGROW; # REQUEST A EXTENDED BUFFER #
  93. PROC MGETS; # REQUEST A NEW BUFFER AREA #
  94. PROC XTRACE; # RECORD PROCEDURE CELLS #
  95. PROC BLDKWL; # FORMAT KWL TO ADD APP ENTRY TO ST #
  96. PROC DAYTIME ;
  97. LABEL RJMAIN; # RETURN ADDRESS IN OVLCALL #
  98. END
  99. #
  100.   I N T E R N A L V A R I A B L E S
  101. #
  102. ITEM UNUSEDAN; # APPLICATION NUMBER ( AN ) #
  103. ITEM TEMPAPI C(1) ;
  104. ITEM AKNDX ;
  105. ITEM KAPP ;
  106. ITEM DUPJOBID B; # FLAG DUPLICATE JOB-ID #
  107. ITEM INDX; # INDEX USED FOR SCANING (AT) #
  108. ITEM FLAG; # DUMMY FLAG #
  109. ITEM DTIME ;
  110. ITEM ACNTADDR; # POINTER TO (ACNT) BUFFER #
  111.  
  112. #***************** E X E C U T A B L E C O D E *****************#
  113.  
  114. BEGIN
  115. CONTROL IFEQ DEBUG,1;
  116. XTRACE("BDACB") ;
  117. CONTROL FI;
  118. #
  119.   SET POINTER TO APPLICATION TABLE ( AT ).
  120.   SCAN ( AT ) FOR OPEN ENTRY IN THE ( AT ).
  121. #
  122. UNUSEDAN = 0; # A-NUM USED IN - FOR LOOP #
  123. DUPJOBID = FALSE; # INITIALIZE DUPLIC JOB-ID FLAG #
  124. #
  125.   C H E C K ( A T ) T A B L E F O R
  126.   D U P L I C A T I O N J O B I D
  127.   A N D F O R F R E E ( A T ) E N T R Y
  128. #
  129. FOR INDX =1 STEP 1 WHILE
  130. INDX LS ATBS[0] AND NOT DUPJOBID
  131. DO
  132. BEGIN
  133. IF ATACBA[INDX] NQ 0 # CHECK IF APPL/ACB EXIST #
  134. THEN
  135. BEGIN # ACB DOES EXIST #
  136. P<ACB> = ATACBA[INDX]; # SET BASED ARRAY ADDRESS #
  137. IF INDX LQ ATHAN[0]
  138. THEN
  139. IF ACBJNWD[0] EQ JOBID # COMPARE JOBIDS FOR MATCH #
  140. THEN
  141. DUPJOBID = TRUE; # SET DUPLICATE JOB-ID FLAG #
  142. END
  143. ELSE
  144. IF UNUSEDAN EQ 0
  145. THEN
  146. UNUSEDAN = INDX; # SAVE FREE ( AT ) ENTRY #
  147. END
  148. BEGIN
  149. IF NOT DUPJOBID
  150. THEN
  151. BEGIN
  152. #
  153.   FOR STATMENT LOOP COMPLETED
  154.   CHECK IF APPLICATION TABLE HAS
  155.   AN OPEN ENTRY.
  156. #
  157. IF UNUSEDAN EQ 0 AND ATNFE[0] EQ 0
  158. THEN # NO OPEN ENTRY,( AT ) IS FULL #
  159. BEGIN # EXTENT ( AT ) BUFFER AREA #
  160. UNUSEDAN = ATBS[0]; # APPLICATION NUMBER #
  161. #
  162.   REQUEST EXTENDED BUFFER FOR THE ( AT ).
  163. #
  164. MGROW(P<AT>,ATBS[0] + ATESIZE,FLAG);
  165.  
  166. PTAT[0] = P<AT>; # SET (AT) ADDR IN PT TABLE #
  167. ATHAN[0] = UNUSEDAN; # HIGHEST APPLICATION ENTRY #
  168. ATNFE[0] = ATESIZE; # UPDATE NO. OF FREE ENTRIES #
  169. END
  170. IF ATHAN[0] LS UNUSEDAN
  171. THEN
  172. BEGIN
  173. ATHAN[0] = UNUSEDAN;
  174. END
  175. #
  176.   REQUEST A BUFFER FOR A APPLICATION CONTROL BLOCK
  177.   ( A C B ).
  178. #
  179. CONTROL IFEQ STAT,1;
  180. ST$ACB = ST$ACB + 1 ;
  181. CONTROL FI ;
  182. MGETS(ACBSIZE,ACBADDR,TRUE);
  183.  
  184. P<ACB> = ACBADDR; # SET POINTER TO ACB BUFFER #
  185. ATACBA[UNUSEDAN] = ACBADDR; # PUT ACB ADDRESS IN (AT) TABLE #
  186. ATNFE[0] = ATNFE[0] - 1; # DECREMENT NO. OF FREE ENTRIES #
  187. ACBID[0] = ACBIDVALUE; # IDENTIFY ACB BUFFER BLOCK #
  188. ACBAN[0] = UNUSEDAN; # ACB LOCATION IN (AT) TABLE #
  189. ACBJNWD[0] = JOBID; # JOB IDENTIFACTION WORD #
  190. ACBANAME[0] = C<0,7>PARAMS3; # JOB NAME #
  191. ACBIAUCPA[0] = PARAMS4;
  192. ACBIASCPA[0] = LOC(ACBAAVAL[0]);
  193. ACBIAFP[0] = 1;
  194. ACBIAFC[0] = SFWRITE;
  195. DAYTIME(DTIME) ;
  196. ACBNETONT[0] = DTIME ;
  197.  
  198. IF KDST[0]
  199. THEN # STATUS DISPLAY ON, ADD APPLICATION ENTRY TO DISPLAY #
  200. BLDKWL(KST"APP",UNUSEDAN,0,KADDIDVALUE);
  201. #
  202.   REQUEST A BUFFER FOR A APPLICATION CONNECTION
  203.   TABLE (ACNT) FOR THE APPLICATION PROGRAM, LINK
  204.   THE (ACNT) TO THE APPLICATIONS(ACB) BLOCK, AND
  205.   FILL IN THE (ACNT) CELLS FOR IDENTIFICATION AND
  206.   INFORMATION WHICH IS NEEDED.
  207. #
  208. MGETS(ACNTSIZE,ACNTADDR,TRUE);
  209.  
  210. P<ACNT> = ACNTADDR; # ACNT BASED ARRAY ADDRESS #
  211. ACNTID[0] = ACNTIDVALUE; # (ACNT)IDENTIFICATION NUMBER #
  212. ACNTMINACN[0] = PARAMS1; # MININUM ( A C N ) VALUE #
  213. ACNTMAXCN[0] = PARAMS2-PARAMS1+1; # MAX NO. OF CONNECTIONS #
  214. ACNTAN[0] = UNUSEDAN; # APPLICATION NUMBER #
  215. ACNTFFCN[0] = PARAMS1; # INITIALIZE FIRST FREE CN #
  216. ACNTNFE[0] = ACNTSIZE - ACNTHSIZE; # NUMBER OF FREE ENTRIES #
  217. #
  218.   LINK APPLICATION CONNECTION TABLE (ACNT)
  219.   TO THE APPLICATION CONTROL BLOCK ( ACB ).
  220.   RETURN TO CALLING PRAGRAM WITH (APPLICATION
  221.   NUMBER ( AN ) IN PARAMS1.
  222. #
  223. ACBACNT[0] = P<ACNT>; # ADDRESS TO ACNT TABLE #
  224. PARAMS1 = UNUSEDAN; # APPLICATION NUMBER ( AN ). #
  225. END
  226. ELSE
  227. PARAMS1 = 0; # SET APPLICATION AN TO 0 #
  228. END
  229. GOTO RJMAIN;
  230. END
  231. TERM
cdc/nos2.source/nam5871/bldacb.txt ยท Last modified: 2023/08/05 17:21 by Site Administrator