User Tools

Site Tools


cdc:nos2.source:nam5871:hfspawn

HFSPAWN

Table Of Contents

  • [00011] PRGM HFSPAWN
  • [00041] FUNC GETFIL
  • [00042] PROC BLINK
  • [00043] PROC MGETS
  • [00044] PROC OMSG
  • [00045] PROC ROUTE
  • [00046] PROC XTRACE

Source Code

HFSPAWN.txt
  1. *DECK HFSPAWN
  2. USETEXT NIPDEF
  3. USETEXT ACB
  4. USETEXT AHEADER
  5. USETEXT APPSTAT
  6. USETEXT DRHDR
  7. USETEXT NWLHEAD
  8. USETEXT NWLNTRY
  9. USETEXT PARAMP
  10. USETEXT SUPMSG
  11. PRGM HFSPAWN ; # SPAWN FACILITY TO BRING UP FTPI APPL. #
  12.  
  13. STARTIMS;
  14. #
  15. *1DC HFSPAWN
  16. *
  17. * 1. PROC NAME AUTHOR DATE
  18. * HFSPAWN LIEM T. NGUYEN 88/01/15
  19. *
  20. * 2. FUNCTIONAL DESCRIPTION
  21. * THIS ROUTINE PROCESSES THE SAF/SAR SUPERVISORY MESSAGE.
  22. *
  23. * 3. METHOD USED
  24. * CONSTRUCT THE PFN FOR THE JOB BY CONCATINATING THE 5 CHARS
  25. * APPLICATION NAME TO "ZZ", THEN CALL GETFIL.
  26. * IF ERROR IN GETTING FILE, DAYFILE ERROR MESSAGE THEN RETURN.
  27. * ELSE ROUTE JOB TO THE INPUT QUEUE.
  28. *
  29. * 4. ENTRY PARAMETERS
  30. * PARAMP1 = ADDRESS OF THE INI/APP S.M.
  31. *
  32. *
  33.  #
  34. STOPIMS;
  35.  
  36. #
  37.   EXTERNAL REFERENCES
  38. #
  39. XREF
  40. BEGIN
  41. FUNC GETFIL; # GET A DIRECT ACCESS PERMANENT FILE #
  42. PROC BLINK ; # LINK SM TO ACB #
  43. PROC MGETS ; # GET BUFFER FOR RESPONSE #
  44. PROC OMSG; # DAYFILE ERROR MESSAGE #
  45. PROC ROUTE; # ROUTE JOB FILE TO INPUT QUEUE #
  46. PROC XTRACE; # TRACE CALL #
  47. LABEL RJMAIN;
  48. END
  49. #
  50.   LOCAL VARIABLES
  51. #
  52. ITEM BUFADDR ; # ADDRESS OF RESPONDING BUFFER #
  53. ITEM I ; # FOR INDEX #
  54. ITEM RSTATUS U; # RETURN STATUS OF GETFIL CALL #
  55.  
  56. ARRAY R$NAME S(1) ;
  57. BEGIN
  58. ITEM RNAME$U U(0,0,42) ;
  59. ITEM RNAME C(0,0,7) ; # ROOT APPLICATION NAME FROM ACB #
  60. END
  61.  
  62. ARRAY S$NAME S(1) ;
  63. BEGIN
  64. ITEM SNAME$U U(0,0,42) ;
  65. ITEM SNAME C(0,0,07) ; # EXTRACTED SPAWN APPLICATION NAME #
  66. END
  67.  
  68. ARRAY DSPERRMSG S(4);
  69. BEGIN
  70. ITEM DSPERRTEXT C(0,0,30) = [" DSP ERROR NNB, LFN = XXXXXXX."];
  71. ITEM DSPERRAPPL C(2,12,07) ;
  72. ITEM DSPERRNN U(1,6,12); # ERROR CODE FIELD IN DAY MSG #
  73. ITEM DSPERREND U(3,0,60) = [0];
  74. END
  75.  
  76. ARRAY SPNNAME S(1) ;
  77. BEGIN
  78. ITEM PFNAME C(00,00,07) ; # PERMENENT FILE NAME #
  79. ITEM SPNZZ C(00,00,02) = ["ZZ"] ;
  80. ITEM SPNJOBF C(00,12,05) ;
  81. ITEM SPNZERO U(00,42,18) = [0] ;
  82. END
  83.  
  84. ARRAY SPN$MSG S(5);
  85. BEGIN # ERROR MESSAGE #
  86. ITEM MSG1$TEXT C(00,00,48) =
  87. ["NIP/NO HSPAWN STARTUP-ZZXXXXX NOT FOUND. "];
  88. ITEM MSG$APPL C(02,24,05) ; # SPAWN APPLICATION NAME #
  89. ITEM MSG1$END U(04,48,12) = [0];
  90. END
  91.  
  92. ARRAY RPARAM P(7);
  93. BEGIN # ROUTE JOB PARAMETER BLOCK #
  94. ITEM RPAR$JOBF C(00,00,07); # NAME OF INIAPPL JOB FILE #
  95. ITEM RPAR$EC U(00,42,06); # ERROR CODE RESPONSE #
  96. ITEM RPAR$F B(00,48,01); # FORCED ORIGIN FLAG #
  97. ITEM RPAR$OT U(00,53,06); # FORCED JOB ORIGIN TYPE #
  98. ITEM RPAR$CB B(00,59,01); # COMPLETION BIT #
  99. ITEM RPAR$DISP C(01,24,02); # FILE DISPOSITION #
  100. ITEM RPAR$EP B(01,47,01); # ERROR PROCESSING FLAG #
  101. ITEM RPAR$FSC B(01,39,01); # FORCE SERVICE CLASS #
  102. ITEM RPAR$ID B(01,58,01); # ROUTE TO CENTRAL SITE #
  103. ITEM RPAR$DCF B(01,55,01); # DISPOSITION CODSET FLAG #
  104. ITEM RPAR$SC C(04,12,02); # SERVICE CLASS #
  105. ITEM RPAR$WD0 U(00,00,60) = [0];
  106. ITEM RPAR$WD1 U(01,00,60) = [0];
  107. ITEM RPAR$WD2 U(02,00,60) = [0];
  108. ITEM RPAR$WD3 U(03,00,60) = [0];
  109. ITEM RPAR$WD4 U(04,00,60) = [0];
  110. ITEM RPAR$WD5 U(05,00,60) = [0];
  111. ITEM RPAR$WD6 U(06,00,60) = [0];
  112. END
  113.  
  114. CONTROL EJECT;
  115.  
  116. BEGIN # HSPAWN #
  117.  
  118. CONTROL IFEQ DEBUG,1;
  119. XTRACE("HSPAW"); # TRACE CALL #
  120. CONTROL FI;
  121.  
  122. P<ACB> = PARAMP1 ;
  123. P<AHEADER> = WLADDR + AIPHSIZE ;
  124. P<SUPMSG> = P<AHEADER> + ABHSIZE ;
  125.  
  126. RNAME[0] = C<0,7> ACBANAME[0] ;
  127. SNAME[0] = C<0,7> SAFNAME[0] ;
  128.  
  129. MGETS(LSAFRSP+BLKHSIZE+ABHSIZE,BUFADDR,TRUE) ; # GET BUFFER FOR#
  130. # RESPONSE S.M. #
  131. P<AHEADER> = BUFADDR + BLKHSIZE ;
  132. ABHABT[0] = APPCMD ;
  133. ABHACT[0] = CT60TRANS ;
  134. ABHTLC[0] = LSAFRSP ;
  135. P<SUPMSG> = P<AHEADER> + ABHSIZE ;
  136.  
  137.  
  138. FOR I = 0 STEP 1 UNTIL 6
  139. DO
  140. BEGIN
  141. IF C<I,1> SNAME[0] EQ " "
  142. THEN
  143. BEGIN
  144. B<I*6,6> SNAME[0] = 0 ; # FORCE SPAWN NAME TO TRAILING 0#
  145. B<I*6,6> RNAME[0] = 0 ; # FORCE ROOT NAME TO TRAILING 0 #
  146. END
  147. END
  148.  
  149. IF RNAME$U[0] NQ SNAME$U[0]
  150. THEN
  151. PFCSFC[0] = SAFSARA ; # APPL TRIES TO SPAWN DIFF APPL #
  152. ELSE
  153. BEGIN # APPL TRIES TO SPAWN IFSELF #
  154.  
  155. SPNJOBF[0] = C<0,5>SNAME ; # FETCH 5 CHARS OF APPL. NAME #
  156.  
  157. RSTATUS = GETFIL(SPNNAME,SPNNAME); # GET PFN #
  158.  
  159. IF RSTATUS NQ 0
  160. THEN
  161. BEGIN
  162. MSG$APPL[0] = C<00,05>SAFNAME[0] ;
  163. OMSG(SPN$MSG,0); # DAYFILE ZZININD FILE NOT FOUND #
  164. PFCSFC[0] = SAFSARA ; # SENDING ABNORMAL BACK #
  165. END
  166.  
  167. ELSE # ZZXXXXX EXISTS, NOW ROUTE JOB TO SYSTEM #
  168. BEGIN
  169. RPAR$JOBF[0] = PFNAME[0] ; # SET JOB FILE FILENAME #
  170. RPAR$F[0] = TRUE; # SET TO SYSTEM ORIGIN #
  171. RPAR$OT[0] = SYOT; # SET SYSTEM ORIGIN JOB TYPE #
  172. RPAR$CB[0] = FALSE; # CLEAR COMPLETION BIT #
  173. RPAR$DISP[0] = "IN"; # SET FILE DISPOSITION #
  174. RPAR$FSC[0] = TRUE; # SET FORCED SERVICE CLASS FLAG #
  175. RPAR$DCF[0] = TRUE; # SET DISPOSITION CODE SET #
  176. RPAR$EP[0] = TRUE; # SET ERROR PROCESSING FLAG #
  177. RPAR$ID[0] = TRUE; # SET ROUTE TO CENTRAL SITE #
  178. RPAR$SC[0] = "NS"; # SET NETWORK SERVICE CLASS #
  179. ROUTE(RPARAM,1); # ROUTE ZZININD TO INPUT QUEUE #
  180. PFCSFC[0] = SAFSARN ; # READY TO SEND NORMAL RESPONS#
  181. IF RPAR$EC[0] NQ 0
  182. THEN # DSP DETECTED ERROR - FILE NOT ROUTED #
  183. BEGIN
  184. DSPERRAPPL[0] = PFNAME[0] ;
  185. DSPERRNN[0] = RPAR$EC[0] - (RPAR$EC[0]/8)*8 +
  186. (RPAR$EC[0]/8)*64 + O"3333";
  187. OMSG(DSPERRMSG,0); # ISSUE DAYFILE MESSAGE #
  188. PFCSFC[0] = SAFSARA ; # NO, NO, IT IS ABNORMAL #
  189. END
  190. END
  191. END # APPL TRIES TO SPAWN ITSELF #
  192.  
  193. BLINK(BUFADDR,P<ACB>) ; # LINK THE RESPONSE TO ACB #
  194.  
  195. GOTO RJMAIN;
  196. END
  197. TERM
cdc/nos2.source/nam5871/hfspawn.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator