Table of Contents

AAMI

Table Of Contents

  • [00010] AAMI - ADVANCED ACCESS METHODS INTERFACE.
  • [00098] CRMR - CYBER RECORD MANAGER REQUEST PROCESSORS.
  • [00200] AMST - *AMI* STATUS.
  • [00225] ACCESS METHOD INTERFACE.
  • [00428] REQUEST PROCESSOR ROUTINES.
  • [00430] CEA - CEASE REQUEST FROM TRANSACTION FACILITY.
  • [00472] CST - CRMSTAT REQUEST PROCESSOR.
  • [00707] DBC - DBCOMIT REQUEST PRODBCESSOR.
  • [00797] DBD - DBDOWN PROCESSOR.
  • [00853] DBF - DBFREE REQUEST PROCESSOR.
  • [00902] DBP - DBEGIN REQUEST PROCESSOR.
  • [00961] DBS - DBSTAT REQUEST PROCESSOR.
  • [01085] FCL - FILE CLOSE.
  • [01128] FOP - FILE OPEN.
  • [01266] FRE - FREE PROCESSOR.
  • [01595] LFL - LOCK FILE LOCK.
  • [01612] LFU - LOCK FILE UNLOCK.
  • [01626] LRL - LOCK RECORD LOCK.
  • [01658] LRU - LOCK RECORD UNLOCK.
  • [01687] PSB - POSITION SKIP BACKWARD.
  • [01717] PSF - POSITION SKIP FORWARD.
  • [01745] PRW - POSITION REWIND.
  • [01763] RDB - READ BEGIN.
  • [01795] RDC - READ COMPLETE.
  • [01834] REC - RECOVER FILES FOR TRANSACTION FACILITY.
  • [01986] RID - RESTORE BEGIN IDENTIFIERS.
  • [02028] RLB - READ LOCK BEGIN.
  • [02074] RLC - READ LOCK COMPLETE.
  • [02121] RMB - READ MAJOR BEGIN.
  • [02159] RMC - READ MAJOR COMPLETE.
  • [02214] RNB - READ NEXT BEGIN.
  • [02246] RNC - READ NEXT COMPLETE.
  • [02300] ROC - READ NEXT WITH LOCK COMPLETE.
  • [02364] SIC - CRMSIC BATCH RECOVERY REQUEST PROCESSOR.
  • [02454] STB - START BEGIN.
  • [02521] STC - START COMPLETE.
  • [02549] TRC - TERMINATE RECOVERY REQUEST PROCESSOR.
  • [02566] WDC - WRITE DELETE COMPLETE.
  • [02604] WRB - WRITE BEGIN.
  • [02700] WRC - WRITE COMPLETE.
  • [02751] WRD - WRITE DIRECTLY.
  • [02827] SUPPORTING ROUTINES.
  • [02833] ABS - ABSOLUTIZE TASK ADDRESSES.
  • [02874] AFA - ADJUST FET ADDRESSES.
  • [02908] AQS - ALLOCATE BEFORE IMAGE RECOVERY FILE SEGMENT.
  • [02960] ARR - ASSIGN FET *RR* FIELD FOR FIRST PRU OF *BRF* SEGMENT.
  • [02998] ASF - ASSIGN *TBRF* AND *TARF* TO CURRENT TRANSACTION.
  • [03044] CAR - CHECK ACTIVE REQUESTS.
  • [03228] CAT - CHECK ABNORMAL TERMINATION FIELD OF FET.
  • [03255] CCS - CHECK *CRM* STATUS.
  • [03318] CEX - *CRM* ERROR EXIT.
  • [03328] CFS - CHECK FATAL STATUS.
  • [03363] CDT - CONVERT DATE OR TIME.
  • [03421] CLB - CHECK AFTER IMAGE RECOVERY FILE ERROR, BUSY.
  • [03488] CLF - CLOSE *FIT*.
  • [03563] CLR - CHECK FILE REQUEST.
  • [03648] CMM - CYBER MEMORY MANAGER FOR INTERFACE.
  • [03669] CQB - CHECK FOR BEFORE IMAGE RECOVERY FILE BUSY AND ERROR.
  • [03721] CRQ - COMPLETE REQUEST.
  • [03857] CTW - CHARACTERS TO WORDS.
  • [03884] DLX - DEFERRED LOGGING EXIT ROUTINE.
  • [04007] EAK - EMBEDDED ACTUAL KEY PROCESS FOR WRITE REQUEST.
  • [04094] FDB - FIND DATA BASE *TDRF* ENTRY.
  • [04119] FLS - *FLUSHM* RECOVERABLE FILES.
  • [04184] FTS - FIND TRANSACTION SEQUENCE NUMBER.
  • [04215] FUI - FIND AND SET DATA BASE USER NUMBER AND FAMILY.
  • [04245] IDB - IDLE DATA BASE.
  • [04286] IDF - IDLE DATA BASE FILE.
  • [04333] IOP - INITIAL OPEN FILE PROCESS.
  • [04538] KEX - KEY EXTRACT.
  • [04627] KSR - KEY SEARCH.
  • [04684] LAI - LOG AFTER IMAGE RECORD.
  • [04777] LBI - LOG BEFORE IMAGE RECORD.
  • [04877] LBJ - AFTER IMAGE RECOVERY FILE BATCH JOB.
  • [04904] LBK - LOG BEFORE IMAGE RECORD KEYS.
  • [05016] LDE - LINK DELETE.
  • [05053] LDN - DOWN AFTER IMAGE RECOVERY FILE.
  • [05083] LIN - LINK INSERT.
  • [05131] LOK - LOCK A RECORD OR A FILE.
  • [05300] MVD - MOVE DATA TO TASK.
  • [05356] MVK - MOVE KEY.
  • [05402] MVR - MOVE RECORD.
  • [05451] PAH - PREPARE AFTER IMAGE HEADER.
  • [05529] PAQ - PREPARE AFTER IMAGE HEADER FOR DOWN *BRF*.
  • [05596] PBH - PREPARE BEFORE IMAGE RECORD HEADER.
  • [05671] PFE - PREPARE FOR FREEING.
  • [05743] PPS - PACK PARAMETER STRING.
  • [05824] QDN - DOWN BEFORE IMAGE RECOVERY FILE.
  • [05863] RAF - RELEASE ALL FILES FOR TRANSACTION.
  • [05899] RAL - RELEASE ALL LOCKS FOR A TRANSACTION.
  • [05937] RFI - RESTORE *FIT* FORCE WRITE INDICATOR.
  • [06022] RFN - RESET *FIT* FATAL STATUS TO ZERO.
  • [06050] RLS - RETURN LOCK STATUS FOR TRANSACTION.
  • [06089] ROF - RELEASE ONE FILE.
  • [06120] ROL - RELEASE ONE LOCK.
  • [06142] RQF - RELEASE *TBRF* SEGMENT.
  • [06180] SED - SEARCH ELEMENT DESCRIPTOR TABLES (*EDT*).
  • [06207] SEK - SEEK KEY.
  • [06283] SFC - SEARCH FILE CONTROL TABLE FOR FILE ENTRY.
  • [06313] SFF - SEARCH FOR FILE.
  • [06346] SFO - SET FILE KEY ORDINAL TO NEW KEY.
  • [06400] STK - SET ALTERNATE KEY DESCRIPTION IN CRM *FIT*.
  • [06423] TAF$RM - TAF RECORD MANAGER INTERFACE.
  • [06450] TSE - *TAF* SETUP FOR *CRM*.
  • [06461] ULF - UP AFTER IMAGE RECOVERY FILE.
  • [06511] UNL - UNLOCK RECORD OR FILE.
  • [06560] VAL - VALIDATE REQUEST.
  • [06757] SUPPORTING ROUTINES WHICH REQUIRE *CPCOM*.
  • [06759] ADF - ATTACH OR DEFINE FILE.
  • [06819] DDB - DOWN DATA BASE IF POSSIBLE.
  • [06949] DDF - DOWN DATA BASE FILE IF POSSIBLE.
  • [07086] FLR - PROCESS FULL AFTER IMAGE RECOVERY FILE.
  • [07142] NMS - STORE NAME IN MESSAGE AND ISSUE MESSAGE.
  • [07196] RBI - READ BEFORE IMAGE RECORD FROM *BRF*.
  • [07222] RDH - READ *ARF* / *BRF* FILE HEADER.
  • [07266] RTF - RETURN DATA BASE FILE.
  • [07317] SBJ - SUBMIT BATCH JOB.
  • [07572] SBN - SET BATCH JOB SEQUENCE NUMBER.
  • [07604] SFM - SET FAMILY AND USER INDEX.
  • [07655] SLF - SWITCH TO ALTERNATE AFTER IMAGE RECOVERY FILE.
  • [07759] UDB - UP DATA BASE.
  • [07887] UDF - UP DATA BASE FILE.
  • [07993] UQF - UP BEFORE IMAGE RECOVERY FILES.
  • [08082] VQH - VALIDATE BEFORE IMAGE RECOVERY FILE HEADER.
  • [08120] WAI - WRITE AFTER IMAGE BUFFER TO *ARF*.
  • [08196] WBI - WRITE BEFORE IMAGE RECORD TO *BRF*.
  • [08247] INITIALIZATION CODE.
  • [08300] IAM - INITIALIZE ACCESS METHOD.
  • [08752] INITIALIZATION SUPPORTING ROUTINES.
  • [08753] ARB - ALLOCATE RECOVERY BUFFERS.
  • [08870] ART - ALLOCATE RECOVERY TABLES.
  • [08988] GFL - GET AFTER/BEFORE IMAGE RECOVERY FILE LOCAL.
  • [09053] IFO - FILE OPEN.
  • [09225] IOC - BEFORE IMAGE RECOVERY FILE I/O COMPLETION CHECK.
  • [09251] IRF - INITIALIZE RECOVERY FILES.
  • [09505] MSG - MESSAGE TO DAYFILE / OPERATOR.
  • [09562] RMP - RECOVERY MODE PROCESS.
  • [09893] VER - VALIDATION ERROR.
  • [09929] VLH - VALIDATE AFTER IMAGE RECOVERY FILE HEADER.

Source Code

AAMI.txt
  1. IDENT AAMI
  2. ENTRY AMI
  3. ENTRY AMIQ,AMOQ
  4. ENTRY CMM
  5. ENTRY IAM
  6. ENTRY TAF$RM
  7. ENTRY TSE
  8. SST
  9. SYSCOM B1
  10. TITLE AAMI - ADVANCED ACCESS METHODS INTERFACE.
  11. *COMMENT AAMI - ADVANCED ACCESS METHODS INTERFACE.
  12. COMMENT COPYRIGHT CONTROL DATA SYSTEMS INC. 1992.
  13. AAM SPACE 4,10
  14. ***** AAM - ADVANCED ACCESS METHODS.
  15. *
  16. * G. W. PROPP. 78/08/16.
  17. * L. E. LOVETT. 80/04/01.
  18. *
  19. * AAM IS THE INTERFACE BETWEEN THE TRANSACTION FACILITY AND
  20. * THE CYBER RECORD MANAGER.
  21.  
  22. SPACE 4,10
  23. *** DOCUMENTATION CONVENSIONS.
  24. *
  25. * THE FOLLOWING ABREVIATIONS ARE USED -
  26. *
  27. * AAM ADVANCED ACCESS METHODS.
  28. * CMM CYBER MEMORY MANAGER.
  29. * CRM CYBER RECORD MANAGER.
  30. * FIT FILE ENVIRONMENT TABLE OF CYBER RECORD MANAGER.
  31. * ARF AFTER IMAGE RECOVERY FILE.
  32. * BRF BEFORE IMAGE RECOVERY FILE.
  33. SPACE 4,10
  34. SPACE 4,30
  35. ** THE GENERNAL FLOWS OF CONTROL FOR *TAF CRM* IS AS FOLLOWS -
  36. *
  37. * 1. A TASK MAKES A *TAF CRM* REQUEST. THIS RESULTS IN A
  38. * RETURN JUMP TO AN ENTRY POINT IN THE DECK *AMML*.
  39. * *AMML* FORMATS A *AAM* RA REQUEST GIVING THE REQUEST CODE
  40. * AND THE ADDRESS OF THE PARAMETERS.
  41. *
  42. * 2. THE CENTRAL PROCESSOR MONITOR DETECTS THE REQUEST AND
  43. * GIVES CONTROL TO THE TRANSACTION EXECUTIVE.
  44. *
  45. * 3. THE TRANSACTION EXECUTIVE DETERMINES THE TYPE OF
  46. * RA REQUEST AND JUMPS TO THE ROUTINE *AAM* TO PROCESS
  47. * THE REQUEST.
  48. *
  49. * 4. ROUTINE *AAM* ENTERS THE REQUEST INTO THE *TAF CRM*
  50. * INPUT QUEUE.
  51. *
  52. * 5. PERIODICALLY THE TRANSACTION EXECUTIVE INITIATES THE
  53. * THE *TAF CRM* DATA MANAGER BY CALLING ROUTINE *AMI*.
  54. * *AMI* ISSUES THE DESIRED *CRM* REQUEST. WHEN THE
  55. * DATA IS IN CORE, THE INTERFACE MOVES THE DATA TO THE
  56. * TASK AND MAKES AN ENTRY IN THE OUTPUT QUEUE.
  57. *
  58. * 6. PERIODICALLY THE TRANSACTION EXECUTIVE EXAMINES THE
  59. * OUTPUT QUEUE AND SCHEDULES THE TASK FOR EXECUTION.
  60.  
  61. * COMMON DECKS.
  62.  
  63. *CALL COMKTAF
  64. *CALL COMCMAC
  65. *CALL COMKFLD
  66. LIST X
  67.  
  68. * SAVE ORIGIN COUNTER TO REMOVE COMMON DECK STORAGE IN
  69. * *COMKCRM*, *COMKTER*, *COMKTIP* AND *COMSTRX*.
  70.  
  71. *CALL COMKIPR INSTALLATION PARAMETERS
  72. BEGINT BSS 0
  73. *IF DEF,NAM
  74. *CALL COMKTAF
  75. *ELSE
  76. *CALL COMKTRN
  77. *ENDIF
  78. *CALL COMKOPD
  79. *CALL COMKCRM
  80. *CALL COMKTDM
  81. ERRNG TRTC-TREQL IF RECOVER REQUEST .LE. A TASK REQUEST
  82. *CALL COMKTER
  83. *CALL COMKTIP
  84. LIST -X
  85. *CALL COMSTRX
  86.  
  87.  
  88. * DO NOT USE TABLE SPACE ALLOCATED IN *COMKCRM*,
  89. * *COMKTER, *COMKTIP*, AND *COMSTRX*.
  90.  
  91. ORG BEGINT
  92.  
  93. * THE FOLLOWING LOCATIONS IN MEMORY ARE USED BY *CMM*.
  94.  
  95. *CALL COMKZFN
  96.  
  97. CRMR SPACE 4,10
  98. ** CRMR - CYBER RECORD MANAGER REQUEST PROCESSORS.
  99. *
  100. * *CRMR* IS A MACRO TO BUILD A JUMP TABLE BASED ON THE
  101. * *CRM* REQUEST CODE TO PROCESS THE REQUEST.
  102. *
  103. * ENTRY CRMR CODE,BGIN,COMP
  104. * CODE - LAST TWO CHARACTERS OF REQUEST CODE FROM
  105. * TABLE *TREQ*.
  106. * BGIN - BEGINNING ROUTINE TO PROCESS REQUEST.
  107. * COMP - COMPLETION ROUTINE TO PROCESS REQUEST.
  108.  
  109.  
  110. PURGMAC CRMR
  111.  
  112. CRMR MACRO CODE,BGIN,COMP
  113. LOCAL CRMA,CRMB,CRMC
  114. CRMC SET 0
  115. CRMA SET TR_CODE
  116. CRMB SET TP_CODE_L
  117. IF DEF,TP_CODE_F,1
  118. CRMC SET TP_CODE_L-TP_CODE_F
  119. TPRC RMT
  120. ORG CRMA+TCRM
  121. VFD 6/CRMC,18/CRMB,18/BGIN,18/COMP
  122. TPRC RMT
  123. CRMR ENDM
  124.  
  125. * TRANSACTION SEQUENCE TABLE.
  126. * THIS TABLE HOLDS THE TRANSACTIONS CURRENTLY
  127. * USING *CRM*.
  128. * THE TRANSACTION SEQUENCE TABLE IS LARGE ENOUGH
  129. * TO ACCOMMODATE TASKS RECOVERED FROM OTHER
  130. * MAINFRAMES (*RMDM* PARAMETER), THIS EXTENDED
  131. * TABLE LENGTH, HOWEVER, IS ONLY USED FOLLOWING
  132. * RECOVERY MODE PRESET INITIALIZATION. THE NORMAL
  133. * TABLE LENGTH (*CMDM* PARAMETER) IS USED AFTER
  134. * NON-RECOVERY MODE INITIALIZATION.
  135.  
  136. .TSEQL EQU CMDM*TSEQE SINGLE MAINFRAME *TSEQ* TABLE LENGTH
  137. TSEQ BSSZ .TSEQL*RMDM LENGTH OF TRANSACTION SEQUENCE TABLE
  138. BSSZ TSEQE EXTRA ENTRY INCASE FULL *TSEQ* RECOVERED
  139. TSEQL EQU *-TSEQ LENGTH OF TRANSACTION SEQUENCE TABLE
  140. TSEQNL EQU TSEQ+.TSEQL LWA+1 OF SINGLE MAINFRAME *TSEQ* TABLE
  141. TSEQXL EQU TSEQ+TSEQL LWA+1 OF MULTI-MAINFRAME *TSEQ* TABLE
  142. TSEQLWA CON TSEQNL LWA+1 OF IN-USE TRANSACTION SEQUENCE TAB.
  143.  
  144. * DATA MANAGER INPUT AND OUTPUT QUEUES.
  145.  
  146. AMIQ BSS 0 INPUT QUEUE
  147. AMIQ FILEC AIBF,AIBFL,FET=AAMQFL
  148.  
  149. AMOQ BSS 0 OUTPUT QUEUE
  150. AMOQ FILEC AOBF,AOBFL,FET=AAMQFL
  151.  
  152. * SCRATCH FET.
  153.  
  154. AFET RFILEC BUF,BUFL,EPR,FET=13D
  155.  
  156. * GLOBAL VARIABLES FOR REQUEST.
  157.  
  158. REQT CON 0 CURRENT REQUEST
  159. RFCB BSS 1 FILE CONTROL ENTRY FWA
  160. RLNT BSS 1 LOGICAL NAME ENTRY FWA
  161. RERR BSS 1 CURRENT ERROR CODE
  162. RNFE BSS 1 NON-FATAL ERROR CODE
  163. RCOD BSS 1 REQUEST CODE
  164. RSEQ BSS 1 TRANSACTION SEQUENCE ENTRY FWA
  165. RDDB CON 0 FWA OF NEXT *TDRF* TO CHECK FOR DOWNING
  166. RDRF CON 0 FWA OF CURRENT *TDRF* TABLE
  167. RDRT CON 0 FWA OF FIRST *TDRF* TABLE
  168. RUNA BSS 1 USER NAME
  169.  
  170. * TABLE OF ABSOLUTE ADDRESSES FOR TASK REQUESTS. LOCATIONS
  171. * RELATIVE TO *TADR* ARE DEFINED IN *COMKCRM* BY TABLE *TPAR*.
  172.  
  173. TADR BSS TPARL
  174. AMI SPACE 4,20
  175. * MESSAGES.
  176. *
  177. * NOTE - ASSEMBLY AREA IN *NMS* SHOULD BE INCREASED IF
  178. * MESSAGE LONGER THAN 50 CHARACTERS IS ADDED.
  179. * ROUTINE *NMS* USES PLUS CHARACTER (+)
  180. * AS SEARCH CHARACTER FOR *SNM*.
  181.  
  182. MSGA DATA C* ++ DATA BASE DOWN.*
  183. MSGB DATA C* +++++++ RECOVERY FILE DOWN.*
  184. MSGC DATA C* +++++++ FILE DOWN.*
  185. MSGD DATA C* +++++++ FILE DOWN, RECOVER MANUALLY.*
  186. MSGE DATA C* ++ DATA BASE UP.*
  187. MSGF DATA C* +++++++ FILE UP.*
  188. MSGG DATA C* ++ AFTER IMAGE RECOVERY FILES UNAVAILABLE.*
  189. MSGH DATA C* ++ DATA BASE IDLING DOWN.*
  190. MSGI DATA C* +++++++ FILE IDLING DOWN.*
  191. MSGJ DATA 20H ++ DMREC JOB ROUTE
  192. MSGJA DATA C*NNNNNN.*
  193. MSGK DATA 20H ++ DMREC JOB REPLY
  194. MSGKA DATA C*NNNNNN.*
  195. MSGL DATA C* SEE TAF DAYFILE.*
  196. MSGM DATA C* PLEASE TYPE IN CFO,TAF.GO. OR CFO,TAF.DROP.*
  197. MSGN DATA C* CRM ERROR ///B IGNORED ON OPEN OF +++++++.*
  198. MSGO DATA C* +++++++ IS INCONSISTENT.*
  199. SPACE 4,10
  200. ** AMST - *AMI* STATUS.
  201. *
  202. *T W1 1/A,1/B,1/C,3/,6/ AMIB,12/ AMIF,18/ AMFI,18/ AMQF
  203. *T,W2 18/ AMBJ,42/
  204. *
  205. * A = AMSD - *AAMI* IS DOWN IF .EQ. 1.
  206. * B = AMSI - *AMI* IS IDLE IF .EQ. 1.
  207. * C = AMSN - NEW *TSEQ* ENTRY ASSIGNED IF .EQ. 1.
  208. * AMIB - COUNT OF IDLED DATA BASES.
  209. * AMIF - COUNT OF IDLED FILES FOR ALL DATA BASES.
  210. * AMFI - GLOBAL COUNT OF *FIT* FWI CHANGED VIA *DLX*.
  211. * AMQF - FWA OF *TBRF* ACTIVATED VIA *DLX*.
  212. * AMBJ - BATCH JOB SEQUENCE NUMBER COUNTER.
  213.  
  214. AMSD FIELD 0,59,59 *AMI* DOWN IF .EQ. 1
  215. AMSI FIELD 0,58,58 *AMI* IDLE IF .EQ. 1
  216. AMSN FIELD 0,57,57 NEW REQUEST FOR *AMI* DETECTED IF .EQ. 1
  217. AMIB FIELD 0,53,48 COUNT OF IDLED DATA BASES
  218. AMIF FIELD 0,47,36 COUNT OF IDLED FILES FOR ALL DATA BASES
  219. AMFI FIELD 0,35,18 GLOBAL COUNT OF *FIT* FWI CHANGED BY *DLX*
  220. AMQF FIELD 0,17,0 FWA OF *TBRF* ACTIVATED VIA *DLX*
  221. AMBJ FIELD 1,59,42 BATCH JOB SEQUENCE NUMBER COUNTER
  222.  
  223. AMST BSSZ 2 *AMI* STATUS
  224. SPACE 4,10
  225. ** AMI - ACCESS METHOD INTERFACE.
  226. *
  227. * ENTRY (CMMC) = CURRENT *CMM* FL.
  228. * AMIQ = FWA OF FET FOR INPUT QUEUE.
  229. * (REQT) = LAST REQUEST IF OUTPUT QUEUE WAS FULL.
  230. * (RERR) = ERROR CODE FOR LAST REQUEST.
  231. * (TAFA) = *CRM* STATUS.
  232. *
  233. * EXIT (B2) = FWA OF TRANSACTION SEQUENCE ENTRY.
  234. * (B3) = FWA OF LOGICAL NAME ENTRY.
  235. * (B4) = FWA OF FILE CONTROL ENTRY.
  236. * (X0) = FWA OF *FIT*.
  237. * TO *TAF$RM*, IF *CRM* ACTIVE.
  238. * TO *TAF* IF *BRF* I/O INITIATED BY *DLX* ACTIVE.
  239. * TO *CRM* VIA *DLXX* IF *BRF* I/O INITIATED BY *DLX*
  240. * IS COMPLETE.
  241. *
  242. * USES X - ALL.
  243. * A - ALL.
  244. * B - 6, 7.
  245. *
  246. * MACROS GETFLD.
  247. *
  248. * CALLS CAR, CRQ, DDB, DDF, FTS, VAL.
  249.  
  250.  
  251.  
  252. AMI SUBR ENTRY/EXIT
  253. SA1 AMST CHECK IF *DLX* INITIATED A *BRF* WRITE
  254. SB5 X1 FWA OF *TBRF*
  255. LX1 59-AMSIS *TAF2* IN EXECUTION BIT
  256. PL X1,AMI0 IF *TAF2* NOT IN EXECUTION
  257. SX6 B0
  258. SA6 A1
  259. SA6 TAFA CLEAR ACTIVE *AAM* REQUEST
  260. EQ AMI3.1 PICK REQUEST FROM INPUT QUEUE
  261.  
  262. AMI0 NZ B5,AMI8 IF *DLX* INITIATED *BRF* WRITE
  263.  
  264. * AMI - AMST MUST EQUAL 2. *TAF2* STORES AAMI IDLE STATUS
  265. * WITH THAT ASSUMPTION.
  266.  
  267. ERRNZ AMI-AMST-2 AMI - AMST MUST EQUAL 2
  268.  
  269.  
  270. * CHECK FOR ACTIVE *CRM* REQUEST.
  271.  
  272. AMI1 SX6 B0+ CLEAR *CRM* STATUS
  273. SA1 TAFA *CRM* STATUS
  274. ZR X1,AMI2 IF *CRM* NOT ACTIVE
  275. SA6 A1+
  276. EQ TAF$RMX RETURN TO *CRM*
  277.  
  278. * PROCESS ACTIVE INPUT/OUTPUT REQUESTS.
  279.  
  280. AMI2 SA3 REQT LAST REQUEST
  281. ZR X3,AMI3 IF LAST REQUEST FITS IN OUTPUT QUEUE
  282. RJ ABS COMPUTE ABSOLUTE PARAMETER ADDRESS
  283. SA1 RERR ERROR CODE FOR UNFINISHED REQUEST
  284. BX6 X1
  285. RJ CRQ PUT REQUEST INTO OUTPUT QUEUE
  286. NZ X6,AMI9 IF REQUEST DOES NOT FIT IN QUEUE
  287. AMI3 RJ CAR CHECK ACTIVE REQUESTS
  288. NZ X6,AMI9 IF OUTPUT QUEUE IS FULL
  289. SA6 REQT
  290.  
  291. * PROCESS NEW REQUESTS IN INPUT QUEUE.
  292.  
  293. AMI3.1 SA3 AMIQ+2 IN
  294. AMI4 SA1 AMIQ+2 IN
  295. SA2 A1+B1 OUT
  296. IX7 X1-X2 IN - OUT
  297. ZR X7,AMI9 IF NO ENTRIES
  298. SA5 X2+ *CRM* REQUEST
  299. IX1 X3-X2
  300. SA3 A2+B1 LIMIT
  301. SX6 X2+B1
  302. BX7 X6-X3
  303. NZ X7,AMI5 IF NOT AT LIMIT
  304. SA3 A1-B1
  305. SX6 X3
  306. AMI5 ZR X1,AMI9 IF ONE PASS OF QUEUE
  307. BX7 X5 SAVE REQUEST
  308. SA6 A2 ADVANCE OUT
  309. SA7 REQT
  310. BX6 X6-X6 CLEAR CURRENT FILE CONTROL ENTRY
  311. LX7 TFFCN-1-TFFCS RIGHT JUSTIFY REQUEST CODE
  312. MX0 -TFFCN
  313. BX7 -X0*X7 REQUEST CODE
  314. SA6 RFCB
  315. SA7 RCOD
  316. SX4 X7-TREQL
  317. PL X4,AMI6 IF *TAF* REQUEST
  318. RJ VAL VALIDATE REQUEST
  319. ZR X6,AMI6 IF VALID REQUEST PARAMETERS
  320. RJ CRQ COMPLETE REQUEST
  321. EQ AMI7 GET NEXT NEW REQUEST
  322.  
  323. * SEARCH TRANSACTION SEQUENCE TABLE TO CHECK FOR NEW USER.
  324.  
  325. AMI6 SX7 B3+
  326. SA4 RCOD REQUEST CODE
  327. SX5 X4-TRTC
  328. SA7 RLNT
  329. ZR X5,REC IF RECOVER FILES FOR *TAF*
  330. RJ FTS FIND TRANSACTION SEQUENCE NUMBER
  331. SX0 B1
  332. LX0 AMSNS POSITION NEW REQUEST STATUS BIT
  333. SA1 AMST GET *AMI* STATUS WORD
  334. BX7 -X0*X1 CLEAR NEW REQUEST BIT
  335. NE B7,B2,AMI6.1 IF NOT NEW REQUEST
  336. BX7 X0+X7 SET NEW REQUEST DETECTED BIT
  337. SA2 RUNA PUT USER NAME IN *TSEQ* TABLE
  338. BX6 X2
  339. SA6 B2+TSUNW
  340. AMI6.1 SA7 A1+ STORE *AMI* STATUS
  341. SX0 B4+TFFTW FWA OF *FIT*
  342. SA2 RCOD REQUEST CODE
  343. SX3 X2-DMCC
  344. SA1 X2+TCRM ROUTINE TO PROCESS REQUEST
  345. ZR X3,CEA IF DATA MANAGER CEASE
  346. SX7 B4 FWA OF FILE CONTROL ENTRY
  347. AX1 18 BEGINNING ROUTINE
  348. SX6 B2 FWA OF TRANSACTION ENTRY
  349. SB7 X1
  350. SA6 RSEQ
  351. SA7 RFCB
  352. JP B7 PROCESSING ROUTINE FOR REQUEST
  353.  
  354. * ALL BEGINNING ROUTINES RETURN TO THE CODE BELOW.
  355.  
  356. AMI7 NZ X6,AMIX IF OUTPUT QUEUE IS FULL
  357. SA3 AMIQ+2 IN
  358. SA6 REQT CLEAR CURRENT REQUEST
  359. EQ AMI4 GET NEXT NEW REQUEST
  360.  
  361. * *DLX* INITIATED A BEFORE IMAGE WRITE TO A *BRF*.
  362. * *AMI* MUST WAIT UNTIL I/O IS COMPLETE BEFORE
  363. * CONTROL IS RETURNED TO *CRM* VIA *DLX* EXIT.
  364.  
  365. AMI8 SA2 B5+TQFCW CHECK *TBRF* FET COMPLETION BIT
  366. MX7 -AMQFN
  367. LX2 59 FET COMPLETION BIT TO SIGN POS.
  368. PL X2,AMIX IF *BRF* WRITE NOT COMPLETE - EXIT TO TAF
  369. SA1 AMST *AMI* STATUS
  370. BX7 X7*X1 CLEAR FWA OF *TBRF*
  371. SA7 A1
  372. EQ DLXX RETURN TO *CRM* VIA *DLX* EXIT ADDRESS
  373.  
  374. * CHECK FOR IDLE FILES AND IDLE DATA BASES
  375. * AND DOWN THEM IF POSSIBLE.
  376.  
  377. AMI9 SA1 RDRT FWA OF FIRST *TDRF* ENTRY
  378. SX7 X1+
  379. SA7 RDDB
  380. GETFLD 1,AMST,AMIF GLOBAL COUNT OF IDLE FILES
  381. ZR X1,AMI11 IF NO FILES IDLING DOWN
  382. AMI10 SA1 RDDB FWA OF *TDRF* TO CHECK
  383. ZR X1,AMI11 IF ALL DATA BASES CHECKED
  384. SX7 X1+
  385. SA7 RDRF STORE CURRENT *TDRF* FWA
  386. SA1 X7+TDDLW LINK TO NEXT *TDRF* ENTRY
  387. SX7 X1+
  388. SA7 RDDB STORE FWA OF NEXT *TDRF* TO CHECK
  389. RJ DDF ATTEMPT TO DOWN IDLE FILES FOR DATA BASE
  390. EQ AMI10 PROCESS NEXT *TDRF* ENTRY
  391.  
  392. AMI11 GETFLD 1,AMST,AMIB GLOBAL COUNT OF IDLE DATA BASES
  393. ZR X1,AMIX IF NO IDLE DATA BASES
  394. RJ DDB ATTEMPT TO DOWN IDLE DATA BASE
  395. SA1 RDDB FWA OF NEXT DATA BASE TO CHECK
  396. NZ X1,AMI11 IF MORE DATA BASES TO CHECK
  397. EQ AMIX RETURN
  398. TCRM BSS 0 TABLE OF *CRM* REQUEST ROUTINES
  399. CRMR CL,FCL,FCL CLOSE
  400. CRMR DE,WRB,WDC DELETE
  401. CRMR LC,LRL,LRL LOCK RECORD
  402. CRMR LF,LFL,LFL LOCK FILE
  403. CRMR OP,FOP,FOP OPEN FILE FOR TASK
  404. CRMR RD,RDB,RDC READ BY KEY
  405. CRMR RL,RLB,RLC READ BY KEY WITH LOCK
  406. CRMR RM,RMB,RMC READ BY MAJOR KEY
  407. CRMR RN,RNB,RNC READ NEXT
  408. CRMR RO,RNB,ROC READ NEXT WITH LOCK
  409. CRMR RP,PRW,PRW REWIND FILE
  410. CRMR RW,WRB,WRC REWRITE
  411. CRMR SB,PSB,PSB SKIP BACKWARD
  412. CRMR SF,PSF,PSF SKIP FORWARD
  413. CRMR UC,LRU,LRU UNLOCK RECORD
  414. CRMR UF,LFU,LFU UNLOCK FILE
  415. CRMR WR,WRB,WRC WRITE
  416. CRMR ST,STB,STC SET STARTING POSITION
  417. CRMR DB,DBP,DBP DBEGIN - AUTO RECOVERY REQUEST
  418. CRMR DC,DBC,DBC DBCOMIT - AUTO RECOVERY REQUEST
  419. CRMR DF,DBF,FRE DBFREE - AUTO RECOVERY REQUEST
  420. CRMR DS,DBS,DBS DBSTAT - AUTO RECOVERY REQUEST
  421. CRMR DN,DBD,DBD DBDOWN - OPERATOR COMMAND
  422. CRMR UP,DBU,DBU DBUP - OPERATOR COMMAND
  423. CRMR OS,CST,CST CRMSTAT - OPERATOR COMMAND
  424. CRMR SI,SIC,SIC CRMSIC - BATCH RECOVERY REQUEST
  425. CRMR TR,TRC,FRE TRMREC - TERMINATE RECOVERY
  426. CRMR RI,RID,RID RSTDBI - RESTORE DATA BASE ID
  427. TPRC HERE REMOTE CODE FOR *TCRM*
  428. TITLE REQUEST PROCESSOR ROUTINES.
  429. CEA SPACE 4,15
  430. ** CEA - CEASE REQUEST FROM TRANSACTION FACILITY.
  431. *
  432. * ENTRY (B2) = FWA OF TRANSACTION SEQUENCE ENTRY.
  433. *
  434. * EXIT TO *AMI7*.
  435. * TRANSACTION SEQUENCE ENTRY IS CLEARED.
  436. *
  437. * USES X - 1, 6, 7.
  438. * A - 1, 6, 7.
  439. * B - 7.
  440. *
  441. * MACROS GETFLD.
  442. *
  443. * CALLS CRQ, FDB, PFE, RAF, RAL.
  444.  
  445.  
  446. CEA GETFLD 1,B2,TSQF FWA OF ASSIGNED *TBRF* ENTRY
  447. SX6 B0 NO ERROR
  448. ZR X1,CEA1 IF NOT RECOVERABLE TASK
  449. RJ PFE PREPARE FOR FREEING
  450. EQ AMI7 GET NEXT NEW REQUEST
  451.  
  452. * COMPLETE CEASE REQUEST FOR NON-RECOVERABLE TASKS.
  453.  
  454. CEA1 GETFLD 1,B2,TSNF OPEN FILE LINK
  455. ZR X1,CEA2 IF NO OPEN FILES FOR TRANSACTION
  456. SA1 X1+TFFTW-TFNTW FILE NAME FROM *FIT*
  457. RJ FDB FIND DATA BASE *TDRF* ENTRY
  458. SA7 RDRF STORE FWA OF *TDRF* ENTRY
  459. SB7 B0+ RELEASE ALL LOCKS FOR TRANSACTION
  460. RJ RAL RELEASE ALL LOCKS FOR TRANSACTION
  461. RJ RAF RELEASE ALL FILES FOR TRANSACTION
  462. CEA2 SX6 B0+ CLEAR TRANSACTION SEQUENCE ENTRY
  463. SB7 TSEQE
  464. CEA3 SB7 B7-B1
  465. SA6 B2+B7 CLEAR TRANSACTION SEQUENCE ENTRY
  466. NZ B7,CEA3 IF MORE WORDS TO CLEAR
  467. SA6 RFCB NO FILE CONTROL ENTRY FOR REQUEST
  468. RJ CRQ COMPLETE REQUEST
  469. EQ AMI7 PROCESS NEXT NEW REQUEST
  470. FCL SPACE 4,15
  471. SPACE 4,35
  472. ** CST - CRMSTAT REQUEST PROCESSOR.
  473. *
  474. * THIS SUBROUTINE RETURNS TO THE CALLER SEVERAL OF *AAMI*
  475. * TABLES. JUST WHICH TABLES ARE RETURNED DEPENDS ON THE
  476. * FUNCTION ISSUED. A WORD OF BINARY ZEROS FOLLOWS THE LAST
  477. * TABLE RETURNED.
  478. *
  479. * FC = 0 RETURNS *TSEQ* TABLE, AAMI INPUT QUEUE FET, AAMI
  480. * INPUT QUEUE, AAMI OUTPUT QUEUE FET, AND
  481. * AAMI OUTPUT QUEUE.
  482. * FC = 1 RETURNS ALL OF AAMI *TDRF* TABLES.
  483. *
  484. * FC = 2 RETURNS *TDRF*, *TARF*, AND ALL *TBRF* TABLES FOR
  485. * THE SPECIFIED DATA BASE.
  486. * FC = 3 RETURNS ALL OF THE *TLNT* TABLES FOR THE SPECI-
  487. * FIED DATA BASE.
  488. * FC = 4 RETURNS *TLNT*, COUNT OF ALL ACTIVE *TFCB* AND ALL
  489. * ACTIVE *TKOK* TABLES FOR THE SPECIFIED FILE.
  490. *
  491. * WHERE THE NO. OF TABLES IS VARIABLE, OR DIFFERENT TYPES
  492. * OF TABLES ARE RETURNED WITHIN THE SAME REQUEST, AS IS
  493. * THE CASE WITH *TDRF*, *TARF*, AND *TBRF*, A WORD OF
  494. * BINARY ZEROS IS INSERTED AFTER ALL OF THE TABLES OF
  495. * THE SAME KIND HAVE BEEN MOVED TO THE USER*S AREA.
  496. * FOR EXAMPLE, FOR FUNCTION CODE 4 A WORD OF BINARY
  497. * ZEROS FOLLOWS THE *TLNT* TABLE, TWO COUNTER WORDS
  498. * FOLLOW THAT, AND THE FINAL WORD OF BINARY ZEROS IS
  499. * INSERTED AFTER THOSE.
  500. *
  501. * ENTRY (TADR) = ABSOLUTE ADDRESSES OF REQUEST PARAMETERS.
  502. *
  503. * USES X - ALL.
  504. * A - 1, 2, 3, 4, 5, 6.
  505. * B - 2, 3, 4, 6, 7.
  506. *
  507. * CALLS AFA, CRQ, FDB, MWD, SFF.
  508. *
  509. * MACROS GETFLD.
  510.  
  511.  
  512. CST SA1 TADR+TPOF
  513. SA2 TADR+TPBA
  514. SA5 X1 FUNCTION+POSSIBLE D.B. OR FILE NAME
  515. SB7 X2 FWA OF RETURN AREA
  516. SA2 TADR+TPBL
  517. SA2 X2+ SIZE OF RETURN AREA
  518. NZ X5,CST1 IF NOT AAMI STATUS REQUEST
  519.  
  520. * FUNCTION CODE = 0.
  521.  
  522. SX7 X2-TSEQL-2*AAMQFL-AIBFL-AOBFL-2
  523. SX6 TERAN
  524. NG X7,CST13 IF USER RETURN AREA TOO SMALL
  525. SB2 TSEQ
  526. SB6 TSEQL
  527. RJ MWD MOVE *TSEQ* TO TASK FL
  528. BX6 X6-X6
  529. SA6 B7+
  530. SB7 B7+B1
  531. SB3 B7+
  532. SB2 AMIQ
  533. SB6 AAMQFL
  534. RJ MWD MOVE INPUT QUEUE FET
  535. SA1 B3+
  536. RJ AFA ADJUST FET ADDRESSES
  537. SB2 AIBF
  538. SB6 AIBFL
  539. RJ MWD MOVE INPUT QUEUE
  540. SB3 B7+
  541. SB2 AMOQ
  542. SB6 AAMQFL
  543. RJ MWD MOVE OUTPUT QUEUE FET
  544. SA1 B3+
  545. RJ AFA ADJUST FET ADDRESSES
  546. SB2 AOBF
  547. SB6 AOBFL
  548. RJ MWD MOVE OUTPUT QUEUE
  549. SX6 B0
  550. SA6 B7
  551. EQ CST13 PROCESS NEXT NEW REQUEST
  552.  
  553. CST1 SB4 X5
  554. SB4 B4-B1
  555. NE B4,CST3 IF NOT AAMI LEVEL REQUEST
  556.  
  557. * FUNCTION CODE = 1.
  558.  
  559. SX2 X2-CMAXDB*TDRFE-1
  560. SX6 TERAN
  561. NG X2,CST13 IF RETURN AREA TOO SMALL
  562. SA3 RDRT ADDRESS OF FIRST *TDRF*
  563. CST2 SB2 X3+
  564. SB6 TDRFE
  565. SA3 B2+TDDLW LINK TO NEXT *TDRF* TABLE
  566. RJ MWD
  567. SX3 X3
  568. NZ X3,CST2 IF MORE *TDRF* TABLES
  569. BX6 X6-X6
  570. SA6 B7+
  571. EQ CST13 PROCESS NEXT NEW REQUEST
  572.  
  573. * AT THIS POINT...
  574. * X1 = FWA OF FUNCTION+POSSIBLE D.B. OR FILE NAME.
  575. * X2 = SIZE OF THE RETURN AREA (CM WORDS).
  576. * X5 = 12/ DB NAME,30/0,18/ 2 OR 3,
  577. * OR 42/ FILE NAME,18/ 4.
  578. * B7 = FWA OF RETURN AREA.
  579.  
  580. CST3 SA1 X1 DATA BASE ID, LEFT JUSTIFIED
  581. SB3 X2 SAVE THE RETURN AREA SIZE
  582. RJ FDB FIND *TDRF* ENTRY FOR DATA BASE
  583. SX2 B3 RESTORE AREA SIZE IN X2
  584. SB2 X7 ADDRESS OF *TDRF* FOR THE MOVE
  585. SX6 TERB FILE NOT INSTALLED ERROR CODE
  586. ZR X7,CST13 IF *TDRF* ENTRY NOT FOUND
  587. SX1 A1 ADDRESS OF NAME
  588. SB3 X7 FWA OF *TDRF* ENTRY
  589. MX0 42
  590. BX5 -X0*X5
  591. SB6 X5-2
  592. NZ B6,CST5 IF NOT A D.B. REQUEST
  593.  
  594. * FUNCTION CODE = 2.
  595.  
  596. SX2 X2-TDRFE-TARFE-2
  597. SB6 TDRFE
  598. SX6 TERAN
  599. NG X2,CST13 IF INSUFFICIENT RETURN AREA
  600. RJ MWD MOVE *TDRF* TO USER FL
  601. MX6 0
  602. SA6 B7+
  603. SB7 B7+B1
  604. SA1 B3+TDALW
  605. SB6 TARFE
  606. SB2 X1
  607. SA6 B7 FINAL ZERO WORD-J.I.C. NO *TARF*
  608. ZR B2,CST13 IF NO *TARF* - RETURN
  609. RJ MWD MOVE *TARF* TO USER FL
  610. MX6 0
  611. SA6 B7+
  612. SB7 B7+B1
  613. GETFLD 3,B3,TDQN NUMBER OF *BRF-S*
  614. SX4 TQRFE LENGTH OF *TBRF* TABLE
  615. SX4 TQRFE LENGTH OF *TQRF* TABLE
  616. IX3 X3*X4 NO. OF *TBRFS-S* (TBRF SIZE)
  617. SX6 TERAN
  618. SX3 X3+1
  619. IX2 X2-X3
  620. SB6 X4
  621. NG X2,CST13 IF INSUFFICIENT RETURN AREA
  622. SX2 X2+B1
  623. GETFLD 1,B3,TDQL FWA OF FIRST DATA BASE *TBRF* ENTRY
  624. CST4 SB3 X1 FWA OF *TBRF*
  625. SB2 X1
  626. RJ MWD MOVE *TBRF* TO USER FL
  627. SB6 TQRFE
  628. GETFLD 1,B3,TQNL FWA OF NEXT *TBRF* ENTRY
  629. NZ X1,CST4 IF MORE *TBRF* TABLES
  630. SX6 B0
  631. SA6 B7+
  632. EQ CST13 PROCESS THE NEXT NEW REQUEST
  633.  
  634. * AT THIS POINT...
  635. * X1 = FWA OF FILE NAME
  636. * X2 = SIZE OF THE RETURN AREA.
  637. * X5 = FUNCTION CODE.
  638. * B2 = FWA OF *TDRF*.
  639. * B7 = FWA OF RETURN AREA.
  640.  
  641. CST5 SB6 X5-3
  642. NZ B6,CST8 IF NOT FUNCTION 3
  643.  
  644. * FUNCTION CODE = 3.
  645.  
  646. GETFLD 3,B2,TDNL GET ADDRESS OF 1ST *TLNT*
  647. GETFLD 4,B2,TDLL GET ADDRESS OF LAST *TLNT*
  648. SB3 X4+
  649. CST6 SB6 TLNTE SIZE OF *TLNT*
  650. SX4 X2-TLNTE-1
  651. SB2 X3+
  652. GT B2,B3,CST7 IF ALL *TLNT* PROCESSED
  653. ZR B2,CST7 IF END OF *TLNT* TABLES
  654. SX2 X4+1
  655. SX6 TERAN INSUFFICIENT RETURN AREA ERROR CODE
  656. NG X4,CST13 IF INSUFFICIENT RETURN AREA
  657. RJ MWD
  658. SA3 X3+TLNTW LINK TO NEXT *TLNT*
  659. EQ CST6 MOVE NEXT *TLNT*
  660.  
  661. CST7 BX6 X6-X6
  662. SA6 B7
  663. EQ CST13 PROCESS NEXT NEW REQUEST
  664.  
  665. * FUNCTION CODE = 4.
  666.  
  667. CST8 GETFLD 3,B2,TDNL
  668. GETFLD 4,B2,TDLL
  669. SX5 X2+ SAVE RETURN AREA ADDRESS
  670. SA1 X1+ GET FILE NAME FROM PARAMETER LIST
  671. RJ SFF FIND *TLNT* FOR THE FILE
  672. SX6 TERB
  673. ZR B3,CST13 IF *TLNT* NOT FOUND
  674. SB2 B3
  675. SX2 X5 RESTORE RETURN AREA ADDRESS
  676. SB6 TLNTE
  677. SX2 X2-TLNTE-4
  678. SX6 TERAN
  679. NG X2,CST13 IF INSUFFICIENT RETURN AREA
  680. RJ MWD MOVE *TLNT* TO USER AREA
  681. SX6 B0+
  682. SA6 B7+
  683. SB7 B7+1
  684. SA3 B3+TLNOW ADDRESS OF 1ST OPEN *TFCB* ENTRY
  685. CST9 SX3 X3
  686. ZR X3,CST10 IF NO MORE *TFCB* TABLES
  687. SX6 X6+B1 COUNT ACTIVE *TFCB* TABLES
  688. SA3 X3 LINK TO THE NEXT *TFCB*
  689. EQ CST9 CONTINUE COUNTING
  690.  
  691. CST10 SA6 B7
  692. SA3 B3+TLNLW LINK TO ACTIVE *TKOK*
  693. BX6 X6-X6
  694. CST11 SX3 X3
  695. ZR X3,CST12 IF END OF LOCKED *TKOK* TABLES
  696. SX6 X6+B1 COUNT THE ACTIVE *TKOK* TABLES
  697. SA3 X3 LINK TO THE NEXT LOCKED *TKOK* ENTRY
  698. PL X3,CST11 IF NO FILE LOCK, CONTINUE COUNTING
  699. BX6 -X6
  700. CST12 SA6 A6+1
  701. BX6 X6-X6
  702. SA6 A6+B1
  703. CST13 RJ CRQ COMPLETE REQUEST
  704. EQ AMI7 PROCESS NEXT NEW REQUEST
  705.  
  706. SPACE 4,10
  707. ** DBC - DBCOMIT REQUEST PRODBCESSOR.
  708. *
  709. * ENTRY (B2) = FWA OF *TSEQ*.
  710. * (RFCB) = ZERO.
  711. *
  712. * EXIT TO AMI7.
  713. *
  714. * USES X - 1, 2, 5, 6, 7.
  715. * A - 1, 2, 6, 7.
  716. * B - 7.
  717. *
  718. * MACROS GETFLD, PUTFLD.
  719. *
  720. * CALLS ARR, CLB, CQB, CRQ, FLS, PAH, PBH, RAL, WAI, WBI.
  721.  
  722.  
  723. DBC SX6 TERAC *DBCOMIT* OUT OF SEQUENCE ERROR CODE
  724. SA1 B2+TSBRW *DBEGIN* ACTIVE FLAG WORD
  725. BX7 X1
  726. LX7 59-TSBRS
  727. NG X7,DBC2 IF *DBEGIN* IS ACTIVE
  728. DBC1 RJ CRQ COMPLETE REQUEST
  729. EQ AMI7 GET NEXT NEW REQUEST
  730.  
  731. DBC2 SA2 RDRF FWA OF *TDRF* ENTRY
  732. SA2 X2+TDCMW *DBCOMIT* REQUEST COUNT
  733. SX6 B1
  734. IX6 X2+X6 INCREMENT *DBCOMIT* REQUEST COUNT
  735. SA6 A2+ STORE NEW COUNT
  736. MX7 -TSBRN
  737. LX7 TSBRS-TSBRN+1
  738. BX7 X7*X1 CLEAR *DBEGIN* ACTIVE FLAG
  739. SA7 A1 STORE FLAG WORD
  740. GETFLD 2,B2,TSBC CURRENT *DBEGIN* IDENTIFIER
  741. LX2 TSBPS-TSBPN+1 MOVE CURRENT ID TO PREVIOUS ID FIELD
  742. BX7 X2
  743. SA7 A2 STORE CURRENT ID AS PREVIOUS, ZERO CURRENT
  744. GETFLD 1,B2,TSBI NUMBER OF BEFORE IMAGES GENERATED
  745. NZ X1,DBC3 IF BEFORE IMAGES GENERATED
  746. SB7 B1 SPECIFY RELEASE RECORD LOCK
  747. RJ RAL RELEASE ALL RECORD LOCKS
  748. SX6 B0 NO ERROR
  749. EQ DBC1 COMPLETE REQUEST
  750.  
  751. * BEFORE IMAGES GENERATED FOR BEGIN/COMMIT SEQUENCE.
  752.  
  753. DBC3 RJ FLS ISSUE *CRM* *FLUSHM* FOR RECOVERABLE FILES
  754. SX2 DBC4 CONTINUATION ADDRESS
  755. SA1 REQT REQUEST
  756. BX6 X1
  757. SA6 B2+TSRQW SAVE REQUEST IN *TSEQ* ENTRY
  758. PUTFLD 2,B2,TSCP STORE CONTINUATION ADDRESS
  759. SX6 B0 NO ERROR
  760. EQ AMI7 GET NEXT NEW REQUEST
  761.  
  762. * *DBCOMIT* REQUEST CONTINUATION.
  763. * WRITE COMMIT STAMP ON AFTER IMAGE RECOVERY FILE.
  764.  
  765. DBC4 RJ CLB CHECK IF *ARF* AVAILABLE
  766. NZ X6,DBC5 IF *ARF* DOWN
  767. ZR B5,CAR7 IF *ARF* BUSY
  768. SX5 TRDC *DBCOMIT* REQUEST CODE
  769. RJ PAH PREPARE COMMIT STAMP FOR *ARF*
  770. SB7 B1 REQUEST FORCE FLUSH
  771. RJ WAI WRITE AFTER IMAGE BUFFER TO *ARF*
  772. DBC5 SX2 DBC6 CONTINUATION ADDRESS
  773. PUTFLD 2,B2,TSCP STORE CONTINUATION ADDRESS
  774.  
  775. * WRITE COMMIT STAMP ON BEFORE IMAGE RECOVERY FILE.
  776.  
  777. DBC6 RJ CQB CHECK IF *BRF* AVAILABLE
  778. NZ X6,DBC7 IF *BRF* DOWN
  779. ZR B5,CAR7 IF *BRF* BUSY
  780. SX5 TRDC *DBCOMIT* REQUEST CODE
  781. RJ PBH PREPARE COMMIT STAMP FOR *BRF*
  782. MX2 60 (ALL ONES)
  783. PUTFLD 2,B2,TSBI SET BI COUNT SO INCREMENT YIELDS ZERO
  784. RJ ARR ASSIGN *RR* FOR FIRST PRU OF SEGMENT
  785. RJ WBI WRITE COMMIT STAMP TO *BRF*
  786.  
  787. * RELEASE RECORD LOCKS AND COMPLETE REQUEST.
  788.  
  789. DBC7 SB7 B1+ SPECIFY RELEASE RECORD LOCK
  790. RJ RAL RELEASE ALL RECORD LOCKS
  791. SX6 B0+ NO ERROR
  792. PUTFLD 6,B2,TSCP CLEAR CONTINUATION ADDRESS
  793. PUTFLD 6,B2,TSBI CLEAR BEFORE IMAGE COUNT
  794. RJ CRQ COMPLETE REQUEST
  795. EQ CAR7 GET NEXT CONTINUATION ADDRESS
  796. SPACE 4,10
  797. ** DBD - DBDOWN PROCESSOR.
  798. *
  799. * THIS SUBROUTINE SETS THE *IDLE* BIT IN *TDRF* OR *TLNT*,
  800. * DEPENDING ON THE LEVEL OF REQUEST.
  801. *
  802. * ENTRY (B2) = FWA OF TRANSACTION SEQUENCE ENTRY.
  803. * (TADR) = ABSOLUTE ADDRESSES OF PARAMETERS.
  804. * (RDRT) = FWA OF THE 1ST *TDRT* TABLE.
  805. *
  806. * EXIT TO AMI7.
  807. *
  808. * USES X - 0, 1, 3, 4, 6, 7.
  809. * A - 1, 3, 4, 7.
  810. * B - 2, 4.
  811. *
  812. * CALLS CRQ, FDB, IDB, IDF, SFF.
  813. *
  814. * MACROS GETFLD.
  815.  
  816.  
  817. DBD SA1 TADR+TPFN
  818. SA1 X1+ DATA BASE ID, LEFT JUSTIFIED
  819. RJ FDB FIND DATA BASE *TDRF* ENTRY
  820. SA7 RDRF STORE FWA OF CURRENT DATA BASE *TDRF*
  821. SX6 TERB FILE NOT INSTALLED ERROR CODE
  822. ZR X7,DBD2 IF *TDRF* ENTRY NOT FOUND
  823. SB2 X7 FWA OF *TDRF* ENTRY
  824. MX0 12
  825. BX0 -X0*X1 GET NAME WITHOUT DB ID
  826. SX1 A1 NAME ADDRESS
  827. ZR X0,DBD1 IF D.B. AND NOT FILE
  828. GETFLD 3,B2,TDNL
  829. GETFLD 4,B2,TDLL
  830. SA1 X1+ FILE NAME FROM PARAMETER LIST
  831. RJ SFF
  832. SX6 TERB FILE NOT INSTALLED ERROR CODE
  833. ZR B3,DBD2 IF FILE NOT FOUND IN *TLNT*
  834. SX7 B3+ FWA OF *TLNT* ENTRY
  835. SA7 RLNT STORE CURRENT FWA OF CURRENT *TLNT*
  836. RJ IDF SET FILE IDLE FLAG
  837. EQ DBD2 COMPLETE REQUEST
  838.  
  839. * SET DATA BASE IDLE.
  840.  
  841. DBD1 RJ IDB SET DATA BASE IDLE
  842. SA1 RDRF CURRENT *TDRF* ENTRY
  843. SA1 X1+TDODW
  844. MX7 -TDODN
  845. LX7 TDODS-TDODN+1
  846. BX7 -X7+X1 SET OPERATOR DOWNED DATA BASE FLAG
  847. SA7 A1 STORE FLAG
  848. SX6 B0+ NO ERROR
  849. DBD2 RJ CRQ COMPLETE REQUEST
  850. EQ AMI7 PROCESS NEXT NEW REQUEST
  851.  
  852. SPACE 4,10
  853. ** DBF - DBFREE REQUEST PROCESSOR.
  854. *
  855. * ENTRY (B2) = FWA OF *TSEQ*.
  856. * (RDRF) = FWA OF CURRENT DATA BASE *TDRF* ENTRY.
  857. * (REQT) = *TAF CRM* REQUEST.
  858. *
  859. * EXIT TO *AMI7*.
  860. *
  861. * USES X - 1, 2, 3, 6, 7.
  862. * A - 1, 2, 3, 6, 7.
  863. * B - 7.
  864. *
  865. * MACROS GETFLD.
  866. *
  867. * CALLS CRQ, PFE, RAL.
  868.  
  869.  
  870. DBF SA2 B2+TSBRW
  871. LX2 59-TSBRS
  872. SX6 TERAC ILLEGAL BEGIN/COMMIT SEQUENCE ERROR CODE
  873. PL X2,DBF1 IF *DBEGIN* NOT ACTIVE - ILLEGAL SEQUENCE
  874. GETFLD 3,B2,TSQF FWA OF ASSIGNED *TBRF* ENTRY
  875. SA3 X3+TQSTW *BRF* STATUS
  876. LX3 59-TQSTS
  877. SX6 TERAK *BRF* DOWN ERROR CODE
  878. NG X3,DBF1 IF *BRF* DOWN
  879. SA1 A2
  880. MX7 -TSBRN
  881. LX7 TSBRS-TSBRN+1
  882. BX7 X7*X1 CLEAR DBEGIN PROCESSED FLAG
  883. SA7 A1
  884. GETFLD 1,B2,TSBI BEFORE IMAGE COUNT
  885. SX6 B0
  886. ZR X1,DBF1 IF NO BEFORE IMAGES
  887. RJ PFE PREPARE TO FREE BEFORE IMAGES
  888. EQ AMI7 GET NEXT NEW REQUEST
  889.  
  890. * NO BEFORE IMAGES RECORDED, OR ILLEGAL SEQUENCE.
  891.  
  892. DBF1 SB7 B1+ RELEASE ALL RECORD LOCKS
  893. SA6 RERR SAVE ERROR
  894. RJ RAL RELEASE LOCKS
  895. SA1 RERR ERROR CODE
  896. SX6 X1+
  897. RJ CRQ COMPLETE REQUEST
  898. EQ AMI7 PROCESS NEXT NEW REQUEST
  899.  
  900.  
  901. SPACE 4,10
  902. ** DBP - DBEGIN REQUEST PROCESSOR.
  903. *
  904. * ENTRY (B2) = FWA OF TRANSACTION SEQUENCE ENTRY.
  905. * (RDRF) = FWA OF CURRENT DATA BASE *TDRF*.
  906. *
  907. * EXIT TO *AMI7*.
  908. *
  909. * USES X - 1, 2, 4, 6, 7.
  910. * A - 1, 2, 4, 7.
  911. * B - 6.
  912. *
  913. * MACROS GETFLD, PUTFLD.
  914. *
  915. * CALLS ASF, CRQ, GRA.
  916.  
  917.  
  918. DBP SX6 TERAF RECOVERY FILES NOT ASSIGNED ERROR CODE
  919. SA1 RDRF FWA OF CURRENT *TDRF*
  920. SB6 X1 FWA OF CURRENT *TDRF* ENTRY
  921. GETFLD 1,B6,TDQN GET NUMBER OF *BRF-S* ASSIGNED DATA BASE
  922. ZR X1,DBP2 IF RECOVERY FILES NOT ASSIGNED
  923. SA1 B2+TSBRW CHECK IF OUTSTANDING DBEGIN REQUEST
  924. SX6 TERAC OUTSTANDING DBEGIN REQUEST ERROR CODE
  925. LX1 59-TSBRS
  926. NG X1,DBP2 IF OUTSTANDING DBEGIN REQUEST FLAG SET
  927. GETFLD 2,B2,TSQF GET FWA OF ASSIGNED *TBRF*
  928. NZ X2,DBP1 IF *TBRF* ASSIGNED
  929. RJ ASF ASSIGN *TBRF* AND *TARF* TO *TSEQ*
  930. NZ X6,DBP2 IF *BRF* IS DOWN
  931. DBP1 MX7 -TSBRN
  932. LX7 TSBRS-TSBRN+1
  933. SA1 B2+TSBRW
  934. BX7 -X7+X1
  935. SA7 A1 SET DBEGIN PROCESSED FLAG
  936. SA1 B6+TDBGW *DBEGIN* COUNT FROM DATA BASE *TDRF*
  937. SX7 B1
  938. IX7 X1+X7 INCREMENT *DBEGIN* COUNT
  939. SA7 A1 STORE NEW COUNT OF *DBEGIN* PROCESS
  940. MX7 -TSBWN
  941. SA1 B2+TSBWW
  942. LX7 TSBWS-TSBWN+1
  943. BX7 -X7+X1
  944. SA7 A1+ SET BEGIN IMAGE WRITE PENDING FLAG
  945. SA2 TADR+TPCI GET ADDRESS OF DBEGIN ID PARAMETER
  946. SA2 X2+ GET ID PARAMETER
  947. AX2 59-TSBCS RIGHT JUSTIFY ID
  948. PUTFLD 2,B2,TSBC STORE DBEGIN ID IN *TSEQ*
  949. SA1 REQT REQUEST
  950. LX1 TSSCN-1-TSSCS RIGHT JUSTIFY SUB-CONTROL POINT
  951. MX7 -TSSCN
  952. BX1 -X7*X1 SUB-CONTROL POINT NUMBER
  953. TJ GRA GET TASK NAME
  954. SX6 B0+ NO ERROR
  955. LX4 TSTNN-1-TSTNS RIGHT JUSTIFY TASK NAME
  956. PUTFLD 4,B2,TSTN STORE TASK NAME IN *TSEQ* ENTRY
  957. DBP2 RJ CRQ COMPLETE REQUEST
  958. EQ AMI7 PROCESS NEXT NEW REQUEST
  959.  
  960. SPACE 4,10
  961. ** DBS - DBSTAT REQUEST PROCESSOR.
  962. *
  963. * ENTRY (B2) = FWA OF *TSEQ*.
  964. *
  965. * EXIT TO *AMI7*.
  966. *
  967. * USES X - 0, 1, 2, 3, 4, 6, 7.
  968. * A - 1, 2, 3, 4, 6.
  969. * B - B4.
  970. *
  971. * MACROS GETFLD.
  972. *
  973. * CALLS CRQ.
  974.  
  975.  
  976. DBS SX6 TERAE BEGIN ID DOES NOT EXIST ERROR CODE
  977. SA1 AMST *AMI* STATUS ORD
  978. LX1 59-AMSNS
  979. NG X1,DBS1 IF FIRST REQUEST NO BEGIN ID
  980. GETFLD 1,B2,TSBC CURRENT BEGIN ID
  981. GETFLD 2,B2,TSBP PREVIOUS BEGIN ID
  982. LX1 59-TSBCN+1 LEFT JUSTIFY CURRENT ID
  983. LX2 59-TSBPN+1 LEFT JUSTIFY PREVIOUS ID
  984. SA3 TADR+TPCI TASK ADDRESS FOR CURRENT BEGIN ID
  985. SA4 TADR+TPPI TASK ADDRESS FOR PREVIOUS BEGIN ID
  986. MX7 TSBPN
  987. SA3 X3 TASK RETURN WORD
  988. BX3 -X7*X3 RETAIN LOWER PORTION
  989. BX6 X1+X3 ADD CURRENT ID
  990. SA6 A3 STORE IN TASK
  991. SA4 X4 TASK RETURN WORD
  992. BX4 -X7*X4 RETAIN LOWER PORTION
  993. BX6 X2+X4 ADD PREVIOUS ID
  994. SA6 A4+ STORE IN TASK
  995. SX6 B0+ NO ERROR
  996. DBS1 RJ CRQ COMPLETE REQUEST
  997. EQ AMI7 PROCESS NEXT NEW REQUEST
  998.  
  999. SPACE 4,35
  1000. * DBU - DATA BASE/DB FILE UP COMMAND PROCESSOR.
  1001. *
  1002. * *DBU* IS A PROCESSOR WHICH BRINGS A D.B. OR A FILE UP,
  1003. * AFTER IT HAS BEEN DOWNED. A DATA BASE IS BROUGHT
  1004. * UP BY ATTACHING AND SETTING UP ALL OF THE FILES THAT
  1005. * BELONG TO A GIVEN D.B.
  1006. * A FILE IS BROUGHT UP BY ATTACHING IT AND RESETING ITS
  1007. * *DOWN* AND *IDLE* BITS.
  1008. *
  1009. * A D.B. WILL NOT BE BROUGHT UP IF...
  1010. * 1. NONE OF ITS FILES COULD BE ATTACHED.
  1011. * 2. ITS *BRF* OR ITS *ARF* IS DOWN.
  1012. * 3. THE DATA BASE IS IDLING DOWN.
  1013. *
  1014. * A FILE WILL NOT BE BROUGHT UP IF...
  1015. * 1. IT CANNOT BE ATTACHED.
  1016. * 2. ITS D.B. IS DOWN.
  1017. * 3. THE FILE IS IDLING DOWN.
  1018. *
  1019. * N.B. A D.B. WILL BE BROUGHT UP IF AT LEAST ONE
  1020. * OF ITS FILES CAN BE ATTACHED.
  1021. *
  1022. * ENTRY (TADR) = ABSOLUTE ADDRESSES OF PARAMETERS.
  1023. * (RDRT) = FWA OF FIRST *TDRF* ENTRY.
  1024. *
  1025. * EXIT TO *AMI7*.
  1026. *
  1027. * USES X - ALL.
  1028. * A - 1, 2, 3, 4, 7.
  1029. * B - 4.
  1030. *
  1031. * CALLS CRQ, FDB, SFF, UDB, UDF.
  1032. *
  1033. * MACROS GETFLD.
  1034.  
  1035.  
  1036. DBU SA1 TADR+TPFN
  1037. SA1 X1+ DATA BASE ID, LEFT JUSTIFIED
  1038. RJ FDB FIND DATA BASE *TDRF* ENTRY
  1039. SX6 TERB
  1040. SA7 RDRF STORE FWA OF *TDRF* ENTRY
  1041. ZR X7,DBU2 IF *TDRF* ENTRY NOT FOUND
  1042. MX0 12
  1043. BX0 -X0*X1 GET NAME WITHOUT DB ID
  1044. SX1 A1 NAME ADDRESS
  1045. SX5 X7 FWA OF *TDRF* ENTRY
  1046. NZ X0,DBU1 IF FILE UP COMMAND
  1047.  
  1048. * ATTEMPT TO UP DATA BASE.
  1049.  
  1050. RJ UDB UP DATA BASE
  1051. EQ DBU2 COMPLETE REQUEST
  1052.  
  1053. * ATTEMPT TO UP DATA FILE.
  1054.  
  1055. DBU1 SA3 X5+TDSDW DATA BASE STATUS
  1056. MX0 2
  1057. BX4 X0*X3 ISOLATE DOWN AND IDLE BITS
  1058. SX6 TERAK
  1059. NZ X4,DBU2 IF D.B. DOWN OR IDLE
  1060. GETFLD 3,X5,TDNL
  1061. GETFLD 4,X5,TDLL
  1062. SA1 X1+ GET FILE NAME FROM PARAMETER LIST
  1063. RJ SFF FIND *TLNT*
  1064. SX6 TERB
  1065. ZR B3,DBU2 IF NO *TLNT* FOR THIS FILE
  1066. SB4 B3 (B4 = LAST *TLNT*, B3 = FIRST *TLNT*)
  1067. SX7 B3
  1068. SA7 RLNT
  1069. SA2 B3+TLFDW FILE DOWN FLAG
  1070. BX1 X2
  1071. LX1 59-TLFIS
  1072. SX6 TERAG FILE IDLE ERROR CODE
  1073. NG X1,DBU2 IF FILE IDLING DOWN
  1074. SX6 B0 NO ERROR
  1075. PL X2,DBU2 IF FILE NOT DOWN
  1076. RJ UDF ATTEMPT TO UP DATA FILE
  1077. NZ X6,DBU2 IF FILE NOT ATTACHED
  1078. SX6 TERAK FILE DOWN ERROR CODE
  1079. NZ X1,DBU2 IF FILE CANNOT BE ATTACHED
  1080. SX6 B0+ NO ERROR
  1081. DBU2 RJ CRQ COMPLETE REQUEST
  1082. EQ AMI7 GET NEXT NEW REQUEST
  1083.  
  1084. SPACE 4,10
  1085. ** FCL - FILE CLOSE.
  1086. *
  1087. * ENTRY (B2) = FWA TRANSACTION SEQUENCE ENTRY.
  1088. * (B3) = FWA OF LOGICAL NAME ENTRY.
  1089. *
  1090. * EXIT TO *AMI7*.
  1091. *
  1092. * USES X - 1, 3, 6.
  1093. * A - 1, 3.
  1094. * B - 5, 6, 7.
  1095. *
  1096. * CALLS CRQ, ROF, ROL.
  1097.  
  1098.  
  1099. FCL SA1 B3+TLRFW RECOVERABLE FILE FLAG FROM *TLNT*
  1100. SA3 B2+TSBRW *DBEGIN* OUTSTANDING FLAG FROM *TSEQ*
  1101. LX1 59-TLRFS
  1102. PL X1,FCL1 IF NOT RECOVERABLE FILE TYPE
  1103. LX3 59-TSBRS
  1104. SX6 TERAH REQUEST NOT ALLOWED WITHIN BEGIN/COMMIT
  1105. NG X3,FCL5 IF *DBEGIN* OUTSTANDING
  1106. FCL1 SA1 B2+TSNLW LINK TO NEXT LOCK
  1107.  
  1108. * RELEASE ALL LOCKS HELD BY TRANSACTION ON FILE.
  1109.  
  1110. FCL2 SB7 X1+
  1111. SB5 X1-TKNTW FWA OF LOCK ENTRY
  1112. ZR B7,FCL4 IF NO MORE LOCKS FOR FILE
  1113. SA3 B5+TKLNW LOGICAL NAME TABLE ENTRY
  1114. LX3 17-TKLNS
  1115. SB6 X3
  1116. NE B6,B3,FCL3 IF LOCK NOT FOR CLOSED FILE
  1117. RJ ROL RELEASE LOCK FOR FILE
  1118. FCL3 SA1 B7+ LINK FOR NEXT LOCK
  1119. EQ FCL2 CHECK NEXT LOCK
  1120.  
  1121. * CLOSE FILE BY RELEASING FILE CONTROL ENTRY.
  1122.  
  1123. FCL4 RJ ROF RELEASE FILE FOR TRANSACTION
  1124. SX6 B0+ NO ERROR
  1125. FCL5 RJ CRQ COMPLETE REQUEST
  1126. EQ AMI7 PROCESS NEXT NEW REQUEST
  1127. FOP SPACE 4,15
  1128. ** FOP - FILE OPEN.
  1129. *
  1130. * ENTRY (B2) = FWA OF TRANSACTION SEQUENCE ENTRY.
  1131. * (B3) = FWA OF LOGICAL NAME ENTRY.
  1132. * (RDRF) = FWA OF *TDRF* ENTRY.
  1133. *
  1134. * EXIT TO *AMI7*.
  1135. * (B1) = 1.
  1136. *
  1137. * USES X - ALL.
  1138. * A - 1, 2, 3, 4, 5, 6, 7.
  1139. * B - 1, 3, 4, 7.
  1140. *
  1141. * CALLS ABS, CCS, CFS, CRQ, IOP, LIN, PFE,
  1142. * RAF, RAL, ROF, STK.
  1143. *
  1144. * MACROS FETCH, GETFLD, PUTFLD, REWINDM, STORE.
  1145.  
  1146.  
  1147. FOP SA1 B3+TLNFW LINK TO FREE FILE CONTROL ENTRIES
  1148.  
  1149. * CHECK FOR FREE FILE CONTROL TABLE ENTRY.
  1150.  
  1151. SX4 X1+ FWA OF FREE LINK
  1152. ZR X4,FOP3 IF NO FREE ENTRIES
  1153. SA2 X1 NEXT FREE ENTRY
  1154. MX0 60-TLNFN
  1155. SX6 X2 UPDATE FREE ENTRY CHAIN
  1156. BX1 X0*X1 CLEAR OLD POINTER TO NEXT FREE ENTRY
  1157.  
  1158. * FORMAT NEW FILE CONTROL ENTRY.
  1159.  
  1160. SA3 REQT PUT REQUEST INTO FILE CONTROL ENTRY
  1161. SB4 X4-TFNFW FWA OF FILE CONTROL ENTRY
  1162. BX6 X1+X6
  1163. SA6 A1
  1164. BX6 X3
  1165. SX7 B4 FWA OF FILE CONTROL ENTRY
  1166. SA6 B4+TFRQW
  1167. SA7 RFCB
  1168.  
  1169. * LINK NEW FILE CONTROL ENTRY TO OTHER FILE CONTROL ENTRIES
  1170. * FOR TRANSACTIONS AND OTHER FILE CONTROL ENTRIES FOR FILE.
  1171.  
  1172. SA5 B4+TFNTW LINK FOR FILES FOR TRANSACTION
  1173. SA4 B2+TSNFW LINK FOR TRANSACTION-S FILES
  1174. SX3 B3 FWA OF LOGICAL NAME ENTRY
  1175. LX3 TFLNS-17
  1176. BX5 X5+X3
  1177. RJ LIN INSERT FILE IN CHAIN FOR TRANSACTION
  1178. SA5 B4+TFNFW LINK WORD FOR *TFCB* FOR FILE
  1179. SA4 B3+TLNOW LINK FOR OPEN *TFCB* FOR FILE
  1180. BX5 X5-X5
  1181. RJ LIN INSERT FILE IN CHAIN FOR OPEN FILES
  1182. SA5 RDRF FWA OF CURRENT *TDRF* ENTRY
  1183. GETFLD 2,X5,TDOP CURRENT OPEN FILE COUNT
  1184. SX2 X2+B1 INCREMENT OPEN FILE COUNT
  1185. PUTFLD 2,X5,TDOP
  1186. SA1 B3+TLOPW
  1187. SX0 B1 UPDATE OPEN COUNTS
  1188. IX7 X0+X1
  1189. SA7 A1
  1190. SX0 B4+TFFTW FWA OF *FIT*
  1191. FETCH X0,OC,X5 *FIT* OPEN STATUS
  1192. SX5 X5-1
  1193. NZ X5,FOP4 IF *FIT* NOT OPEN
  1194.  
  1195. * POSITION FILE TO BEGINNING OF INFORMATION
  1196. * IF THIS IS NOT FIRST OPEN ON FILE SO
  1197. * SEQUENTIAL REQUESTS WILL BE POSITIONED CORRECTLY.
  1198.  
  1199. RJ CFS CHECK FATAL STATUS
  1200. NZ X6,FOP7 IF FATAL *CRM* STATUS
  1201. SA1 B3+TLNAW GET NUMBER OF ALTERNATE KEYS
  1202. MX7 -TLNAN
  1203. BX1 -X7*X1
  1204. ZR X1,FOP2 IF NO ALTERNATE KEYS
  1205. STORE X0,PKA=0,5,7,2
  1206. SA3 B3+TLKWW
  1207. RJ STK RESTORE PRIMARY KEY DESCRIPTION IN *FIT*
  1208. SX6 B0+
  1209. PUTFLD 6,B4,TFKO PRIMARY KEY ORDINAL
  1210. FOP2 REWINDM X0 REWIND FILE
  1211. RJ CCS CHECK *CRM* STATUS
  1212. RJ CRQ COMPLETE REQUEST
  1213. EQ AMI7 PROCESS NEXT NEW REQUEST
  1214.  
  1215. * FOR RECOVERABLE TASKS PREPARE FOR FREEING IF NOT ENOUGH
  1216. * TABLE SPACE FOR OPEN. FOR NON-RECOVERABLE TASKS,
  1217. * WHEN NOT ENOUGH FILE CONTROL TABLES EXIST TO
  1218. * OPEN A FILE, RELEASE ALL OPEN FILES FOR A TRANSACTION
  1219. * TO AVOID A DEADLOCK. THE NUMBER OF TIMES A FILE
  1220. * COULD NOT BE OPENED BECAUSE NOT ENOUGH TABLE SPACE
  1221. * EXISTS IS RECORDED TO HELP THE DATA BASE ADMINISTRATOR
  1222. * DECIDE ON THE NUMBER OF USERS TO SPECIFY ON THE *CRM*
  1223. * CARD.
  1224.  
  1225. FOP3 SA3 B3+TLNPW OPEN REJECTS
  1226. SX0 B1 UPDATE NUMBER OF OPEN REJECTS
  1227. IX6 X3+X0
  1228. BX7 X7-X7 NO FILE CONTROL ENTRY ASSIGNED
  1229. SA6 A3
  1230. SA7 RFCB
  1231. SX6 TERG NO SPACE FOR OPEN ERROR CODE
  1232. RJ PFE PREPARE FOR FREEING IF RECOVERABLE
  1233. ZR X6,AMI7 IF FREEING TO OCCUR
  1234. SB7 B0+ RELEASE ALL LOCKS
  1235. RJ RAL RELEASE ALL LOCKS FOR TRANSACTION
  1236. RJ RAF RELEASE ALL OPEN FILES FOR TRANSACTION
  1237. SX6 TERG NO SPACE FOR OPEN TASK ERROR
  1238. RJ CRQ COMPLETE REQUEST
  1239. EQ AMI7 PROCESS NEXT NEW REQUEST
  1240.  
  1241. * OPEN *FIT* FOR FIRST TASK USAGE.
  1242.  
  1243. FOP4 RJ IOP INITIAL FILE OPEN
  1244. FOP5 SA6 FOPA SAVE POSSIBLE ERROR CODE
  1245. SB1 1 RESTORE (B1)
  1246. RJ ABS COMPUTE ABSOLUTE TASK ADDRESS
  1247. SA1 FOPA ERROR CODE
  1248. SX6 X1+
  1249. ZR X6,FOP6 IF NO ERROR
  1250. SA3 RLNT FWA OF *TLNT* ENTRY
  1251. SA4 RFCB FWA OF *TFCB* ENTRY
  1252. SB3 X3
  1253. SB4 X4
  1254. RJ ROF RELEASE ONE FILE
  1255. SA1 FOPA ERROR CODE
  1256. SX6 X1+
  1257.  
  1258. FOP6 RJ CRQ COMPLETE REQUEST
  1259. EQ AMI7 PROCESS NEXT NEW REQUEST
  1260.  
  1261. FOP7 RJ CCS CHECK *CRM* STATUS
  1262. EQ FOP5 FINISH REQUEST
  1263.  
  1264. FOPA BSS 1 SAVE ERROR CODE
  1265. LFL SPACE 4,10
  1266. ** FRE - FREE PROCESSOR.
  1267. *
  1268. * RESTORE RECOVERABLE FILE TO PRE-TASK UPDATE
  1269. * CONDITION. BEFORE IMAGES, GENERATED BY THE TASK,
  1270. * ARE APPLIED TO THE FILE SO AS TO UNDO UPDATES
  1271. * MADE BY THE TASK PRIOR TO A *DBCOMIT* REQUEST.
  1272. * NOTE - FOR A SINGLE TASK BEGIN/COMMIT SEQUENCE,
  1273. * SUBROUTINE *LBI* WILL RECORD A BEFORE IMAGE FOR ONLY
  1274. * THE FIRST UPDATE TO A SINGLE RECORD. SUBSEQUENT
  1275. * UPDATES TO THE SAME RECORD ARE NOT RECORDED ON THE *BRF*.
  1276. * IF FREEING OCCURS, NON-FATAL *CRM* ERRORS MAY BE DETECTED.
  1277. * EXAMPLE -
  1278. *
  1279. * TASK UPDATE BEFORE IMAGE
  1280. * *********** ************
  1281. *
  1282. * 1. REWRITE RECORD A BEFORE IMAGE RECORDED
  1283. * 2. WRITE RECORD B BEFORE IMAGE RECORDED
  1284. * 3. DELETE RECORD C BEFORE IMAGE RECORDED
  1285. * 4. DELETE RECORD A NO BEFORE IMAGE RECORDED IF RECORD LOCK
  1286. * 5. DELETE RECORD B NO BEFORE IMAGE RECORDED IF RECORD LOCK
  1287. * 6. WRITE RECORD C NO BEFORE IMAGE RECORDED IF RECORD LOCK
  1288. *
  1289. * FOR SOME REASON FREEING OCCURS AT THIS POINT.
  1290. * BEFORE IMAGES WILL BE APPLIED FROM LAST TO FIRST.
  1291. * NOTE THAT NO BEFORE IMAGES RECORDED FOR UPDATES
  1292. * 4, 5, AND 6 BECAUSE TASK HAD ONLY RECORD LOCK.
  1293. * IF TASK HAD FILE LOCK ALL UPDATES WOULD HAVE
  1294. * GENERATED BEFORE IMAGE RECORDS.
  1295. *
  1296. * *FRE* ATTEMPTS TO APPLY BEFORE IMAGES
  1297. * TO ROLL-BACK TASK UPDATES -
  1298. *
  1299. * FIRST ATTEMPT NON-FATAL RE-TRY
  1300. * BEFORE IMAGE FREE UPDATE CRM ERROR FREE UPDATE
  1301. * ************ *********** ********* ***********
  1302. *
  1303. * 6. NONE NONE - NOTE RECORD C IS IN FILE
  1304. * 5. NONE NONE - NOTE RECORD B NOT IN FILE
  1305. * 4. NONE NONE - NOTE RECORD A NOT IN FILE
  1306. * 3. DELETE RECORD C WRITE RECORD C 446 REWRITE REC C
  1307. * 2. WRITE RECORD B DELETE RECORD B 445 IGNORE ERROR
  1308. * 1. REWRITE RECORD A REWRITE RECORD A 445 WRITE REC A
  1309. *
  1310. * NON-FATAL *CRM* ERROR CODE -
  1311. * 445 - KEY (RECORD) NOT FOUND ERROR.
  1312. * 446 - KEY (RECORD) ALREADY EXISTS ERROR.
  1313. *
  1314. * THE NON-FATAL *CRM* ERRORS ARE REPORTED AFTER
  1315. * THE UPDATE ATTEMPT IN WRITE/REWRITE AND DELETE
  1316. * REQUEST COMPLETION PROCESSORS *WDC* AND *WRD*.
  1317. * SUBROUTINE *LBK* IS CALLED BY *WDC* AND *WRD*
  1318. * AFTER UPDATE ATTEMPT, *LBK* WILL CAUSE ERROR
  1319. * RETURN FROM THE COMPLETION PROCESSORS IF
  1320. * THE NON-FATAL *CRM* ERROR OCCURS WHILE FREEING.
  1321. * FATAL *CRM* ERRORS WHILE FREEING ARE SAVED
  1322. * AT *LBK*, HOWEVER NO ERROR IS REPORTED TO
  1323. * THE COMPLETION PROCESSORS *WDC* OR *WRD*.
  1324. * THIS IS DONE SO THAT THE BEFORE IMAGE WILL BE
  1325. * RECORDED ON THE AFTER IMAGE RECOVERY FILE EVEN IF
  1326. * THE ROLL BACK UPDATE CANNOT BE APPLIED TO THE FILE.
  1327. * IF NON-FATAL *CRM* ERROR OCCURS ON THE RETRY
  1328. * ATTEMPT, *LBK* WILL PROCESS AS FOR FATAL *CRM*
  1329. * ERROR.
  1330. * ONCE A FATAL *CRM* ERROR IS DETECTED THE
  1331. * CONDITION WILL REMAIN TRUE. NOTE THAT IF A
  1332. * FATAL ERROR CONDITION IS DETECTED IN *CAR*
  1333. * ON REQUEST WHILE FREEING THE REQUEST CANNOT
  1334. * BE COMPLETED BY *CAR* AS FOR NORMAL (NON FREE)
  1335. * REQUEST COMPLETION PROCESSING.
  1336. *
  1337. * ENTRY (B2) = FWA OF *TSEQ* ENTRY.
  1338. * (RCOD) = *TAF CRM* REQUEST CODE.
  1339. * (RDRF) = FWA OF *TDRF* ENTRY.
  1340. * (REQT) = REQUEST.
  1341. *
  1342. * EXIT (X6) = ZERO, IF NO ERROR.
  1343. * = NONZERO, IF ERROR OCCURED WHILE FREEING.
  1344. *
  1345. * USES X - 1, 2, 3, 5, 6, 7.
  1346. * A - 1, 2, 5, 6, 7.
  1347. * B - 5, 7.
  1348. *
  1349. * MACROS GETFLD, PUTFLD.
  1350. *
  1351. * CALLS ARR, CQB, CTW, FLS, MVD, PBH, RAF, RAL, RBI
  1352. * RQF, SEK, SFC, WBI.
  1353.  
  1354.  
  1355. FRE BX6 X6-X6 NO ERROR
  1356. GETFLD 1,B2,TSBI BEFORE IMAGES WRITTEN COUNT
  1357. ZR X1,FRE8 IF NOTHING TO ROLL BACK
  1358. SA1 RDRF FWA OF CURRENT DATA BASE *TDRF* ENTRY
  1359. SA1 X1+TDFRW FREE COUNT
  1360. SX7 B1
  1361. IX7 X1+X7 INCREMENT FREE COUNT
  1362. SA7 A1+ STORE NEW COUNT OF FREE PROCESS
  1363.  
  1364. * APPLY BEFORE IMAGE RECORDS TO FILES.
  1365.  
  1366. FRE1 GETFLD 1,B2,TSBI BEFORE IMAGE RECORD COUNT
  1367. ZR X1,FRE8 IF NO BEFORE IMAGES
  1368. SX6 B0 NO ERROR
  1369. PUTFLD 6,B2,TSRF CLEAR RETRY ROLLBACK FLAG
  1370. SX2 FRE2 FREE CONTINUATION ADDRESS
  1371. PUTFLD 2,B2,TSCP STORE DB REQUEST CONTINUATION ADDRESS
  1372. EQ CAR7 GET NEXT ACTIVE REQUEST
  1373.  
  1374. FRE2 RJ CQB WAIT FOR *BRF* NOT BUSY
  1375. NZ X6,FRE11 IF *BRF* DOWN
  1376. ZR B5,CAR7 IF *BRF* BUSY - GET NEXT CONTINUATION
  1377. GETFLD 1,B5,TQSQ
  1378. NZ X1,FRE3 IF *TBRF* RESERVED FOR THIS TASK
  1379. SX2 B2 FWA OF *TSEQ* ENTRY
  1380. PUTFLD 2,B5,TQSQ RESERVE *TBRF* FOR THIS TASK
  1381. GETFLD 1,B2,TSQR RANDOM SECTOR ADRS. FROM *TSEQ*
  1382. GETFLD 2,B5,TQPI PRU*S PER BEFORE IMAGE RECORD
  1383. IX6 X1-X2 DECREMENT RANDOM ADDRESS
  1384. PUTFLD 6,B2,TSQR STORE NEW *RR* FOR NEXT BI WRITE
  1385. BX7 X6 *RR* FIELD
  1386. RJ RBI READ BEFORE IMAGE RECORD
  1387. GETFLD 2,B2,TSBI BEFORE IMAGE RECORD COUNT
  1388. SX1 B1
  1389. IX2 X2-X1 COUNT DOWN BEFORE IMAGE COUNT
  1390. PUTFLD 2,B2,TSBI STORE NEW BI COUNT
  1391. SX6 B0+ NO ERROR
  1392. EQ CAR7 GET NEXT CONTINUATION ADDRESS
  1393.  
  1394. FRE3 SA1 B5+TQFTW FWA OF *BRF* BUFFER FROM *TBRF*
  1395. SB5 X1+ FWA OF *BRF* BUFFER
  1396. SA1 B5+XQFNW LFN FROM BI RECORD HEADER
  1397. RJ SFC SEARCH FOR *TFCB* AND *FIT* FOR LFN
  1398. NZ X6,FRE11 IF FILE NOT OPEN ERROR
  1399. GETFLD 1,B5,XQKS KEY SIZE IN CHARS. FROM BI RECORD HEADER
  1400. BX7 X1
  1401. RJ CTW CONVERT KEY SIZE TO WORDS
  1402. SX2 B5+XQKAW FWA OF KEY AREA IN BI RECORD
  1403. SX3 B4+TFKYW FWA OF KEY AREA IN *TFCB*
  1404. RJ MVD MOVE KEYS FROM BI RECORD TO *TFCB*
  1405. MX7 -TSBFN
  1406. LX7 TSBFS-TSBFN+1
  1407. SA1 B2+TSRQW ORIGINAL *TAF CRM* REQUEST
  1408. BX7 -X7+X1 SET INTERNAL FREE PROCESS FLAG
  1409. SA7 A1 STORE ORIGINAL REQUEST WITH FREE FLAG
  1410. MX6 -TSFCN
  1411. LX6 TSFCS-TSFCN+1
  1412. BX6 X6*X7 CLEAR ORIGINAL REQUEST CODE
  1413. GETFLD 1,B5,XQTY GET REQUEST CODE FROM BI RECORD HEADER
  1414. SX2 TRWR *WRITE* REQUEST CODE
  1415. SX3 X1-TRDE
  1416. ZR X3,FRE4 IF BEFORE IMAGE IS FROM *DELETE*
  1417. SX2 TRDE *DELETE* REQUEST CODE
  1418. SX3 X1-TRWR
  1419. ZR X3,FRE4 IF BEFORE IMAGE IS FROM *WRITE*
  1420. SX2 TRRW *REWRITE* REQUEST CODE
  1421. FRE4 SX7 X2 REQUEST CODE
  1422. LX2 TSFCS-TSFCN+1
  1423. SA7 RCOD STORE REQUEST CODE
  1424. IX6 X6+X2 FORM NEW REQUEST TO APPLY BEFORE IMAGE
  1425. SX7 B4 FWA OF *TFCB* ENTRY
  1426. SA7 RFCB STORE FWA OF *TFCB* FOR USE BY *SEK*
  1427. SA6 REQT STORE NEW *TAF CRM* REQUEST
  1428. SA6 B4+TFRQW STORE REQUEST IN *TFCB* IN CASE *SEK* FAILS
  1429. RJ SEK SEEK KEY TO INITIATE NEW REQUEST
  1430. SA2 B2+TSRFW CHECK IF SECOND TIME
  1431. SX6 B0
  1432. PUTFLD 6,B2,TSCP CLEAR CONTINUATION ADDRESS
  1433. LX2 59-TSRFS
  1434. NG X2,CAR7 IF SECOND TIME ACTIVE REQUESTS
  1435. SA6 RFCB CLEAR *RFCB* FOR CONTINUATION
  1436. EQ CAR7 PROCESS NEXT CONTINUATION ADDRESS
  1437.  
  1438. * *CRM* ERROR REPORTED ONLY IF NON-FATAL ERROR
  1439. * 445 OR 446 DETECTED BY *LBK* ON FIRST ATTEMPT.
  1440. * CHANGE REQUEST TO ROLLBACK AND RETRY UPDATE.
  1441.  
  1442. FRE5 MX7 -TSRFN
  1443. LX7 TSRFS-TSRFN+1
  1444. SA1 B2+TSRFW FLAG FOR SECOND ATTEMPT AT ROLLBACK
  1445. BX7 -X7+X1 SET SECOND ATTEMPT FLAG
  1446. SA7 A1+
  1447. MX6 -TFFCN
  1448. SA2 B4+TFRQW REQUEST GENERATED ON FIRST ATTEMPT
  1449. LX6 TFFCS-TFFCN+1
  1450. BX6 X6*X2 CLEAR REQUEST CODE
  1451. BX1 -X6*X2 GET REQUEST CODE
  1452. LX1 TFFCN-1-TFFCS RIGHT JUSTIFY REQUEST CODE
  1453. SX2 TRRW *REWRITE* CODE
  1454. SX3 X1-TRWR
  1455. ZR X3,FRE4 IF *WRITE* DO *REWRITE*
  1456. SX2 TRWR *WRITE* CODE
  1457. SX3 X1-TRRW
  1458. ZR X3,FRE4 IF *REWRITE* DO *WRITE*
  1459. SX6 B0+ IGNORE ERROR ON *DELETE*
  1460.  
  1461. * ENTER HERE FROM *WDC* AND *WRD* AFTER ROLL-BACK ATTEMPT.
  1462. * IF *CRM* ERROR CODE PRESENT IT IS NON-FATAL, (SEE *LBK*).
  1463.  
  1464. FRE6 BSS 0 NON-FATAL ERROR ON DELETE IGNORED
  1465.  
  1466. FRE7 SX1 X6-TERI CHECK FOR NON-FATAL *CRM* ERROR
  1467. ZR X1,FRE5 IF NON FATAL *CRM* ERROR FROM *LBK*
  1468. MX7 -TFPAN
  1469. LX7 TFPAS-TFPAN+1
  1470. SA1 B4+TFPAW REQUEST IN *TFCB*
  1471. BX7 X7*X1 CLEAR PARAMETER ADDRESS
  1472. SA7 A1
  1473. SA1 B2+TSQFW FWA OF ASSIGNED *TBRF*
  1474. LX1 TSQFN-1-TSQFS
  1475. SB5 X1 FWA OF *TBRF*
  1476. SA1 B5+TQSQW
  1477. MX7 -TQSQN
  1478. LX7 TQSQS-TQSQN+1
  1479. BX7 X7*X1
  1480. SA7 A1 CLEAR RESERVE ON *TBRF*
  1481. EQ FRE1 CONTINUE FREE PROCESS
  1482.  
  1483. * ALL BEFORE IMAGES HAVE BEEN APPLIED TO THE
  1484. * APPROPRIATE FILES AND/OR THE *ARF*.
  1485. *
  1486. * WRITE FREE OR CEASE STAMP ON *BRF*.
  1487.  
  1488. FRE8 SX2 FRE9 CONTINUATION ADDRESS
  1489. PUTFLD 2,B2,TSCP STORE DB REQUEST CONTINUATION ADDRESS
  1490. SA1 B2+TSRQW ORIGINAL REQUEST
  1491. LX1 59-TSBFS
  1492. PL X1,FRE9 IF NO IMAGES ROLLED BACK
  1493. RJ FLS ISSUE *FLUSHM* FOR TASKS RECOVERABLE FILES
  1494.  
  1495. * WAIT FOR *BRF* NOT BUSY.
  1496. * RESERVE *TBRF* ENTRY AND WRITE STAMP.
  1497.  
  1498. FRE9 RJ CQB WAIT FOR *BRF* NOT BUSY
  1499. NZ X6,FRE11 IF *BRF* DOWN
  1500. ZR B5,CAR7 IF *BRF* BUSY - GET NEXT CONTINUATION
  1501. GETFLD 1,B5,TQSQ
  1502. NZ X1,FRE11 IF *TBRF* RESERVED FOR THIS TASK
  1503. SX2 B2 FWA OF *TSEQ* ENTRY
  1504. PUTFLD 2,B5,TQSQ RESERVE *TBRF* FOR THIS TASK
  1505. GETFLD 5,B2,TSFC ORIGINAL *TAF CRM* REQUEST
  1506. SX1 X5-DMCC
  1507. ZR X1,FRE10 IF DATA MANAGER CEASE REQUEST
  1508. SX1 X5-TRTR
  1509. ZR X1,FRE10 IF *TRMREC* REQUEST, SAME AS *CEASE*
  1510. SX5 TRDF *DBFREE* REQUEST CODE
  1511. FRE10 RJ PBH PREPARE BI FREE OR CEASE STAMP
  1512. RJ ARR ASSIGN *RR* FOR FIRST PRU OF *BRF* SEGMENT
  1513. MX2 60 (ALL ONES)
  1514. PUTFLD 2,B2,TSBI SET BI RECORD COUNT SO INCREMENT IS ZERO
  1515. RJ WBI WRITE BI *DBFREE* / *CEASE* STAMP ON *BRF*
  1516. SX6 B0+
  1517. EQ CAR7 GET NEXT CONTINUATION ADDRESS
  1518.  
  1519. FRE11 MX7 -TQSQN
  1520. LX7 TQSQS-TQSQN+1
  1521. SA1 B5+TQSQW
  1522. BX7 X7*X1
  1523. SA7 A1 CLEAR RESERVE ON *TBRF*
  1524. NZ X6,FRE12 IF *BRF* DOWN
  1525. SA1 B2+TSRQW ORIGINAL REQUEST
  1526. LX1 59-TSBFS
  1527. NG X1,FRE18 IF BEFORE IMAGES APPLIED, STAMP *ARF*
  1528. FRE12 MX7 -TSERN
  1529. LX7 TSERS-TSERN+1
  1530. SA1 B2+TSERW ERROR CAUSED OR OCCURRED WHILE FREEING
  1531. BX2 -X7*X1 GET ERROR CODE
  1532. BX7 X7*X1 CLEAR ERROR CODE
  1533. SA7 A1+
  1534. NZ X6,FRE13 IF *BRF* DOWN
  1535. SX6 X2+
  1536. FRE13 SA6 RERR SAVE POSSIBLE ERROR CODE
  1537. SX2 B0
  1538. PUTFLD 2,B2,TSCP CLEAR CONTINUATION ADDRESS
  1539. SA2 B2+TSRQW ORIGINAL *TAF CRM* REQUEST
  1540. GETFLD 1,B2,TSFC ORIGINAL *TAF CRM* REQUEST CODE
  1541. BX7 X2
  1542. SA7 REQT RESTORE ORIGINAL *TAF CRM* REQUEST
  1543. SX7 X1+ ORIGINAL REQUEST CODE
  1544. SA7 RCOD RESTORE ORIGINAL *TAF CRM* REQUEST CODE
  1545. SX2 X1-DMCC
  1546. ZR X2,FRE15 IF ORIGINAL *TAF CRM* REQUEST IS CEASE
  1547. SX2 X1-TRTR
  1548. ZR X2,FRE15 IF ORIGINAL *TAF CRM* REQUEST IS *TRMREC*
  1549.  
  1550. * ORIGINAL REQUEST NOT CEASE OR *TRMREC*
  1551.  
  1552. SB7 B1+ FOR RELEASE RECORD LOCKS
  1553. SX1 X1-TRDF
  1554. ZR X1,FRE14 IF *DBFREE* REQUEST
  1555. SB7 B0+ FOR RELEASE ALL LOCKS (RECORD AND FILE)
  1556. FRE14 RJ RAL RELEASE LOCKS
  1557. EQ FRE17 COMPLETE REQUEST
  1558.  
  1559. * COMPLETE DATA MANAGER CEASE AND *TRMREC* REQUESTS.
  1560.  
  1561. FRE15 RJ RQF RELEASE *BRF* ASSIGNMENT
  1562. SB7 B0+
  1563. RJ RAL RELEASE ALL RECORD AND FILE LOCKS
  1564. RJ RAF RELEASE ALL FILES
  1565. SX6 B0+
  1566. SB7 TSEQE LENGTH OF *TSEQ* ENTRY
  1567. FRE16 SB7 B7-B1
  1568. SA6 B2+B7 CLEAR *TSEQ* ENTRY
  1569. NZ B7,FRE16 IF MORE WORDS
  1570. SA6 RFCB NO *TFCB* ENTRY
  1571. FRE17 SA1 RERR
  1572. SX6 X1+
  1573. RJ CRQ COMPLETE REQUEST
  1574. EQ CAR7 GET NEXT ACTIVE REQUEST
  1575.  
  1576. * FREEING COMPLETED WITHOUT *ARF* OR *BRF* FAILURE.
  1577. * WRITE FREE STAMP ON *ARF*.
  1578.  
  1579. FRE18 SX2 FRE19 CONTINUATION ADDRESS
  1580. PUTFLD 2,B2,TSCP STORE CONTINUATION ADDRESS
  1581. FRE19 RJ CLB CHECK IF *ARF* AVAILABLE
  1582. SX1 X6
  1583. SX6 B0
  1584. NZ X1,FRE12 IF *ARF* DOWN
  1585. ZR B5,CAR7 IF *ARF* BUSY - NEXT CONTINUATION
  1586. PUTFLD 6,B2,TSCP CLEAR CONTINUATION ADDRESS
  1587. SX5 TRDF *DBFREE* REQUEST CODE
  1588. RJ PAH PREPARE FREE STAMP
  1589. SB7 B1+ REQUEST FORCED FLUSH
  1590. RJ WAI WRITE FREE STAMP ON *ARF*
  1591. SX6 B0+ NO ERROR
  1592. EQ FRE12 COMPLETE FREE PROCESS
  1593.  
  1594. SPACE 4,10
  1595. ** LFL - LOCK FILE LOCK.
  1596. *
  1597. * EXIT TO *AMI7*.
  1598. *
  1599. * USES B - 7.
  1600. *
  1601. * CALLS CRQ, LOK, PFE.
  1602.  
  1603.  
  1604. LFL SB7 B1 FILE LOCK REQUEST
  1605. RJ LOK LOCK FILE
  1606. ZR X6,LFL1 IF LOCK GRANTED
  1607. RJ PFE PREPARE FOR FREEING IF RECOVERABLE TASK
  1608. ZR X6,AMI7 IF FREEING TO OCCUR
  1609. LFL1 RJ CRQ COMPLETE REQUEST
  1610. EQ AMI7 GET NEXT NEW REQUEST
  1611. LFU SPACE 4,10
  1612. ** LFU - LOCK FILE UNLOCK.
  1613. *
  1614. * EXIT TO *AMI7*.
  1615. *
  1616. * USES B - 7.
  1617. *
  1618. * CALLS CRQ, UNL.
  1619.  
  1620.  
  1621. LFU SB7 B1 FILE UNLOCK REQUEST
  1622. RJ UNL UNLOCK FILE
  1623. RJ CRQ COMPLETE REQUEST
  1624. EQ AMI7 GET NEXT NEW REQUEST
  1625. LRL SPACE 4,15
  1626. ** LRL - LOCK RECORD LOCK.
  1627. *
  1628. * ENTRY (TADR) = ABSOLUTE ADDRESSES OF REQUEST PARAMETERS.
  1629. * (X0) = FWA OF *FIT*.
  1630. *
  1631. * EXIT TO *AMI7*.
  1632. *
  1633. * USES X - 1, 2, 3, 5, 7.
  1634. * A - 1, 2, 3, 5.
  1635. * B - 7.
  1636. *
  1637. * CALLS CRQ, KEX, LOK, PFE.
  1638. *
  1639.  
  1640.  
  1641. LRL SA1 TADR+TPKL FWA OF KEY AREA
  1642. SA2 TADR+TPPL FWA OF KEY POSITION
  1643. SA3 RLNT FWA OF LOGICAL NAME ENTRY
  1644. SA5 X3+TLKLW GET PRIMARY KEY LENGTH
  1645. MX7 -TLKLN
  1646. LX5 TLKLN-TLKLS-1
  1647. BX3 -X7*X5
  1648. RJ KEX EXTRACT KEY FROM TASK
  1649. NZ X6,LRL1 IF ERROR IN KEY
  1650. SB7 B0+ RECORD LOCK REQUEST
  1651. RJ LOK LOCK RECORD
  1652. ZR X6,LRL1 IF LOCK GRANTED
  1653. RJ PFE PREPARE FOR FREEING IF RECOVERABLE TASK
  1654. ZR X6,AMI7 IF FREEING TO OCCUR
  1655. LRL1 RJ CRQ COMPLETE REQUEST
  1656. EQ AMI7 GET NEXT NEW REQUEST
  1657. LRU SPACE 4,15
  1658. ** LRU - LOCK RECORD UNLOCK.
  1659. *
  1660. * ENTRY (TADR) = ABSOLUTE ADDRESSES OF REQUEST PARAMETERS.
  1661. * (X0) = FWA OF *FIT*.
  1662. *
  1663. * EXIT TO *AMI7*.
  1664. *
  1665. * USES X - 1, 2, 3, 5, 7.
  1666. * A - 1, 2, 3, 5.
  1667. * B - 7.
  1668. *
  1669. * CALLS CRQ, KEX, UNL.
  1670. *
  1671.  
  1672.  
  1673. LRU SA1 TADR+TPKL FWA OF KEY AREA
  1674. SA2 TADR+TPPL FWA OF KEY POSITION
  1675. SA3 RLNT FWA OF LOGICAL NAME ENTRY
  1676. SA5 X3+TLKLW GET PRIMARY KEY LENGTH
  1677. MX7 -TLKLN
  1678. LX5 TLKLN-TLKLS-1
  1679. BX3 -X7*X5
  1680. RJ KEX EXTRACT KEY FROM TASK
  1681. NZ X6,LRU1 IF ERROR IN KEY
  1682. SB7 2 RECORD UNLOCK REQUEST
  1683. RJ UNL UNLOCK RECORD
  1684. LRU1 RJ CRQ COMPLETE REQUEST
  1685. EQ AMI7 GET NEXT REQUEST
  1686. PSB SPACE 4,15
  1687. ** PSB - POSITION SKIP BACKWARD.
  1688. *
  1689. * ENTRY (X0) = FWA OF *FIT*.
  1690. * (TADR) = ABSOLUTE ADDRESSES OF REQUEST PARAMETERS.
  1691. *
  1692. * EXIT TO *AMI7*.
  1693. *
  1694. * USES X - 1, 2, 3.
  1695. * A - 1, 2.
  1696. *
  1697. * CALLS CCS, CFS, CRQ.
  1698. *
  1699. * MACROS FETCH, SKIPBL, STORE.
  1700.  
  1701.  
  1702. PSB RJ CFS CHECK FATAL STATUS
  1703. NZ X6,PSB1 IF FATAL STATUS
  1704. FETCH X0,FP,X2 FILE POSITION
  1705. SX3 X2-1
  1706. ZR X3,PSB2 IF FILE AT BEGINNING OF INFORMATION
  1707. SA1 TADR+TPCT FWA OF SKIP COUNT
  1708. SA2 X1 SKIP COUNT
  1709. SKIPBL X0,X2 SKIP BACKWARD
  1710. PSB1 RJ CCS CHECK *CRM* STATUS
  1711. RJ CRQ COMPLETE REQUEST
  1712. EQ AMI7 GET NEXT NEW REQUEST
  1713.  
  1714. PSB2 STORE X0,ES=100B SET POSITION OUTSIDE FILE BOUNDARY
  1715. EQ PSB1 CHECK *CRM* STATUS
  1716. PSF SPACE 4,15
  1717. ** PSF - POSITION SKIP FORWARD.
  1718. *
  1719. * ENTRY (X0) = FWA OF *FIT*.
  1720. * (TADR) = ABSOLUTE ADDRESSES OF REQUEST PARAMETERS.
  1721. *
  1722. * EXIT TO *AMI7*.
  1723. *
  1724. * USES X - 1, 2, 3, 6.
  1725. * A - 1, 2.
  1726. *
  1727. * CALLS CCS, CFS, CRQ.
  1728. *
  1729. * MACROS FETCH, SKIPBL.
  1730.  
  1731.  
  1732. PSF RJ CFS CHECK FATAL STATUS
  1733. NZ X6,PSF1 IF FATAL STATUS
  1734. FETCH X0,FP,X2 FILE POSITION
  1735. SX3 X2-100B
  1736. SX6 TERV EOI STATUS
  1737. ZR X3,PSF2 IF AT EOI
  1738. SA1 TADR+TPCT FWA OF SKIP COUNT
  1739. SA2 X1 SKIP COUNT
  1740. SKIPFL X0,X2 SKIP FORWARD
  1741. PSF1 RJ CCS CHECK *CRM* STATUS
  1742. PSF2 RJ CRQ COMPLETE REQUEST
  1743. EQ AMI7 GET NEXT NEW REQUEST
  1744. PRW SPACE 4,10
  1745. ** PRW - POSITION REWIND.
  1746. *
  1747. * ENTRY (X0) = FWA OF *FIT*.
  1748. *
  1749. * EXIT TO *AMI7*.
  1750. *
  1751. * CALLS CCS, CFS, CRQ.
  1752. *
  1753. * MACROS REWINDM.
  1754.  
  1755.  
  1756. PRW RJ CFS CHECK FATAL STATUS
  1757. NZ X6,PRW1 IF FATAL STATUS
  1758. REWINDM X0
  1759. PRW1 RJ CCS CHECK *CRM* STATUS
  1760. RJ CRQ COMPLETE REQUEST
  1761. EQ AMI7 GET NEXT NEW REQUEST
  1762. RDB SPACE 4,15
  1763. ** RDB - READ BEGIN.
  1764. *
  1765. * ENTRY (TADR) = ABSOLUTE ADDRESSES OF PARAMETERS.
  1766. * (X0) = FWA OF *FIT*.
  1767. * (B4) = FWA OF FILE CONTROL ENTRY.
  1768. *
  1769. * EXIT TO *AMI7*.
  1770. *
  1771. * USES X - 1, 2, 3.
  1772. * A - 1, 2.
  1773. *
  1774. * CALLS CRQ, KEX, SEK, SFO.
  1775. *
  1776. * MACROS FETCH, STORE.
  1777.  
  1778.  
  1779. RDB SA1 TADR+TPRO ALTERNATE KEY ORDINAL
  1780. RJ SFO SET KEY ORDINAL IN FILE CONTROL ENTRY
  1781. NZ X6,RDB1 IF ERROR ON KEY ORDINAL
  1782. SA1 TADR+TPKA FWA OF KEY AREA
  1783. SA2 TADR+TPKP FWA OF KEY POSITION
  1784. STORE X0,MKL=0 CLEAR MAJOR KEY SEARCH
  1785. FETCH X0,KL,X3 GET KEY LENGTH
  1786. RJ KEX EXTRACT KEY FROM TASK
  1787. NZ X6,RDB1 IF ERROR IN KEY
  1788. RJ SEK SEEK KEY
  1789. NZ X6,RDB1 IF *CRM* ERROR
  1790. EQ AMI7 GET NEXT NEW REQUEST
  1791.  
  1792. RDB1 RJ CRQ COMPLETE REQUEST
  1793. EQ AMI7 GET NEXT NEW REQUEST
  1794. RDC SPACE 4,15
  1795. ** RDC - READ COMPLETE.
  1796. *
  1797. * ENTRY (X0) = FWA OF *FIT*.
  1798. * (B4) = FWA OF FILE CONTROL ENTRY.
  1799. * (VAMB) = FWA OF RECORD BUFFER.
  1800. *
  1801. * EXIT TO *CAR7*.
  1802. *
  1803. * USES X - 2, 3, 4.
  1804. * A - 2, 3, 4.
  1805. *
  1806. * CALLS CCS, CFS, CRQ, MVK, MVR, RLS.
  1807. *
  1808. * MACROS GET.
  1809.  
  1810.  
  1811. RDC RJ CFS CHECK FATAL STATUS
  1812. NZ X6,RDC1 IF FATAL STATUS
  1813. SX3 B4+TFKYW FWA OF KEY
  1814. SA4 VAMB FWA OF RECORD BUFFER
  1815. SX4 X4
  1816. GET X0,X4,0,,X3 GET RECORD
  1817. RDC1 RJ CCS CHECK *CRM* STATUS
  1818. NZ X6,RDC2 IF *CRM* ERRORS
  1819. RJ MVR MOVE RECORD TO TASK
  1820. NZ X6,RDC2 IF WORKING STORAGE TOO SMALL FOR RECORD
  1821. SA2 TADR+TPRR FWA OF PRIMARY KEY RETURN AREA LENGTH
  1822. NG X2,RDC2 IF NO KEY RETURN AREA
  1823. SA3 TADR+TPRK FWA OF PRIMARY KEY RETURN AREA
  1824. NG X3,RDC2 IF NO KEY RETURN AREA
  1825. RJ MVK MOVE KEY TO RETURN AREA
  1826. NZ X6,RDC2 IF KEY AREA LENGTH TOO SMALL ERROR
  1827. SA3 TADR+TPLB
  1828. NG X3,RDC2 IF LOCK STATUS ADDRESS NOT SPECIFIED
  1829. SX0 X3+
  1830. RJ RLS RETURN LOCK STATUS TO TASK
  1831. RDC2 RJ CRQ COMPLETE REQUEST
  1832. EQ CAR7 GET NEXT ACTIVE REQUEST
  1833. REC SPACE 4,15
  1834. ** REC - RECOVER FILES FOR TRANSACTION FACILITY.
  1835. *
  1836. * ENTRY (CMMB) = FWA FOR *CMM*.
  1837. * (RDRT) = FWA OF FIRST *TDRF* ENTRY.
  1838. * (REQT) = REQUEST.
  1839. *
  1840. * EXIT TO *AMIX*.
  1841. * (B1) = 1.
  1842. *
  1843. * USES X - 1, 2, 3, 4, 5, 6, 7.
  1844. * A - 1, 2, 3, 4, 5, 6, 7.
  1845. *
  1846. * MACROS GETFLD, PUTFLD.
  1847. *
  1848. * CALLS DDB.
  1849.  
  1850.  
  1851. REC SA5 RDRT FWA OF *TDRF* ENTRY
  1852. SA4 REQT CURRENT REQUEST
  1853. ZR X5,REC5 IF ALL DATA BASES PROCESSED
  1854. SA1 VMFL
  1855. SA2 CMMD
  1856. IX3 X1-X2
  1857. BX7 X1
  1858. ZR X3,REC0 IF MAXIMUM FL ALREADY UPDATED
  1859.  
  1860. * NOTE - THE FOLLOWING CODE DEPENDS UPON THIS INTERFACE
  1861. * WITH CMM -
  1862. *
  1863. * (FWA OF CMM) = LWA OF CMM.
  1864. * (LWA OF CMM - 7) = LOCATION WHICH CMM USES TO DETERMINE
  1865. * MAXIMUM FL IT MAY USE.
  1866.  
  1867. SA1 CMMB
  1868. BX6 X1 UPDATE CMM HIGHEST HIGH ADDRESS
  1869. SA7 A2
  1870. SA3 X1
  1871. SA6 VHHA
  1872. SX3 X3+
  1873. ZR X3,REC0 IF CMM HAS NOT BEEN EXECUTED
  1874. SA7 X3-7 SET MAXIMUM FL FOR CMM
  1875. REC0 BX7 X7-X7
  1876. SA7 X4 INDICATE REQUEST NOT COMPLETE
  1877. NG X5,REC2 IF PROCESSING DATA BASE FILES
  1878.  
  1879. * PROCESS DATA BASE.
  1880.  
  1881. MX7 1
  1882. BX7 X7+X5 SET PROCESS FILES FLAG
  1883. SA7 A5
  1884. MX0 42
  1885. SA1 VLWP SETUP RA+65 FOR *CMM*
  1886. SA2 CMMB FWA OF MEMORY FOR *CMM*
  1887. BX1 X0*X1
  1888. BX3 -X2
  1889. BX7 -X0*X3
  1890. BX7 X1+X7
  1891. SA7 A1
  1892. SX7 B0
  1893. SA1 X5+TDSDW DATA BASE DOWN/IDLE FLAG WORD
  1894. NG X1,REC1 IF DATA BASE ALREADY DOWN
  1895.  
  1896. * FORCE DATA BASE DOWN AND CLOSE AND
  1897. * RETURN ALL DATA BASE FILES.
  1898.  
  1899. SA7 RDDB CLEAR *RDDB* SO *DDB* USES *RDRT*
  1900. RJ DDB DOWN DATA BASE
  1901.  
  1902. * RETURN DATA BASE STATISTICS -
  1903. * DATA BASE NAME.
  1904. * NUMBER OF DBEGIN REQUESTS PROCESSED.
  1905. * NUMBER OF DBCOMIT REQUESTS PROCESSED.
  1906. * NUMBER OF DBFREE REQUESTS PROCESSED.
  1907.  
  1908. REC1 SA5 RDRT FWA OF DATA BASE *TDRF* ENTRY
  1909. SA4 REQT CURRENT REQUEST
  1910. SA2 X5+TDIDW DATA BASE ID (LEFT JUSTIFIED)
  1911. MX7 TDIDN
  1912. BX2 X7*X2
  1913. SX7 B1 REQUEST COMPLETE BIT
  1914. BX7 X2+X7
  1915. SA7 X4+ RETURN DATA BASE NAME TO *TAF*
  1916. SA1 X5+TDBGW NUMBER OF DBEGIN REQUESTS
  1917. SA2 X5+TDCMW NUMBER OF DBCOMIT REQUESTS
  1918. SA3 X5+TDFRW NUMBER OF DBFREE REQUESTS
  1919. BX7 X1
  1920. SA7 A7+B1 RETURN NUMBER OF DBEGINS
  1921. BX6 X2
  1922. SA6 A7+B1 RETURN NUMBER OF DBCOMITS
  1923. BX7 X3
  1924. SA7 A6+B1 RETURN NUMBER OF DBFREES
  1925. GETFLD 1,X5,TDNL FWA OF FIRST DATA BASE *TLNT* ENTRY
  1926. SX2 X1
  1927. EQ REC3 SETUP FWA OF FIRST *TLNT* TO PROCESS
  1928.  
  1929. * PROCESS DATA BASE FILES.
  1930. * RETURN DATA BASE FILE STATISTICS -
  1931. * FILE NAME.
  1932. * NUMBER OF OPENS.
  1933. * NUMBER OF OPENS REJECTED.
  1934. * NUMBER OF LOCKS ATTEMPTED.
  1935. * NUMBER OF LOCKS REJECTED.
  1936.  
  1937. REC2 SA1 VAMB FWA OF *TLNT* ENTRY TO PROCESS
  1938. AX1 24
  1939. SX3 X1 FWA OF *TLNT* ENTRY
  1940. ZR X3,REC4 IF NO *TLNT* ENTRY
  1941. SA1 X3 FILE NAME (LEFT JUSTIFIED)
  1942. MX7 TLFNN
  1943. BX1 X7*X1
  1944. SX7 B1 REQUEST COMPLETE BIT
  1945. BX7 X1+X7
  1946. SA7 X4 RETURN FILE NAME TO *TAF*
  1947. SA1 X3+TLOPW NUMBER OF OPENS
  1948. BX6 X1
  1949. SA6 A7+B1 RETURN NUMBER OF OPENS
  1950. SA2 X3+TLNPW NUMBER OF OPENS REJECTED
  1951. BX7 X2
  1952. SA7 A6+B1 RETURN NUMBER OF OPENS REJECTED
  1953. SA1 X3+TLRLW NUMBER OF LOCKS ATTEMPTED
  1954. BX6 X1
  1955. SA6 A7+B1 RETURN NUMBER OF LOCKS ATTEMPTED
  1956. SA2 X3+TLWLW NUMBER OF LOCKS REJECTED
  1957. BX7 X2
  1958. SA7 A6+B1 RETURN NUMBER OF LOCKS REJECTED
  1959. GETFLD 1,X5,TDLL FWA OF LAST *TLNT* ENTRY FOR DATA BASE
  1960. BX1 X1-X3
  1961. SA2 X3+ GET LINK TO NEXT *TLNT* ENTRY
  1962. REC3 ZR X1,REC4 IF LAST *TLNT* FOR DATA BASE
  1963. SX7 X2 FWA OF NEXT *TLNT* ENTRY
  1964. LX7 24
  1965. SA7 VAMB STORE FWA OF NEXT DATA BASE *TLNT*
  1966. EQ REC6 RETURN
  1967.  
  1968. * PREPARE TO PROCESS NEXT DATA BASE ON NEXT CALL.
  1969.  
  1970. REC4 SA2 X5 LINK TO NEXT *TDRF* ENTRY
  1971. SX7 X2 FWA OF NEXT *TDRF* ENTRY
  1972. SA7 RDRT STORE FWA OF NEXT *TDRF* TO PROCESS
  1973. EQ REC6 RETURN
  1974.  
  1975. * ALL DATA BASES AND FILES PROCESSED.
  1976. * INDICATE ALL PROCESSING COMPLETE BY RETURNING
  1977. * ZERO NAME.
  1978.  
  1979. REC5 SX7 B1+ REQUEST COMPLETE BIT
  1980. SA7 X4+ ZERO NAME, SET COMPLETE BIT
  1981. REC6 SX7 B0+
  1982. SA7 REQT CLEAR REQUEST
  1983. EQ AMIX RETURN
  1984.  
  1985. RLB SPACE 4,15
  1986. ** RID - RESTORE BEGIN IDENTIFIERS.
  1987. *
  1988. * ENTRY (B2) = FWA OF *TSEQ*.
  1989. * (RDRF) = FWA OF *TDRF*.
  1990. * (TADR) = ABSOLUTE ADDRESSES OF PARAMETERS.
  1991. *
  1992. * EXIT TO *AMI7*.
  1993. *
  1994. * USES X - 1, 2, 3, 6, 7.
  1995. * A - 1, 2, 3, 7.
  1996. *
  1997. * MACROS GETFLD.
  1998. *
  1999. * CALLS CRQ.
  2000.  
  2001.  
  2002. RID SA3 RDRF FWA OF DATA BASE *TDRF* ENTRY
  2003. GETFLD 2,X3,TDQN NUMBER OF *BRF-S* ASSIGNED DATA BASE
  2004. MX7 -TSBPN MASK FOR ID*S
  2005. SX6 TERAF NO RECOVERY FILES ERROR CODE
  2006. ZR X2,RID1 IF DATA BASE NOT ASSIGNED RECOVERY FILES
  2007. SA1 TADR+TPCI ADDRESS OF CURRENT ID
  2008. SA2 TADR+TPPI ADDRESS OF PREVIOUS ID
  2009. SA1 X1+ CURRENT ID
  2010. SA2 X2+ PREVIOUS ID
  2011. BX1 -X7*X1
  2012. BX2 -X7*X2
  2013. LX1 TSBCS-TSBCN+1
  2014. LX2 TSBPS-TSBPN+1
  2015. BX7 X1+X2
  2016. SA7 B2+TSBPW STORE CURRENT/PREVIOUS BEGIN ID*S
  2017. SA1 X3+TDSDW DATA BASE DOWN FLAG FROM *TDRF*
  2018. SX6 TERAK DATA BASE DOWN ERROR CODE
  2019. NG X1,RID1 IF DATA BASE IS DOWN
  2020. LX1 59-TDSIS
  2021. SX6 B0
  2022. PL X1,RID1 IF DATA BASE NOT IDLE
  2023. SX6 TERAG DATA BASE IDLE ERROR CODE
  2024. RID1 RJ CRQ COMPLETE REQUEST
  2025. EQ AMI7 PROCESS NEXT NEW REQUEST
  2026.  
  2027. SPACE 4,10
  2028. ** RLB - READ LOCK BEGIN.
  2029. *
  2030. * ENTRY (TADR) = ABSOLUTE ADDRESSES OF PARAMETERS.
  2031. * (X0) = FWA OF *FIT*.
  2032. * (B4) = FWA OF FILE CONTROL ENTRY.
  2033. *
  2034. * EXIT TO *AMI7*.
  2035. *
  2036. * USES X - 1, 2, 3.
  2037. * A - 1, 2, 3.
  2038. * B - 7.
  2039. *
  2040. * CALLS CRQ, KEX, LOK, PFE, SEK, SFO.
  2041. *
  2042. * MACROS FETCH, STORE.
  2043.  
  2044.  
  2045. RLB SA1 TADR+TPLO FWA OF ALTERNATE KEY ORDINAL
  2046. RJ SFO SET KEY ORDINAL IN FILE CONTROL ENTRY
  2047. NZ X6,RLB2 IF ERROR IN KEY ORDINAL
  2048. SA1 TADR+TPKA FWA OF KEY AREA
  2049. SA2 TADR+TPKP FWA OF KEY POSITION
  2050. STORE X0,MKL=0 CLEAR MAJOR KEY SEARCH
  2051. FETCH X0,KL,X3 KEY LENGTH
  2052. RJ KEX EXTRACT KEY FROM TASK
  2053. NZ X6,RLB2 IF ERROR IN KEY
  2054. SA3 RFCB FWA OF FILE CONTROL ENTRY
  2055. SA1 X3+TFKOW GET ALTERNATE KEY ORDINAL
  2056. MX3 -TFKON
  2057. LX1 TFKON-TFKOS-1
  2058. BX1 -X3*X1
  2059. NZ X1,RLB1 IF ALTERNATE KEY
  2060. SB7 B0+ RECORD LOCK REQUESTED
  2061. RJ LOK LOCK RECORD
  2062. ZR X6,RLB1 IF LOCK GRANTED
  2063. RJ PFE PREPARE FOR FREEING IF RECOVERABLE TASK
  2064. ZR X6,AMI7 IF FREEING TO OCCUR
  2065. EQ RLB2 COMPLETE REQUEST WITH ERROR
  2066.  
  2067. RLB1 RJ SEK SEEK KEY
  2068. NZ X6,RLB2 IF *CRM* ERROR
  2069. EQ AMI7 GET NEXT NEW REQUEST
  2070.  
  2071. RLB2 RJ CRQ COMPLETE REQUEST
  2072. EQ AMI7 GET NEXT NEW REQUEST
  2073. RLC SPACE 4,15
  2074. ** RLC - READ LOCK COMPLETE.
  2075. *
  2076. * ENTRY (TADR) = ABSOLUTE ADDRESSES OF PARAMETERS.
  2077. * (VAMB) = FWA OF RECORD BUFFER.
  2078. * (X0) = FWA OF *FIT*.
  2079. *
  2080. * EXIT TO *CAR7*.
  2081. *
  2082. * USES X - 1, 2, 3, 4.
  2083. * A - 1, 2, 3, 4.
  2084. * B - 7.
  2085. *
  2086. * CALLS CCS, CFS, CRQ, LOK, MVK, MVR, PFE.
  2087. *
  2088. * MACROS GET.
  2089.  
  2090.  
  2091. RLC RJ CFS CHECK FATAL STATUS
  2092. NZ X6,RLC1 IF FATAL STATUS
  2093. SA4 VAMB FWA OF RECORD BUFFER
  2094. SX3 B4+TFKYW FWA OF KEY RETURN AREA
  2095. SX4 X4
  2096. GET X0,X4,0,,X3 GET RECORD
  2097. RLC1 RJ CCS CHECK *CRM* STATUS
  2098. NZ X6,RLC4 IF *CRM* ERRORS
  2099. SA1 B4+TFKOW GET ALTERNATE KEY ORDINAL
  2100. MX3 -TFKON
  2101. LX1 TFKON-TFKOS-1
  2102. BX1 -X3*X1
  2103. SB7 B0 RECORD LOCK REQUEST
  2104. ZR X1,RLC2 IF PRIMARY KEY
  2105. RJ LOK LOCK KEY
  2106. ZR X6,RLC2 IF LOCK GRANTED
  2107. RJ PFE PREPARE TO FREE
  2108. ZR X6,AMI7 IF FREEING TO OCCUR
  2109. RLC2 NZ X6,RLC4 IF LOCK NOT GRANTED
  2110. SA2 TADR+TPRR FWA OF PRIMARY KEY RETURN AREA LENGTH
  2111. NG X2,RLC3 IF NO KEY RETURN AREA
  2112. SA3 TADR+TPRK FWA OF PRIMARY KEY RETURN AREA
  2113. NG X3,RLC3 IF NO KEY RETURN AREA
  2114. RJ MVK MOVE KEY TO TASK
  2115. NZ X6,RLC4 IF KEY RETURN AREA TOO SMALL FOR KEY
  2116. RLC3 RJ MVR MOVE RECORD TO TASK
  2117.  
  2118. RLC4 RJ CRQ COMPLETE REQUEST
  2119. EQ CAR7 CHECK NEXT ACTIVE REQUEST
  2120. RMB SPACE 4,15
  2121. ** RMB - READ MAJOR BEGIN.
  2122. *
  2123. * ENTRY (TADR) = ABSOLUTE ADDRESS OF REQUEST PARAMETERS.
  2124. *
  2125. * EXIT TO *AMI7*.
  2126. *
  2127. * USES X - 1, 2, 3, 4, 7.
  2128. * A - 1, 2, 3, 4.
  2129. *
  2130. * CALLS CRQ, KEX, SFO, SEK.
  2131. *
  2132. * MACROS FETCH, STORE.
  2133.  
  2134.  
  2135. RMB SA1 TADR+TPMO FWA OF ALTERNATE KEY ORDINAL
  2136. RJ SFO SET KEY ORDINAL IN FILE CONTROL ENTRY
  2137. NZ X6,RMB1 IF ERROR IN KEY ORDINAL
  2138. SA4 TADR+TPMM FWA OF MAJOR KEY LENGTH
  2139. SA2 TADR+TPPM FWA OF MAJOR KEY POSITION
  2140. SA1 TADR+TPYM FWA OF MAJOR KEY AREA
  2141. SA3 X4+ MAJOR KEY LENGTH
  2142. SX6 TERS INVALID KEY LENGTH ERROR
  2143. ZR X3,RMB1 IF INVALID KEY LENGTH
  2144. NG X3,RMB1 IF INVALID KEY LENGTH
  2145. FETCH X0,KL,X7
  2146. IX7 X7-X3
  2147. NG X7,RMB1 IF INVALID KEY LENGTH
  2148. STORE X0,MKL=X3 SET MAJOR KEY LENGTH
  2149. STORE X0,REL=GE SEEK FOR .GE. TO KEY
  2150. RJ KEX EXTRACT KEY FROM TASK
  2151. NZ X6,RMB1 IF ERROR IN KEY
  2152. RJ SEK SEEK KEY
  2153. NZ X6,RMB1 IF *CRM* ERROR
  2154. EQ AMI7 GET NEXT NEW REQUEST
  2155.  
  2156. RMB1 RJ CRQ COMPLETE REQUEST
  2157. EQ AMI7 GET NEXT NEW REQUEST
  2158. RMC SPACE 4,15
  2159. ** RMC - READ MAJOR COMPLETE.
  2160. *
  2161. * ENTRY (B4) = FWA OF FILE CONTROL ENTRY.
  2162. * (VAMB) = FWA OF RECORD BUFFER.
  2163. * (X0) = FWA OF *FIT*.
  2164. *
  2165. * EXIT TO *CAR7*.
  2166. *
  2167. * USES X - 0, 3, 4, 5.
  2168. * A - 5.
  2169. *
  2170. * CALLS CCS, CFS, CRQ, MVK, MVR, RLS.
  2171. *
  2172. * CALLS FETCH, GETN, START.
  2173.  
  2174.  
  2175.  
  2176. * POSITION FILE TO KEY.
  2177.  
  2178. RMC RJ CFS CHECK FATAL STATUS
  2179. NZ X6,RMC1 IF FATAL STATUS
  2180. SA5 TADR+TPMM FWA OF MAJOR KEY LENGTH
  2181. SX3 B4+TFKYW FWA OF KEY
  2182. SA5 X5+ MAJOR KEY LENGTH
  2183. START X0,,X3,,X5 POSITION TO KEY
  2184. RMC1 RJ CCS CHECK *CRM* STATUS
  2185. NZ X6,RMC2 IF *CRM* ERROR
  2186. SA5 VAMB FWA OF RECORD BUFFER
  2187. SX0 B4+TFFTW FWA OF *FIT*
  2188. SX3 B4+TFKYW FWA OF KEY
  2189. SX4 X5
  2190.  
  2191. * GET RECORD CONTAINING MAJOR KEY.
  2192.  
  2193. FETCH X0,PKA,X5 FWA OF PRIMARY KEY RETURN AREA
  2194. BX3 X3-X5 0 OR PRIMARY KEY AREA ADDRESS
  2195. GETN X0,X4,,X3 GET NEXT RECORD
  2196. RJ CCS CHECK *CRM* STATUS
  2197. NZ X6,RMC2 IF *CRM* ERROR
  2198. RJ MVR MOVE RECORD TO TASK
  2199. NZ X6,RMC2 IF WORKING STORAGE TOO SMALL FOR RECORD
  2200.  
  2201. * MOVE KEY TO TASK.
  2202.  
  2203. SA2 TADR+TPLN FWA OF PRIMARY KEY RETURN AREA LENGTH
  2204. SA3 TADR+TPKW FWA OF PRIMARY KEY RETURN AREA
  2205. RJ MVK MOVE KEY TO TASK
  2206. NZ X6,RMC2 IF KEY AREA LENGTH TOO SMALL ERROR
  2207. SA3 TADR+TPLC
  2208. NG X3,RMC2 IF LOCK STATUS ADDRESS NOT SPECIFIED
  2209. SX0 X3+
  2210. RJ RLS RETURN LOCK STATUS TO TASK
  2211. RMC2 RJ CRQ COMPLETE REQUEST
  2212. EQ CAR7 GET NEXT ACTIVE REQUEST
  2213. RNB SPACE 4,15
  2214. ** RNB - READ NEXT BEGIN.
  2215. *
  2216. * ENTRY (X0) = FWA OF *FIT*.
  2217. * (RCOD) = REQUEST CODE.
  2218. * (REQT) = LAST REQUEST.
  2219. * (B4) = FWA OF FILE CONTROL ENTRY
  2220. *
  2221. * EXIT TO *ROC* IF READ NEXT WITH LOCK.
  2222. *
  2223. * USES X - 2, 3, 4, 5, 6, 7.
  2224. * A - 2, 4, 6, 7.
  2225. *
  2226. * CALLS RNC, ROC.
  2227.  
  2228.  
  2229. RNB SA2 REQT GET CURRENT REQUEST
  2230. SA3 RCOD GET REQUEST CODE
  2231. BX7 X2
  2232. MX6 1
  2233. SA7 B4+TFRQW SAVE REQUEST IN FILE CONTROL ENTRY
  2234. SA2 B4+TFSKW SEEK COUNT
  2235. SA6 RNBA SET READ NEXT BEGIN FLAG
  2236. MX7 60-TFSKN
  2237. LX7 TFSKS-TFSKN+1
  2238. BX7 X7*X2
  2239. SA7 A2 ZERO SEEK COUNT
  2240. SX2 X3-TRRO
  2241. ZR X2,ROC IF READ NEXT LOCK
  2242. EQ RNC COMPLETE PROCESSING
  2243.  
  2244. RNBA BSSZ 1
  2245. RNC SPACE 4,15
  2246. ** RNC - READ NEXT COMPLETE.
  2247. *
  2248. * ENTRY (X0) = FWA OF *FIT*.
  2249. * (VAMB) = FWA OF RECORD BUFFER.
  2250. * (B4) = FWA OF FILE CONTROL ENTRY.
  2251. *
  2252. * EXIT TO *CAR7*.
  2253. * TO *AMI7* IF READ NEXT BEGIN.
  2254. *
  2255. * USES X - 2, 3, 4, 6.
  2256. * A - 2, 4.
  2257. *
  2258. * CALLS CCS, CFS, CRQ, MVK, MVR, RLS.
  2259. *
  2260. * MACROS FETCH, GETNR.
  2261.  
  2262.  
  2263. RNC RJ CFS CHECK FATAL STATUS
  2264. NZ X6,RNC1 IF FATAL STATUS
  2265. SA4 VAMB FWA OF RECORD BUFFER
  2266. FETCH X0,FP,X3 FILE POSITION
  2267. SX2 X3-100B
  2268. SX6 TERV EOI STATUS
  2269. ZR X2,RNC2 IF AT EOI
  2270. SX3 B4+TFKYW FWA OF KEY RETURN AREA
  2271. SX4 X4
  2272. FETCH X0,PKA,X5 FWA OF PRIMARY KEY RETURN AREA
  2273. BX3 X3-X5 0 OR PRIMARY KEY AREA ADDRESS
  2274. GETNR X0,X4,,X3 GET NEXT RECORD
  2275. RNC1 RJ CCS CHECK *CRM* STATUS
  2276. NZ X6,RNC2 IF *CRM* ERROR
  2277. FETCH X0,FP,X3 FILE POSITION
  2278. SX2 X3-100B
  2279. SX6 TERV EOI STATUS
  2280. ZR X2,RNC2 IF AT EOI
  2281. MX6 0
  2282. ZR X3,RNC3 IF NO DATA TRANSFERRED
  2283. RJ MVR MOVE RECORD TO TASK
  2284. NZ X6,RNC2 IF WORKING STORAGE TOO SMALL FOR RECORD
  2285. SA2 TADR+TPLN FWA OF PRIMARY KEY RETURN AREA LENGTH
  2286. SA3 TADR+TPKW FWA OF PRIMARY KEY RETURN AREA
  2287. RJ MVK MOVE KEY TO TASK
  2288. NZ X6,RNC2 IF KEY AREA LENGTH TOO SAMLL ERROR
  2289. SA3 TADR+TPLA
  2290. NG X3,RNC2 IF LOCK STATUS ADDRESS NOT SPECIFIED
  2291. SX0 X3+
  2292. RJ RLS RETURN LOCK STATUS TO TASK
  2293. RNC2 RJ CRQ COMPLETE REQUEST
  2294. RNC3 SA1 RNBA
  2295. ZR X1,CAR7 IF NOT READ NEXT BEGIN
  2296. MX7 0
  2297. SA7 A1 RESET FLAG
  2298. EQ AMI7 GET NEXT REQUEST
  2299. ROC SPACE 4,15
  2300. ** ROC - READ NEXT WITH LOCK COMPLETE.
  2301. *
  2302. * ENTRY (X0) = FWA OF *FIT*.
  2303. * (VAMB) = FWA OF RECORD BUFFER.
  2304. * (B4) = FWA OF FILE CONTROL ENTRY.
  2305. *
  2306. * EXIT TO *CAR7*
  2307. * TO *AMI7* IF READ NEXT BEGIN.
  2308. *
  2309. * USES X - 1, 2, 3, 4, 6.
  2310. * A - 1, 2, 3, 4.
  2311. * B - 7.
  2312. *
  2313. * CALLS CCS, CFS, CRQ, LOK, MVK, MVR, PFE.
  2314. *
  2315. * MACROS FETCH, GETNR.
  2316.  
  2317.  
  2318. ROC RJ CFS CHECK FATAL STATUS
  2319. NZ X6,ROC1 IF FATAL STATUS
  2320. SA4 VAMB FWA OF RECORD BUFFER
  2321. FETCH X0,FP,X3 FILE POSITION
  2322. SX2 X3-100B
  2323. SX6 TERV EOI STATUS
  2324. ZR X2,ROC2 IF AT EOI
  2325.  
  2326. SX3 B4+TFKYW FWA OF KEY RETURN AREA
  2327. SX4 X4
  2328. FETCH X0,PKA,X5 FWA OF PRIMARY KEY RETURN AREA
  2329. BX3 X3-X5 0 OR PRIMARY KEY AREA ADDRESS
  2330. GETNR X0,X4,,X3 GET NEXT RECORD
  2331. ROC1 RJ CCS CHECK *CRM* STATUS
  2332. NZ X6,ROC2 IF *CRM* ERROR
  2333. FETCH X0,FP,X5
  2334. MX6 0
  2335. ZR X5,ROC3 IF NO DATA TRANSFERRED
  2336. SX2 X5-100B
  2337. SX6 TERV EOI STATUS
  2338. ZR X2,ROC2 IF AT EOI
  2339.  
  2340. * FOR GET NEXT WITH LOCK, THE LOCK MUST BE DONE AFTER
  2341. * GETTING THE RECORD SINCE THE KEY IS UNKNOWN UNTIL
  2342. * THE RECORD IS RETRIEVED.
  2343.  
  2344. SB7 B0+ RECORD LOCK REQUEST
  2345. RJ LOK LOCK KEY
  2346. NZ X6,ROC4 IF LOCK NOT GRANTED
  2347. RJ MVR MOVE RECORD TO TASK
  2348. NZ X6,ROC2 IF WORKING STORAGE TOO SMALL FOR RECORD
  2349. SA2 TADR+TPLN FWA OF PRIMARY KEY RETURN AREA LENGTH
  2350. SA3 TADR+TPKW FWA OF PRIMARY KEY RETURN AREA
  2351. RJ MVK MOVE KEY TO TASK
  2352. ROC2 RJ CRQ COMPLETE REQUEST
  2353. ROC3 SA1 RNBA
  2354. ZR X1,CAR7 IF NOT READ NEXT BEGIN
  2355. MX7 0
  2356. SA7 A1 RESET FLAG
  2357. EQ AMI7 GET NEXT REQUEST
  2358.  
  2359. ROC4 RJ PFE PREPARE FOR FREEING IF RECOVERABLE TASK
  2360. ZR X6,ROC3 IF FREEING TO OCCUR
  2361. EQ ROC2 COMPLETE REQUEST WITH ERROR
  2362.  
  2363. SPACE 4,10
  2364. ** SIC - CRMSIC BATCH RECOVERY REQUEST PROCESSOR.
  2365. *
  2366. * ENTRY (B2) = FWA OF *TSEQ* ENTRY.
  2367. * (TADR) = ABSOLUTE ADDRESSES OF PARAMETERS.
  2368. *
  2369. * EXIT (X6) = ZERO, IF NO ERROR.
  2370. * = *TERB*, IF DATA BASE/FILE NOT INSTALLED.
  2371. * = *TERAD*, IF INVALID JOB SEQUENCE NUMBER.
  2372. * = *TERAG*, IF DATA BASE IDLING DOWN.
  2373. * = *TERAK*, IF DATA BASE DOWN, OR
  2374. * IF DATA BASE CANNOT BE UPPED.
  2375. *
  2376. * USES X - 0, 1, 2, 3, 4, 6, 7.
  2377. * A - 1, 2, 6, 7.
  2378. * B - 2, 4.
  2379. *
  2380. * MACROS GETFLD, PUTFLD.
  2381. *
  2382. * CALLS CDD, CRQ, DBU, FDB, NMS, UDB.
  2383.  
  2384.  
  2385. SIC SA1 TADR+TPFN ADDRESS OF FILE NAME
  2386. SA2 TADR+TPFC ADDRESS OF FUNCTION CODE
  2387. SA1 X1 FILE NAME
  2388. SA2 X2 FUNCTION
  2389. SX2 X2-2 CHECK IF DB FILE RECOVERY RESPONSE
  2390. ZR X2,SIC1 IF DB FILE RECOVERED
  2391. LX1 12 LEFT JUSTIFY DB ID IN ARF/BRF FILE NAME
  2392. SIC1 RJ FDB SEARCH FOR DATA BASE *TDRF* ENTRY
  2393. SX6 TERB DATA BASE NOT FOUND ERROR
  2394. SA7 RDRF STORE FWA OF *TDRF* ENTRY
  2395. ZR X7,SIC4 IF DATA BASE *TDRF* ENTRY NOT FOUND
  2396. SA1 TADR+TPBS ADDRESS OF JOB SEQUENCE NUMBER
  2397. SA1 X1 JOB SEQUENCE NUMBER
  2398. RJ CDD CONVERT TO DECIMAL DISPLAY CODE
  2399. MX0 1
  2400. SB2 B2-1
  2401. AX0 X0,B2 FORM MASK FOR LEFT JUSTIFIED NUMBER
  2402. BX6 X0*X4
  2403. SB4 59-6 MAXIMUM LEFT SHIFT COUNT FOR PERIOD
  2404. SB2 B4-B2 LEFT SHIFT COUNT FOR PERIOD
  2405. SX7 1R.
  2406. LX7 B2,X7 POSITION PERIOD
  2407. BX7 X6+X7 MERGE NUMBER AND PERIOD
  2408. SA7 MSGKA STORE REPLY NUMBER IN MESSAGE
  2409. SA2 RDRF FWA OF DATA BASE *TDRF* ENTRY
  2410. SB4 X2 FWA OF *TDRF* ENTRY
  2411. MX7 TDIDN
  2412. SA2 B4+TDIDW DATA BASE ID
  2413. SA1 MSGK FWA OF RESPONSE MESSAGE
  2414. RJ NMS REPORT SIC RESPONSE
  2415. SA2 TADR+TPBS ADDRESS OF JOB SEQUENCE NUMBER
  2416. GETFLD 1,B4,TDBJ OUTSTANDING BATCH SEQUENCE NUMBERS
  2417. MX7 -TDJBN
  2418. SA2 X2 RESPONSE SEQUENCE NUMBER
  2419. BX3 X7*X1 CLEAR *TDJB*
  2420. BX4 X2-X1 COMPARE *TDJB* WITH RESPONSE NUMBER
  2421. BX4 -X7*X4
  2422. ZR X4,SIC2 IF RESPONSE MATCHES *TDJB*
  2423. BX3 -X7*X1 CLEAR *TDJA*
  2424. LX1 TDJAN-1-TDJAS RIGHT JUSTIFY *TDJA*
  2425. BX4 X2-X1 COMPARE *TDJA* WITH RESPONSE NUMBER
  2426. BX4 -X7*X4
  2427. ZR X4,SIC2 IF RESPONSE MATCHES *TDJA*
  2428. SX6 TERAD INVALID BATCH JOB SEQUENCE NUMBER ERROR
  2429. EQ SIC4 STOP SIC PROCESS
  2430.  
  2431. SIC2 PUTFLD 3,B4,TDBJ STORE SEQUENCE NUMBERS
  2432. SA1 B4+TDSDW DATA BASE STATUS
  2433. SA2 TADR+TPFC ADDRESS OF FUNCTION CODE
  2434. NG X1,SIC3 IF DATA BASE IS DOWN
  2435. SA2 X2 FUNCTION CODE
  2436. SX6 B0 NO ERROR
  2437. SX2 X2-2 CHECK FOR DB FILE RECOVERED CODE
  2438. NZ X2,SIC4 IF NOT DB FILE RECOVERED
  2439. EQ DBU ATTEMPT TO UP DATA BASE FILE
  2440.  
  2441. SIC3 SX6 TERAG DATA BASE IDLE ERROR CODE
  2442. SA2 B4+TDRQW DATA BASE DOWN REASON FLAGS
  2443. LX1 59-TDSIS
  2444. NG X1,SIC4 IF DATA BASE IDLING DOWN
  2445. LX2 59-TDODS
  2446. SX6 TERAK DATA BASE DOWN ERROE CODE
  2447. NG X2,SIC4 IF DATA BASE DOWN BY OPERATOR
  2448. RJ UDB ATTEMPT TO UP DATA BASE
  2449. SIC4 RJ CRQ COMPLETE REQUEST
  2450. EQ AMI7 PROCESS NEXT NEW REQUEST
  2451.  
  2452. SPACE 4,10
  2453. STB SPACE 4,15
  2454. ** STB - START BEGIN.
  2455. *
  2456. * ENTRY (X0) = FWA OF *FIT*.
  2457. * (TADR) = ABSOLUTE ADDRESSES OF PARAMETERS.
  2458. *
  2459. * EXIT TO *AMI7*.
  2460. *
  2461. * USES X - 1, 2, 3, 4, 6, 7.
  2462. * A - 1, 2, 3, 4.
  2463. *
  2464. * CALLS CRQ, KEX, SEK, SFO.
  2465. *
  2466. * MACROS FETCH, STORE.
  2467.  
  2468.  
  2469. STB SA1 TADR+TPSO FETCH ALTERNATE KEY
  2470. RJ SFO SET KEY ORDINAL IN FILE CONTROL ENTRY
  2471. NZ X6,STB3 IF ERROR IN KEY ORDINAL
  2472. SA1 TADR+TPSR FWA OF RELATION PARAMETER
  2473. MX7 -12
  2474. SA1 X1 GET RELATION PARAMETER
  2475. LX1 12
  2476. BX7 -X7*X1 EXTRACT 2 CHARACTERS
  2477. SX1 X7-2REQ
  2478. SX3 #EQ#
  2479. ZR X1,STB1 IF PARAMETER VALUE *EQ*
  2480. SX1 X7-2RGE
  2481. SX3 #GE#
  2482. ZR X1,STB1 IF RELATION PARAMETER VALUE *GE*
  2483. SX1 X7-2RGT
  2484. SX3 #GT#
  2485. ZR X1,STB1 IF RELATION PARAMETER VALUE *GT*
  2486. SX6 TERAA ILLEGAL RELATION PARAMETER
  2487. EQ STB3 COMPLETE REQUEST
  2488.  
  2489. STB1 STORE X0,REL=X3
  2490. SA1 TADR+TPSK FWA OF KEY AREA
  2491. SA2 TADR+TPSP FWA OF KEY POSITION
  2492. SA4 TADR+TPSM FWA OF MAJOR KEY LENGTH
  2493. FETCH X0,KL,X3 GET KEY LENGTH
  2494. NG X4,STB2 IF NO MAJOR KEY
  2495. SA3 X4
  2496. SX6 TERS INVALID KEY LENGTH ERROR
  2497. ZR X3,STB3 IF INVALID KEY LENGTH
  2498. NG X3,STB3 IF INVALID KEY LENGTH
  2499. FETCH X0,KL,X7
  2500. IX7 X7-X3
  2501. NG X7,STB3 IF INVALID KEY LENGTH
  2502. STORE X0,MKL=X3 SET MAJOR KEY LENGTH
  2503. STB2 RJ KEX EXTRACT KEY FROM TASK
  2504. NZ X6,STB3 IF ERROR IN KEY
  2505. SX0 B4+TFFTW FWA OF *FIT*
  2506. FETCH X0,REL,X6
  2507. SX6 X6-#GT#
  2508. NZ X6,STB2.1 IF RELATION NOT *.GT.*
  2509. SA4 B4+TFKOW
  2510. MX3 -TFKON
  2511. LX4 TFKON-TFKOS-1
  2512. BX3 -X3*X4 GET CURRENT KEY ORDINAL
  2513. NZ X3,STC IF ALTERNATE KEY ACCESS
  2514. STB2.1 RJ SEK SEEK KEY
  2515. NZ X6,STB3 IF *CRM* ERROR
  2516. EQ AMI7 GET NEXT NEW REQUEST
  2517.  
  2518. STB3 RJ CRQ COMPLETE REQUEST
  2519. EQ AMI7 GET NEXT NEW REQUEST
  2520. STC SPACE 4,15
  2521. ** STC - START COMPLETE.
  2522. *
  2523. * ENTRY (TADR) = ABSOLUTE ADDRESSES OF PARAMETERS.
  2524. * (B4) = FWA OF FILE CONTROL ENTRY.
  2525. * (X0) = FWA OF *FIT*.
  2526. *
  2527. * EXIT TO *CAR7*
  2528. *
  2529. * USES X - 1, 3, 4.
  2530. * A - 1, 4.
  2531. *
  2532. * CALLS CCS, CFS, CRQ.
  2533. *
  2534. * MACROS START.
  2535.  
  2536.  
  2537. STC RJ CFS CHECK FATAL STATUS
  2538. NZ X6,STC2 IF FATAL ERROR
  2539. SA1 TADR+TPSM FWA OF MAJOR KEY LENGTH
  2540. SX3 B4+TFKYW FWA OF KEY RETURN AREA
  2541. SX4 B0+ FWA OF MAJOR KEY LENGTH
  2542. NG X1,STC1 IF NO MAJOR KEY
  2543. SA4 X1+ FWA OF MAJOR KEY LENGTH
  2544. STC1 START X0,,X3,0,X4
  2545. STC2 RJ CCS CHECK CRM STATUS
  2546. RJ CRQ COMPLETE REQUEST
  2547. EQ CAR7 CHECK NEXT ACTIVE REQUEST
  2548. WDC SPACE 4,15
  2549. ** TRC - TERMINATE RECOVERY REQUEST PROCESSOR.
  2550. *
  2551. * THE *TRMREC* REQUEST IS PROCESSED EXACTLY AS FOR
  2552. * DATA MANAGER CEASE, EXCEPT THAT STATUS IS
  2553. * RETURNED TO TASK.
  2554. *
  2555. * ENTRY (B2) = FWA OF *TSEQ*.
  2556. * (RDRF) = FWA OF *TDRF*.
  2557. * (REQT) = REQUEST.
  2558. * (RCOD) = REQUEST CODE.
  2559. *
  2560. * EXIT TO *CEA*, TO PROCESS AS DATA MANAGER CEASE.
  2561.  
  2562.  
  2563. TRC EQ CEA PROCESS *TRMREC* AS *CEASE*
  2564.  
  2565. SPACE 4,10
  2566. ** WDC - WRITE DELETE COMPLETE.
  2567. *
  2568. * ENTRY (B4) = FWA OF FILE CONTROL ENTRY.
  2569. * (B3) = FWA OF *TLNT*.
  2570. * (B2) = FWA OF *TSEQ*.
  2571. * (X0) = FWA OF *FIT*.
  2572. * (RCOD) = REQUEST CODE.
  2573. *
  2574. * EXIT TO *CAR7*, IF NORMAL PROCESSING.
  2575. * TO *FRE5*, IF INTERNAL DBFREE PROCESSING.
  2576. *
  2577. * USES X - 1, 3.
  2578. * A - 1.
  2579. *
  2580. * CALLS CCS, CFS, CRQ, LAI, LBI, LBK.
  2581. *
  2582. * MACROS DELETE.
  2583.  
  2584.  
  2585. WDC SA1 B2+TSAIW CHECK IF WAITING FOR *ARF*
  2586. LX1 59-TSAIS
  2587. NG X1,WDC2 IF WAITING TO LOG AFTER IMAGE
  2588. RJ CFS CHECK FATAL STATUS
  2589. NZ X6,WDC1 IF FATAL *CRM* ERROR
  2590. RJ LBI LOG BEFORE IMAGE RECORD
  2591. NZ X6,WDC3 IF *CRM* ERROR
  2592. SX3 B4+TFKYW FWA OF KEY AREA
  2593. DELETE X0,,X3
  2594. WDC1 RJ CCS CHECK *CRM* STATUS
  2595. RJ LBK LOG BEFORE IMAGE RECORD KEYS IF NO ERROR
  2596. NZ X6,WDC3 IF *CRM* ERRORS
  2597. WDC2 RJ LAI LOG AFTER IMAGE RECORD OR *BRF* DOWN STAMP
  2598. WDC3 SA1 B4+TFBFW
  2599. LX1 59-TFBFS
  2600. NG X1,FRE7 IF INTERNAL FREE PROCESSING
  2601. WDC4 RJ CRQ COMPLETE REQUEST
  2602. EQ CAR7 GET NEXT ACTIVE REQUEST
  2603. WRB SPACE 4,15
  2604. ** WRB - WRITE BEGIN.
  2605. *
  2606. * ENTRY (TADR) = ABSOLUTE ADDRESSES OF PARAMETERS.
  2607. * (B2) = FWA OF *TSEQ*.
  2608. * (B3) = FWA OF *TLNT*.
  2609. * (B4) = FWA OF *TFCB*.
  2610. * (X0) = FWA OF *FIT*.
  2611. * (RLNT) = FWA OF LOGICAL NAME ENTRY.
  2612. *
  2613. * EXIT TO *AMI7*.
  2614. *
  2615. * USES X - 1, 2, 3, 5, 6, 7.
  2616. * A - 1, 2, 3, 7.
  2617. * B - 7.
  2618. *
  2619. * CALLS CRQ, CTW, KEX, LOK, PFE, SEK, STK.
  2620. *
  2621. * MACROS FETCH, GETFLD.
  2622.  
  2623.  
  2624. WRB SA1 B3+TLRFW RECOVERABLE FILE FLAG FROM *TLNT*
  2625. SA2 B2+TSBRW *DBEGIN* PROCESSED FLAG FROM *TSEQ*
  2626. LX1 59-TLRFS
  2627. PL X1,WRB1 IF FILE IS NOT RECOVERABLE TYPE
  2628. LX2 59-TSBRS
  2629. SX6 TERAI UPDATE PRIOR TO DBEGIN REQUEST ERROR CODE
  2630. PL X2,WRB4 IF *DBEGIN* REQUEST NOT PROCESSED
  2631. SX1 CRMUPM MAXIMUM UPDATES PER BEGIN/COMMIT SEQ.
  2632. GETFLD 2,B2,TSBI GET NUMBER OF IMAGES ON *BRF* FROM *TSEQ*
  2633. IX1 X1-X2
  2634. SX6 TERAJ UPDATES PER BEGIN/COMMIT EXCEEDED ERROR
  2635. ZR X1,WRB4 IF UPDATES PER BEGIN/COMMIT SEQ. EXCEEDED
  2636. WRB1 SA3 B3+TLKWW PRIMARY KEY DESCRIPTOR
  2637. RJ STK SET KEY TO PRIMARY KEY
  2638. SA2 RCOD REQUEST CODE
  2639. SX3 X2-TRDE
  2640. ZR X3,WRB5 IF DELETE REQUEST
  2641. SX3 X2-TRRW
  2642. ZR X3,WRB2 IF REWRITE REQUEST
  2643. FETCH X0,FO,X5
  2644. SX5 X5-6
  2645. ZR X5,WRB7 IF FILE ORGANIZATION IS ACTUAL KEY (AK)
  2646. WRB2 SA1 TADR+TPWK FWA OF KEY AREA
  2647. SA2 TADR+TPWP FWA OF KEY POSITION
  2648. WRB3 FETCH X0,KL,X3 GET KEY LENGTH
  2649. RJ KEX EXTRACT KEY FROM TASK
  2650. NZ X6,WRB4 IF ERROR IN KEY
  2651. SB7 B0+ RECORD LOCK REQUEST
  2652. RJ LOK LOCK KEY
  2653. NZ X6,WRB6 IF LOCK NOT GRANTED
  2654. RJ SEK SEEK KEY
  2655. NZ X6,WRB4 IF *CRM* ERROR
  2656. EQ AMI7 GET NEXT NEW REQUEST
  2657.  
  2658. WRB4 RJ CRQ COMPLETE REQUEST
  2659. EQ AMI7 GET NEXT NEW REQUEST
  2660.  
  2661. WRB5 SA1 TADR+TPDK FWA OF KEY AREA
  2662. SA2 TADR+TPDP FWA OF KEY POSITION
  2663. EQ WRB3 GET KEY LENGTH
  2664.  
  2665. WRB6 RJ PFE PREPARE FOR FREEING IF RECOVERABLE TASK
  2666. NZ X6,WRB4 IF NO FREEING TO OCCUR
  2667. EQ AMI7 GET NEXT NEW REQUEST
  2668.  
  2669. WRB7 FETCH X0,EMK,X5
  2670. NZ X5,WRB8 IF EMBEDDED KEY IN AK FILE
  2671. SA2 TADR+TPWX
  2672. NG X2,WRB2 IF NO KEY RETURN AREA
  2673. SA3 TADR+TPWY
  2674. NG X3,WRB2 IF NO KEY RETURN AREA
  2675. SA3 X3
  2676. ZR X3,WRB2 IF NO KEY RETURN AREA
  2677. WRB8 FETCH X0,KL,X7 KEY LENGTH IN CHARACTERS
  2678. RJ CTW
  2679. MX6 0 ZERO WORD - NO ERRORS
  2680. SB7 X1 NUMBER OF WORDS FOR KEY
  2681. SX5 B4+TFKYW FWA OF KEY AREA
  2682. WRB9 SB7 B7-B1 CLEAR KEY AREA IN *TFCB* ENTRY
  2683. SA6 X5+B7 ZERO WORD IN KEY AREA
  2684. NZ B7,WRB9 IF KEY AREA NOT CLEAR
  2685.  
  2686. * SAVE REQUEST IN FILE CONTROL ENTRY AND
  2687. * CLEAR SEEK COUNTER SO REQUEST COMPLETION
  2688. * WILL BE INITIATED BY *CAR*.
  2689.  
  2690. MX7 -TFSKN SEEK COUNT MASK
  2691. LX7 TFSKS-TFSKN+1
  2692. SA1 B4+TFSKW
  2693. BX7 X7*X1 CLEAR SEEK COUNT FIELD
  2694. SA7 A1
  2695. SA2 REQT REQUEST
  2696. BX7 X2
  2697. SA7 B4+TFRQW SAVE REQUEST IN FILE CONTROL ENTRY
  2698. EQ AMI7 GET NEXT NEW REQUEST
  2699. WRC SPACE 4,15
  2700. ** WRC - WRITE COMPLETE.
  2701. *
  2702. * ENTRY (X0) = FWA OF *FIT*.
  2703. * (B2) = FWA OF TRANSACTION SEQUENCE ENTRY.
  2704. * (B3) = FWA OF LOGICAL NAME ENTRY.
  2705. * (B4) = FWA OF FILE CONTROL ENTRY.
  2706. * (TADR) = ABSOLUTE PARAMETER ADDRESSES.
  2707. * (VAMB) = FWA OF RECORD BUFFER.
  2708. * (RCOD) = REQUEST CODE.
  2709. *
  2710. * EXIT TO *CAR7*, IF NORMAL PROCESSING.
  2711. * TO *FRE7*, IF INTERNAL FREE PROCESSING.
  2712. *
  2713. * USES X - 1, 2, 3, 5, 7.
  2714. * A - 1, 2, 3, 5, 7.
  2715. * B - 7.
  2716. *
  2717. * CALLS CRQ, LOK, MVK, PFE.
  2718.  
  2719.  
  2720. WRC RJ WRD COMPLETE WRITE
  2721. SA1 B4+TFBFW
  2722. LX1 59-TFBFS
  2723. NG X1,FRE7 IF INTERNAL FREE PROCESSING
  2724. NZ X6,WRC1 IF ERROR
  2725. SA2 RCOD REQUEST CODE
  2726. SX2 X2-TRWR
  2727. NZ X2,WRC1 IF NOT WRITE REQUEST
  2728. FETCH X0,FO,X5
  2729. SX5 X5-6 CHECK *AK* FILE ORGANIZATION
  2730. NZ X5,WRC1 IF NOT ACTUAL KEY FILE ORGANIZATION
  2731. SB7 B0+
  2732. RJ LOK LOCK RECORD
  2733. NZ X6,WRC2 IF LOCK NOT GRANTED
  2734. SA1 B5+TKQRW GET,ONCE RECORDED FLAG
  2735. SX7 TKQRN
  2736. LX7 TKQRS-TKQRN+1
  2737. BX7 X1+X7
  2738. SA7 A1 SET BEFOR IMAGE RECORDED ONCE FLAG
  2739. SA2 TADR+TPWY FWA OF KEY RETURN AREA LENGTH
  2740. SA3 TADR+TPWX FWA OF KEY RETURN AREA ADDRESS
  2741. NG X3,WRC1 IF NO KEY RETURN AREA ADDRESS
  2742. NG X2,WRC1 IF NO KEY RETURN AREA LENGTH
  2743. RJ MVK MOVE KEY TO TASK RETURN AREA
  2744. WRC1 RJ CRQ COMPLETE REQUEST
  2745. EQ CAR7 GET NEXT ACTIVE REQUEST
  2746.  
  2747. WRC2 RJ PFE PREPARE FOR FREEING IF RECOVERABLE TASK
  2748. NZ X6,WRC1 IF NO FREEING TO OCCUR
  2749. EQ CAR7 GET NEXT ACTIVE REQUEST
  2750. WRD SPACE 4,15
  2751. ** WRD - WRITE DIRECTLY.
  2752. *
  2753. * ENTRY (X0) = FWA OF *FIT*.
  2754. * (B2) = FWA OF TRANSACTION SEQUENCE ENTRY.
  2755. * (B3) = FWA OF LOGICAL NAME ENTRY.
  2756. * (B4) = FWA OF FILE CONTROL ENTRY.
  2757. * (TADR) = ABSOLUTE PARAMETER ADDRESSES.
  2758. * (VAMB) = FWA OF RECORD BUFFER.
  2759. * (RCOD) = REQUEST CODE.
  2760. *
  2761. * USES X - ALL.
  2762. * A - 1, 2, 3, 4, 5.
  2763. * B - 5.
  2764. *
  2765. * CALLS CCS, CFS, CTW, LAI, LBI, LBK, MVE=.
  2766. *
  2767. * MACROS FETCH, GETFLD, PUT, REPLACE.
  2768.  
  2769.  
  2770. WRD SUBR ENTRY/EXIT
  2771. SA1 B2+TSAIW
  2772. LX1 59-TSAIS
  2773. NG X1,WRD4 IF WAITING TO WRITE AFTER IMAGE RECORD
  2774. RJ CFS CHECK FATAL STATUS
  2775. NZ X6,WRD3 IF FATAL *CRM* ERROR
  2776. SA2 B4+TFBFW
  2777. LX2 59-TFBFS
  2778. PL X2,WRD1 IF NORMAL PROCESSING, NOT DBFREE
  2779.  
  2780. * FOR DBFREE PROCESS, RECORD IS IN *BRF* BUFFER.
  2781.  
  2782. SA1 B2+TSQFW FWA OF ASSIGNED *TBRF* FROM *TSEQ*
  2783. LX1 TSQFN-1-TSQFS
  2784. SA1 X1+TQFTW FWA OF *BRF* BUFFER FROM *TBRF* FET
  2785. SB5 X1+
  2786. GETFLD 1,B5,XQKS KEY SIZE IN CHARACTERS FROM BI RECORD
  2787. BX7 X1
  2788. RJ CTW CONVERT KEY SIZE TO WORDS
  2789. SX5 B5+XQKAW FWA OF KEY-AREA IN BEFORE IMAGE RECORD
  2790. GETFLD 2,B5,XQRS RECORD SIZE IN CHARACTERS FROM BI RECORD
  2791. IX5 X5+X1 FWA OF RECORD-AREA IN BEFORE IMAGE RECORD
  2792. EQ WRD2 PUT BI INTO FILE
  2793.  
  2794. WRD1 FETCH X0,MRL,X7 MAXIMUM RECORD LENGTH
  2795. SA1 TADR+TPWR FWA OF TASK RECORD LENGTH
  2796. SA2 X1 RECORD LENGTH
  2797. IX4 X7-X2
  2798. SX6 TERP ILLEGAL RECORD LENGTH
  2799. NG X2,WRDX IF RECORD LENGTH IS NEGATIVE
  2800. ZR X2,WRDX IF RECORD LENGTH IS ZERO
  2801. NG X4,WRDX IF RECORD TOO LARGE
  2802. RJ CTW CONVERT CHARACTERS TO WORDS
  2803. SA2 TADR+TPWS TASK WORKING STORAGE
  2804. SA3 VAMB FWA OF RECORD BUFFER
  2805. SX3 X3
  2806. TJ MVE= MOVE TASK RECORD TO BUFFER
  2807. RJ LBI LOG BEFORE IMAGE RECORD
  2808. NZ X6,WRDX IF *CRM* ERROR
  2809. SA1 TADR+TPWR FWA OF TASK RECORD LENGTH
  2810. SA2 X1+ RECORD LENGTH
  2811. SA5 VAMB FWA OF RECORD BUFFER
  2812. WRD2 SX0 B4+TFFTW FWA OF *FIT*
  2813. SX3 B4+TFKYW FWA OF KEY AREA
  2814. SA4 RCOD REQUEST CODE
  2815. SX4 X4-TRRW
  2816. SX5 X5+
  2817. ZR X4,WRD5 IF REWRITE REQUEST
  2818. PUT X0,X5,X2,,X3 WRITE RECORD
  2819. WRD3 RJ CCS CHECK *CRM* STATUS
  2820. RJ LBK LOG BEFORE IMAGE RECORD KEYS IF NO ERROR
  2821. NZ X6,WRDX IF *CRM* ERRORS
  2822. WRD4 RJ LAI LOG AFTER IMAGE RECORD
  2823. EQ WRDX RETURN TO CALLER
  2824.  
  2825. WRD5 REPLACE X0,X5,X2,,X3 REWRITE RECORD
  2826. EQ WRD3 CHECK *CRM* STATUS
  2827. TITLE SUPPORTING ROUTINES.
  2828. ABS SPACE 4,15
  2829. *CALL COMCCDD CONVERT TO DISPLAY CODE
  2830. *CALL COMCCOD
  2831. *CALL COMCSNM
  2832. SPACE 4,10
  2833. ** ABS - ABSOLUTIZE TASK ADDRESSES.
  2834. *
  2835. * ENTRY (REQT) = TASK REQUEST.
  2836. *
  2837. * EXIT (TADR) = ABSOLUTE ADDRESSES OF REQUEST PARAMETERS.
  2838. *
  2839. * USES X - 0, 1, 3, 4, 6, 7.
  2840. * A - 3, 4, 6, 7.
  2841. * B - 6, 7.
  2842. *
  2843. * CALLS GRA.
  2844.  
  2845.  
  2846. ABS SUBR ENTRY/EXIT
  2847. SA3 REQT REQUEST
  2848. MX0 -TFSCN
  2849. LX3 TFSCN-1-TFSCS RIGHT JUSTIFY SUB-CONTROL POINT
  2850. BX1 -X0*X3 SUB-CONTROL POINT
  2851. TJ GRA GET RA
  2852. LX3 TFSCS-TFSCN+1 RESTORE REQUEST FIELDS
  2853. SB6 B0 COUNTER FOR PROCESSING ADDRESSES
  2854. SA6 TADR+TPRA RA
  2855. SB7 TPRML LENGTH OF REQUEST TABLE
  2856. IX3 X3+X6
  2857. SA4 X3 REQUEST PARAMETERS
  2858. SA7 TADR+TPFL FL
  2859. ABS1 SX4 X4
  2860. ZR X4,ABS2 IF END OF PARAMETERS
  2861. IX7 X4+X6 COMPUTE ABSOLUTE PARAMETER ADDRESS
  2862. SA4 A4+1 NEXT REQUEST ADDRESS
  2863. EQ B6,B7,ABSX IF END OF REQUEST TABLE
  2864. SA7 TADR+B6
  2865. SB6 B6+B1
  2866. EQ ABS1
  2867.  
  2868. ABS2 MX7 -18
  2869. EQ B6,B7,ABSX IF END OF REQUEST TABLE
  2870. SA7 A7+B1 FILL IN WITH NO PARAMETER FLAG
  2871. SB6 B6+B1
  2872. EQ ABS2 LOOP
  2873. SPACE 4,15
  2874. ** AFA - ADJUST FET ADDRESSES.
  2875. *
  2876. * ADJUST BUFFER ADDRESSES IN FET TO BE RELATIVE
  2877. * TO THE FWA OF THE FET, I.E., FWA OF FET = 0,
  2878. * FWA OF THE BUFFER = FET+FET LENGTH.
  2879. *
  2880. * ENTRY (A1) = FWA OF THE FET.
  2881. * AAMQFL = FET LENGTH.
  2882. *
  2883. * EXIT FET ADJUSTED.
  2884. *
  2885. * USES X - 1, 2, 3, 6, 7.
  2886. * A - 1, 7.
  2887. * B - 6.
  2888.  
  2889.  
  2890. AFA SUBR
  2891. MX2 42
  2892. SB6 3
  2893. SA1 A1+B1
  2894. BX3 -X2*X1 ISOLATE FIRST
  2895. SA1 A1-B1
  2896. SX3 X3-AAMQFL
  2897. AFA1 SA1 A1+B1 ADJUST FIRST, IN, OUT, LIMIT
  2898. BX7 X2*X1
  2899. BX6 -X2*X1
  2900. SB6 B6-B1
  2901. IX6 X6-X3
  2902. BX7 X7+X6
  2903. SA7 A1+
  2904. GE B6,AFA1 IF NOT ALL FOUR WORDS PROCESSED
  2905. EQ AFAX RETURN
  2906.  
  2907. SPACE 4,10
  2908. ** AQS - ALLOCATE BEFORE IMAGE RECOVERY FILE SEGMENT.
  2909. *
  2910. * ENTRY (B2) = FWA OF CURRENT *TSEQ*.
  2911. * (B5) = FWA OF *TBRF* ASSIGNED TO CURRENT *TSEQ*.
  2912. *
  2913. * EXIT (*TSQR*) = FIRST RANDOM INDEX OF ASSIGNED *BRF*
  2914. * SEGMENT.
  2915. * (*TSQW*) = ASSIGNED BIT MAP WORD NUMBER.
  2916. * (*TSQB*) = ASSIGNED BIT MAP WORD BIT NUMBER.
  2917. *
  2918. * USES X - 1, 2, 3, 6, 7.
  2919. * A - 1, 2, 6, 7.
  2920. * B - 3, 7.
  2921. *
  2922. * MACROS GETFLD, PUTFLD.
  2923.  
  2924.  
  2925. AQS SUBR ENTRY/EXIT
  2926. SX1 TQBMW SET BIT MAP WORD NUMBER + *TQBMW*
  2927. SB3 B0+ INITIAL SHIFT COUNT
  2928. SB7 59 INITIAL BIT NUMBER
  2929. AQS1 SA2 X1+B5 GET *BRF* ALLOC. BIT MAP WORD FROM *TBRF*
  2930. LX3 B3,X2
  2931. PL X3,AQS2 IF UNASSIGNED SEGMENT
  2932. SB3 B3+B1 INCREMENT SHIFT COUNT
  2933. SB7 B7-B1 UPDATE BIT MAP WORD BIT NUMBER
  2934. GE B7,AQS1 IF NOT END OF BIT MAP WORD
  2935. SB3 B0 RESET SHIFT COUNT
  2936. SB7 59 RESET BIT MAP WORD BIT NUMBER
  2937. SX1 X1+B1 INCREMENT TO NEXT BIT MAP WORD
  2938. EQ AQS1 SCAN NEXT BIT MAP WORD
  2939.  
  2940. AQS2 SX1 X1-TQBMW UN-BIAS BIT MAP WORD NUMBER
  2941. SX3 60 CALCULATE SEGMENT NUMBER
  2942. IX3 X3*X1 SEG.NO. = (60 * WORD NO.) + SHIFT COUNT
  2943. SX3 X3+B3 SEGMENT NUMBER ZERO THRU *CMDM* - 1
  2944. SX6 B1
  2945. LX6 B7,X6
  2946. BX6 X2+X6 SET BIT FOR ASSIGNED SEGMENT
  2947. SA6 A2 STORE UPDATED BIT MAP WORD IN *TBRF*
  2948. GETFLD 2,B5,TQNP GET NUMBER OF PRU*S PER SEGMENT
  2949. IX2 X3*X2
  2950. SX6 2 ADD 1 PRU FOR *BRF* HEADER + 1 FOR BIAS
  2951. IX6 X2+X6 RANDOM INDEX FOR FIRST PRU OF SEGMENT
  2952. LX1 TSQBN POSITION BIT MAP WORD NUMBER
  2953. SX2 B7+ BIT NUMBER
  2954. BX2 X1+X2 MERGE BIT MAP WORD AND BIT NUMBER
  2955. PUTFLD 2,B2,TSMP STORE BIT MAP POSITION POINTERS IN *TSEQ*
  2956. PUTFLD 6,B2,TSQR RANDOM INDEX FOR FIRST PRU OF SEGMENT
  2957. EQ AQSX RETURN
  2958.  
  2959. SPACE 4,10
  2960. ** ARR - ASSIGN FET *RR* FIELD FOR FIRST PRU OF *BRF* SEGMENT.
  2961. *
  2962. * THE RELATIVE RANDOM SECTOR ADDRESS FOR THE FIRST PRU
  2963. * OF THE ASSIGNED *BRF* SEGMENT IS MADE BASED ON THE
  2964. * *BRF* BIT MAP WORD AND BIT ASSIGNMENT AS CONTAINED
  2965. * IN *TSEQ* ENTRY FIELDS *TSQW* AND *TSQB*.
  2966. *
  2967. * ENTRY (B2) = FWA OF *TSEQ* ENTRY.
  2968. * (B5) = FWA OF ASSIGNED *TBRF* ENTRY.
  2969. * (*TSQW*) = ASSIGNED *BRF* BIT MAP WORD ASSIGNMENT.
  2970. * (*TSQB*) = ASSIGNED *BRF* BIT MAP BIT NUMBER
  2971. * ASSIGNMENT.
  2972. *
  2973. * EXIT (*TSQR*) = RELATIVE SECTOR OF FIRST PRU OF SEGMENT.
  2974. *
  2975. * USES X - 1, 2, 6, 7.
  2976. * A - 1, 2, 7.
  2977. * B - NONE.
  2978. *
  2979. * MACROS GETFLD, PUTFLD.
  2980.  
  2981.  
  2982. ARR SUBR ENTRY/EXIT
  2983. GETFLD 1,B2,TSQW ASSIGNED *BRF* BIT MAP WORD (0-1)
  2984. GETFLD 2,B2,TSQB ASSIGNED *BRF* BIT MAP BIT (59-0)
  2985. SX6 59D
  2986. IX2 X6-X2 CHANGE BIT 59 TO ZERO, BIT 0 TO 59
  2987. SX6 X6+B1 (X6=60D)
  2988. IX1 X1*X6
  2989. IX1 X1+X2 FORM SEGMENT NUMBER
  2990. GETFLD 2,B5,TQNP NUMBER OF PRU*S PER SEGMENT
  2991. IX2 X1*X2
  2992. SX6 B1+B1 ADD ONE PRU FOR BRF HEADER + ONE FOR BIAS
  2993. IX2 X6+X2 FORM RELATIVE RANDOM SECTOR ADDRESS
  2994. PUTFLD 2,B2,TSQR STORE RANDOM ADDRESS OF SEGMENT 1ST PRU
  2995. EQ ARRX RETURN
  2996.  
  2997. EJECT
  2998. ** ASF - ASSIGN *TBRF* AND *TARF* TO CURRENT TRANSACTION.
  2999. *
  3000. * ENTRY (B2) = FWA OF *TSEQ*.
  3001. * (B6) = FWA OF CURRENT *TDRF*.
  3002. *
  3003. * EXIT (B5) = FWA OF ASSIGNED *TBRF*.
  3004. * (X6) = *TERAK*, IF *BRF* IS DOWN.
  3005. * (*TSQF*) = FWA OF ASSIGNED *TBRF*.
  3006. * (*TSLF*) = FWA OF ASSIGNED *TARF*.
  3007. *
  3008. * USES X - 1, 2, 6, 7.
  3009. * A - 1, 2, 7.
  3010. * B - 5, 7.
  3011. *
  3012. * MACROS GETFLD, IXN, PUTFLD.
  3013. *
  3014. * CALLS AQS.
  3015.  
  3016.  
  3017. ASF SUBR ENTRY/EXIT
  3018. GETFLD 2,B6,TDAL GET FWA OF *TARF*
  3019. PUTFLD 2,B2,TSLF STORE FWA OF *TARF* IN *TSEQ*
  3020. GETFLD 1,B6,TDQN GET NUMBER OF *BRF-S* FROM *TDRF*
  3021. GETFLD 2,B2,TSSQ TRANSACTION SEQUENCE NUMBER
  3022. BX7 X1
  3023. BX6 X2
  3024. IX2 X2/X7 TRANSACTION SEQ. NO. / *BRF-S*
  3025. IX1 X2*X1 QUOTIENT * NUMBER OF *BRF-S*
  3026. IX1 X6-X1 GET REMAINDER
  3027. SX2 TQRFE LENGTH OF *TBRF* ENTRY
  3028. IX1 X1*X2 REMAINDER * ENTRY LENGTH
  3029. GETFLD 2,B6,TDQL GET FWA OF FIRST *TBRF*
  3030. IX2 X1+X2 FORM FWA OF ASSIGN *TBRF*
  3031. SA1 X2+TQSTW *BRF* STATUS
  3032. SX6 TERAK *BRF* DOWN ERROR CODE
  3033. NG X1,ASFX IF *BRF* IS DOWN
  3034. PUTFLD 2,B2,TSQF STORE FWA OF ASSIGNED *TBRF*
  3035. SB5 X2 FWA OF ASSIGNED *TBRF*
  3036. RJ AQS ASSIGN *BRF* SEGMENT
  3037. GETFLD 2,B6,TDCT INCREASE COUNT OF ACTIVE TRANSACTIONS
  3038. SX2 X2+B1
  3039. PUTFLD 2,B6,TDCT
  3040. SX6 B0+ NO ERROR
  3041. EQ ASFX RETURN
  3042.  
  3043. CAR SPACE 4,15
  3044. ** CAR - CHECK ACTIVE REQUESTS.
  3045. *
  3046. * ENTRY (VAMB) = FWA OF LOGICAL NAME ENTRY.
  3047. *
  3048. * EXIT (X6) = 0, IF OUTPUT QUEUE IS NOT FULL.
  3049. *
  3050. * USES X - ALL.
  3051. * A - 1, 2, 3, 4, 6, 7.
  3052. * B - 2, 3, 4, 6.
  3053. *
  3054. * CALLS ABS, CCS, CFS, CRQ, FDB, FTS.
  3055. *
  3056. * MACROS FETCH, GETFLD, SEEK.
  3057.  
  3058.  
  3059. CAR SUBR ENTRY/EXIT
  3060. SA1 VAMB FWA OF LOGICAL NAME TABLE
  3061. AX1 24
  3062. CAR1 SX6 X1+
  3063. SA6 REQT INDICATE REQUEST COMPLETE
  3064. SB3 X1+
  3065. SA6 RLNT
  3066. ZR X6,CAR9 IF END OF LOGICAL NAME TABLE
  3067. SA3 X1+TLNOW LINK FOR OPEN FILE CONTROL ENTRIES
  3068. CAR2 SX3 X3+
  3069. ZR X3,CAR5 IF END OF FILE CONTROL ENTRIES
  3070. SX7 X3-TFNFW FWA OF FILE CONTROL ENTRY
  3071. SA2 X7+TFRQW REQUEST
  3072. SX5 X2 REQUEST ADDRESS
  3073. BX6 X2
  3074. SA7 RFCB
  3075. ZR X5,CAR4 IF NO OUTSTANDING REQUEST
  3076. SA6 REQT
  3077. RJ FTS FIND TRANSACTION SEQUENCE ENTRY
  3078. SX6 B2 FWA OF *TSEQ* ENTRY
  3079. SA6 RSEQ
  3080. MX5 -TFFCN MASK FOR REQUEST CODE
  3081. LX2 TFFCN-1-TFFCS
  3082.  
  3083. * IF *FIT* IS BUSY, DO SEEK LATER.
  3084.  
  3085. SX0 X7+TFFTW FWA OF *FIT*
  3086. SB4 X7
  3087. BX7 -X5*X2 GET REQUEST CODE
  3088. SA7 RCOD
  3089. SA1 X0
  3090. SX6 TERAG FILE IDLING DOWN
  3091. RJ FDB FIND DATA BASE *TDRF* ENTRY
  3092. SA7 RDRF FWA OF DATA BASE *TDRF* ENTRY (IF FOUND)
  3093. SX5 TERAK DATA BASE OR FILE DOWN ERROR CODE
  3094. ZR X7,CAR6 IF *TDRF* ENTRY NOT FOUND
  3095. SA1 B3+TLICW CHECK FOR INCONSISTENT FILE
  3096. NG X1,CAR8 IF FILE IS INCONSISTENT
  3097. ERRNZ TLICS-59 PREVIOUS INSTRUCTION DEPENDS ON TLICS = 59
  3098. FETCH X0,BZF,X7
  3099. SA3 X7
  3100. LX3 59-0
  3101. PL X3,CAR5 IF *FIT* IS BUSY
  3102.  
  3103. * CHECK IF DATA TRANSFERRED.
  3104.  
  3105. FETCH X0,FP,X1
  3106. SX5 X1-20B
  3107. ZR X5,CAR6 IF DATA TRANSFERRED
  3108.  
  3109. * CONTINUE SEEKING RECORD IF SEEK COUNT NOT EXHAUSTED.
  3110.  
  3111. SA4 B4+TFSKW SEEK COUNT
  3112. MX3 -TFSKW
  3113. LX4 TFSKN-1-TFSKS RIGHT JUSTIFY SEEK COUNT
  3114. SX6 B1
  3115. BX5 -X3*X4
  3116. ZR X5,CAR6 IF SEEK COUNT EXHAUSTED
  3117. IX7 X4-X6 UPDATE SEEK COUNT
  3118. LX7 TFSKS-TFSKN+1
  3119. SX2 B4+TFKYW KEY ADDRESS
  3120. SA7 A4+
  3121. RJ CFS CHECK FATAL STATUS
  3122. NZ X6,CAR3 IF FATAL STATUS
  3123. SEEK X0,,X2
  3124. CAR3 RJ CCS CHECK *CRM* STATUS
  3125. NZ X6,CAR8 IF *CRM* ERROR
  3126. FETCH X0,FP,X1
  3127. SX5 X1-#EOR#
  3128. ZR X5,CAR6 IF END OF RECORD STATUS
  3129. CAR4 SA2 RFCB CURRENT FILE CONTROL FWA
  3130. SA3 X2+TFNFW LINK TO NEXT FILE CONTROL ENTRY
  3131. EQ CAR2 CHECK NEXT FILE CONTROL ENTRY
  3132.  
  3133. CAR5 SA2 RLNT CURRENT LOGICAL NAME ENTRY FWA
  3134. SA1 X2+ LINK TO NEXT LOGICAL NAME ENTRY
  3135. EQ CAR1 CHECK NEXT LOGICAL NAME ENTRY
  3136.  
  3137. * COMPLETE REQUEST BY USING ROUTINE FROM *TCRM* TABLE.
  3138.  
  3139. CAR6 GETFLD 1,B2,TSFC ORIGINAL *TAF CRM* REQUEST CODE
  3140. SX6 X5
  3141. SA6 CARA SAVE ERROR CODE IF ANY
  3142. SX1 X1-DMCC
  3143. ZR X1,CAR6.1 IF ORIGINAL REQUEST IS CEASE
  3144. RJ ABS ABSOLUTIZE TASK ADDRESSES
  3145. CAR6.1 SA2 RSEQ FWA OF TRANSACTION SEQUENCE ENTRY
  3146. SX0 B4+TFFTW FWA OF *FIT*
  3147. SA1 RCOD REQUEST CODE
  3148. SA3 RLNT FWA OF LOGICAL NAME ENTRY
  3149. SA4 X1+TCRM PROCESSING ROUTINE
  3150. SB2 X2 FWA OF TRANSACTION SEQUENCE ENTRY
  3151. SB3 X3
  3152. SB6 X4+
  3153. SA1 CARA ERROR CODE IF NON-ZERO
  3154. SX6 X1+
  3155. NZ X6,CAR8 IF DATA BASE OR FILE DOWN ERROR
  3156. JP B6 PROCESSING ROUTINE FOR REQUEST
  3157.  
  3158. * ALL REQUEST COMPLETE ROUTINES RETURN TO THE CODE BELOW.
  3159.  
  3160. CAR7 NZ X6,CARX IF OUTPUT QUEUE IS FULL
  3161. SA6 REQT INDICATE OUTPUT QUEUE IS NOT FULL
  3162. SA6 RERR CLEAR SAVE ERROR
  3163. SA4 RFCB FWA OF CURRENT *TFCB* ENTRY
  3164. ZR X4,CAR9 IF NO *TFCB* GET NEXT CONTINUATION
  3165. SA3 X4+TFLNW LINK TO *TLNT*
  3166. LX3 TFLNN-1-TFLNS RIGHT JUSTIFY
  3167. SB3 X3 FWA OF *TLNT* ENTRY
  3168. EQ CAR4 GET NEXT REQUEST
  3169.  
  3170. CAR8 SA1 B4+TFRQW REQUEST
  3171. LX1 59-TFBFS
  3172. SX5 B0
  3173. NG X1,CAR6 IF FREEING
  3174. RJ CRQ COMPLETE REQUEST
  3175. NZ X6,CARX IF OUTPUT QUEUE IS FULL
  3176. EQ CAR4 CHECK NEXT FILE CONTROL ENTRY
  3177.  
  3178. * AFTER ALL ACTIVE REQUESTS HAVE BEEN CHECKED
  3179. * CONTINUATION ADDRESSES FOR RECOVERY PROCESSING
  3180. * (*TSCP* IN *TSEQ*) ARE CHECKED.
  3181.  
  3182. CAR9 SX2 TSEQE LENGTH OF *TSEQ* ENTRY
  3183. SA1 CARB ORDINAL FOR NEXT *TSEQ* ENTRY
  3184. IX2 X1*X2 (TSEQ INDEX)
  3185. SX7 X1+B1 INCREMENT ORDINAL FOR NEXT
  3186. SA3 TSEQLWA LWA+1 OF *TSEQ* TABLE
  3187. SX2 X2+TSEQ FWA OF *TSEQ* ENTRY
  3188. SB2 X2
  3189. IX6 X3-X2
  3190. ZR X6,CAR11 IF END OF TRANSACTION SEQUENCE TABLE
  3191. SA7 A1 STORE ORDINAL FOR NEXT ENTRY
  3192. SA2 B2 TRANSACTION NUMBER FROM *TSEQ* ENTRY
  3193. ZR X2,CAR9 IF ENTRY NOT ACTIVE
  3194. GETFLD 1,B2,TSCP PROCESS CONTINUATION ADDRESS
  3195. SX7 B2 FWA OF *TSEQ* ENTRY
  3196. ZR X1,CAR9 IF NO CONTINUATION ADDRESS
  3197. SA7 RSEQ STORE FWA OF *TSEQ* ENTRY
  3198. SA1 B2+TSRQW *TAF CRM* REQUEST
  3199. BX6 X1
  3200. MX7 -TSFCN
  3201. SA6 REQT STORE REQUEST
  3202. LX6 TSFCN-1-TSFCS RIGHT JUSTIFY REQUEST CODE
  3203. BX7 -X7*X6 REQUEST CODE
  3204. SA7 RCOD STORE REQUEST CODE
  3205. SA1 B2+TSQFW FWA OF ASSIGNED *TBRF*
  3206. LX1 TSQFN-1-TSQFS
  3207. SB3 B0 NO *TLNT*
  3208. SA1 X1+TQDLW FWA OF DATA BASE *TDRF*
  3209. LX1 TQDLN-1-TQDLS
  3210. SX6 X1
  3211. SA6 RDRF SET FWA OF CURRENT DATA BASE *TDRF*
  3212. SB4 B0 NO *TFCB*
  3213. SX6 B4
  3214. SA6 RFCB NO *TFCB*
  3215. SX1 X7-DMCC
  3216. ZR X1,CAR10 IF ORIGINAL REQUEST IS DATA MANAGER CEASE
  3217. RJ ABS ABSOLUTIZE TASK ADDRESSES
  3218. CAR10 GETFLD 4,B2,TSCP CONTINUATION ADDRESS FOR RECOVERY PROC.
  3219. SB6 X4 CONTINUATION ADDRESS
  3220. JP B6 CONTINUE RECOVERY PROCESSING
  3221.  
  3222. CAR11 SA6 CARB RESET *TSEQ* TABLE ORDINAL
  3223. EQ CARX RETURN
  3224.  
  3225. CARA BSS 1 SAVE ERROR CODE
  3226. CARB CON 0 *TSEQ* TABLE ORDINAL FOR NEXT ENTRY
  3227. SPACE 4,10
  3228. ** CAT - CHECK ABNORMAL TERMINATION FIELD OF FET.
  3229. *
  3230. * ENTRY (X2) = FWA OF FET.
  3231. *
  3232. * EXIT (X1) = ZERO IF NO ABNORMAL TERMINATION.
  3233. * = ABNORMAL TERMINATION CODE, RIGHT JUSTIFIED.
  3234. * (CODE AS CONTAINED IN FET+0 BITS 10 -13).
  3235. *
  3236. * USES X - 1, 3, 6, 7.
  3237. * A - 1, 6.
  3238. * B - NONE.
  3239.  
  3240.  
  3241. CAT SUBR ENTRY/EXIT
  3242. MX7 -4 MASK FOR *AT* FIELD OF FET+0
  3243. MX6 42 FILE NAME MASK
  3244. SX3 B1 COMPLETION BIT
  3245. SA1 X2 FET WORD 0
  3246. BX6 X6*X1 GET FILE NAME
  3247. BX6 X6+X3 SET COMPLETION BIT
  3248. AX1 10 RIGHT JUSTIFY *AT* FIELD
  3249. SA6 A1 RESTORE FET WORD 0
  3250. BX1 -X7*X1
  3251. SX6 B0
  3252. EQ CATX RETURN
  3253.  
  3254. CCS SPACE 4,20
  3255. ** CCS - CHECK *CRM* STATUS.
  3256. *
  3257. * ENTRY (RFCB) = FWA OF FILE CONTROL ENTRY.
  3258. * (RLNT) = FWA OF LOGICAL NAME ENTRY.
  3259. * (RSEQ) = FWA OF TRANSACTION SEQUENCE ENTRY.
  3260. * (RDRF) = FWA OF DATA BASE *TDRF* ENTRY.
  3261. *
  3262. * EXIT (X6) = 0, IF NO ERRORS.
  3263. * *TERI*, IF *CRM* ERRORS.
  3264. * (B1) = 1.
  3265. * (B2) = FWA OF TRANSACTION SEQUENCE ENTRY.
  3266. * (B3) = FWA OF LOGICAL NAME ENTRY.
  3267. * (B4) = FWA OF FILE CONTROL ENTRY.
  3268. * (RNFE) = NON-FATAL *CRM* ERROR CODE.
  3269. * = ZERO, IF FATAL ERROR OR NO ERROR.
  3270. *
  3271. * USES X - 0, 1, 2, 3, 4, 6, 7.
  3272. * A - 1, 2, 3, 4, 6, 7.
  3273. * B - 1, 2, 3, 4.
  3274. *
  3275. * CALLS ABS, CFS.
  3276. *
  3277. * MACROS FETCH, STORE.
  3278.  
  3279.  
  3280. CCS SUBR ENTRY/EXIT
  3281. SB1 1
  3282. SA2 RSEQ FWA OF *TSEQ* ENTRY
  3283. SA1 X2+TSRQW ORIGINAL *TAF CRM* REQUEST
  3284. MX7 -TSFCN
  3285. LX1 TSFCN-1-TSFCS RIGHT JUSTIFY REQUEST CODE
  3286. BX1 -X7*X1
  3287. SX1 X1-DMCC
  3288. ZR X1,CCS1 IF DATA MANAGER CEASE
  3289. RJ ABS COMPUTE ABSOLUTE TASK ADDRESSES
  3290. CCS1 SA4 RFCB FWA OF FILE CONTROL ENTRY
  3291. SA3 RLNT FWA OF LOGICAL NAME ENTRY
  3292. SB4 X4
  3293. SB3 X3
  3294. SA2 RSEQ FWA OF TRANSACTION SEQUENCE ENTRY
  3295. SB2 X2
  3296. SX0 X4+TFFTW FWA OF *FIT*
  3297. FETCH X0,ES,X7 GET ERROR STATUS
  3298. SX6 B0 NO ERRORS
  3299. SA1 B4+TFBFW
  3300. LX1 59-TFBFS DBFREE FLAG
  3301. SA6 RNFE CLEAR ERROR CODE FOR FREE PROCESS
  3302. NG X1,CCS2 IF FREE PROCESSING, NO RETURN ADDRESS
  3303. SA1 TADR+TPCS FWA OF TASK *CRM* STATUS
  3304. SA7 X1+ RETURN STATUS TO TASK
  3305. CCS2 ZR X7,CCSX IF NO *CRM* ERROR - RETURN
  3306. SX6 X7+ SAVE ERROR CODE
  3307. FETCH X0,FNF,X4 GET FATAL ERROR STATUS
  3308. NG X4,CCS3 IF FATAL ERROR
  3309. SA6 RNFE STORE NON-FATAL ERROR CODE
  3310. STORE X0,ES=0 CLEAR ERROR STATUS
  3311. SX6 TERI *CRM* ERROR STATUS ERROR CODE
  3312. EQ CCSX RETURN
  3313.  
  3314. CCS3 RJ CFS CHECK FATAL ERROR, IDLE FILE
  3315. SX6 TERI *CRM* ERROR STATUS ERROR CODE
  3316. EQ CCSX RETURN
  3317. CEX SPACE 4,10
  3318. ** CEX - *CRM* ERROR EXIT.
  3319. *
  3320. * NOTE THIS ROUTINE PREVENTS FATAL ERROR MESSAGES
  3321. * FROM GOING TO THE DAYFILE. ROUTINE *CCS* RETURNS
  3322. * THESE STATUSES TO THE TASK.
  3323.  
  3324.  
  3325. CEX SUBR ENTRY/EXIT
  3326. EQ CEXX RETURN
  3327. CFS SPACE 4,10
  3328. ** CFS - CHECK FATAL STATUS.
  3329. *
  3330. * ENTRY (X0) = FWA OF *FIT*.
  3331. * (RDRF) = FWA OF DATA BASE *TDRF* ENTRY.
  3332. * (RLNT) = FWA OF FILE *TLNT* ENTRY.
  3333. *
  3334. * EXIT (X6) = 0, IF NO FATAL ERRORS.
  3335. * = *TERI*, IF FATAL ERROR ON FILE.
  3336. *
  3337. * USES X - 1, 5, 6, 7.
  3338. * A - 1, 5, 7.
  3339. *
  3340. * CALLS IDF.
  3341. *
  3342. * MACROS FETCH.
  3343.  
  3344.  
  3345. CFS SUBR ENTRY/EXIT
  3346. FETCH X0,FNF,X5 GET FATAL ERROR STATUS
  3347. SX6 B0+ NO ERRORS
  3348. PL X5,CFSX IF NO FATAL STATUS - RETURN
  3349. RJ IDF SET FILE IDLE FLAG
  3350. SA1 RLNT FWA OF *TLNT* ENTRY
  3351. SA1 X1+TLFEW
  3352. MX7 -TLFEN
  3353. LX7 TLFES-TLFEN+1
  3354. BX1 -X7+X1 SET FILE DOWN FOR FATAL *CRM* ERROR
  3355. LX7 TLRFS-TLFES
  3356. BX7 -X7*X1 GET RECOVERABLE FILE FLAG
  3357. LX7 TLBRS-TLRFS POSITION RECOVERABLE FILE FLAG
  3358. BX7 X7+X1 SET DOWN FOR BATCH RECOVERY IF RECOVERABLE
  3359. SA7 A1 STORE FLAGS
  3360. SX6 TERI *CRM* FATAL ERROR ON FILE
  3361. EQ CFSX RETURN
  3362. SPACE 4,20
  3363. ** CDT - CONVERT DATE OR TIME.
  3364. *
  3365. * CDT CONVERTS AN 18 BIT PACKED DATE OR TIME INTO
  3366. * A 6 CHARACTER DISPLAY VALUE.
  3367. * THE SUBROUTINE HAS BEEN ADOPTED FROM COMCEDT.
  3368. *
  3369. * ENTRY (X1) = PACKED NUMBER(LOWER 18 BITS).
  3370. *
  3371. * EXIT (X6) = CONVERTED NUMBER(LOWER 36 BITS,
  3372. * ZERO FILLED).
  3373. *
  3374. * USES X - 1, 2, 3, 6, 7.
  3375. * A - 1, 6, 7.
  3376. * B - NONE.
  3377. *
  3378. * CALLS CDD.
  3379.  
  3380.  
  3381. CDT SUBR ENTRY/EXIT
  3382. LX1 48
  3383. MX3 -9
  3384. BX7 X1
  3385. BX1 -X3*X1 PICK UP UPPER 6 BITS
  3386. SA7 CDTA SAVE THE SHIFTED NUMBER
  3387. SX1 X1+100D ADD 100 TO INSURE LEADING ZERO
  3388. RJ CDD CONVERT TO DISPLAY
  3389. MX2 -12
  3390. BX6 -X2*X6 ISOLATE 2 DECIMAL DIGITS
  3391. SA6 CDTB SAVE CONVERTED DIGITS
  3392. SA1 A7 GET THE BINARY NUMBER
  3393. MX2 -6
  3394. LX1 6
  3395. BX3 -X2*X1 PICK UP THE 2ND FIELD
  3396. SX1 X3+100D
  3397. RJ CDD CONVERT 2ND FIELD TO DECIMAL DISPLAY
  3398. SA1 A6 PICK UP 1ST CONVERTED FIELD
  3399. LX1 12
  3400. MX3 -12
  3401. BX6 -X3*X6 ISOLATE THE 2ND CONVERTED FIELD
  3402. BX6 X1+X6 COMBINE TWO FIELDS
  3403. LX6 12 MAKE ROOM FOR THE LAST FIELD
  3404. SA6 A6+
  3405. SA1 A7
  3406. MX2 -6
  3407. LX1 12
  3408. BX3 -X2*X1 PICK UP 3RD BINARY FIELD
  3409. SX1 X3+100D
  3410. RJ CDD
  3411. SA1 A6+ PICK PREVIOUSLY CONVERTED VALUES
  3412. MX3 -12
  3413. BX6 -X3*X6
  3414. BX6 X6+X1
  3415. LX6 24 LEFT-JUSTIFY THE DISPLAY VALUE
  3416. EQ CDTX RETURN
  3417.  
  3418. CDTA BSS 1 BINARY DATA HOLD AREA
  3419. CDTB BSS 1 DISPLAY DATA HOLD AREA
  3420. SPACE 4,10
  3421. ** CLB - CHECK AFTER IMAGE RECOVERY FILE ERROR, BUSY.
  3422. *
  3423. * ENTRY (B2) = FWA OF *TSEQ*
  3424. *
  3425. * EXIT (B5) = FWA OF *TARF* ENTRY IF NOT BUSY.
  3426. * = ZERO IF *TARF* BUSY.
  3427. * (X6) = *TERAK*, IF *ARF-S* DOWN.
  3428. * = ZERO, IF *ARF-S* UP.
  3429. *
  3430. * USES X - 1, 2, 6, 7.
  3431. * A - 1, 2, 7.
  3432. * B - 5.
  3433. *
  3434. * MACROS GETFLD.
  3435. *
  3436. * CALLS CAT, LDN.
  3437.  
  3438.  
  3439. CLB3 SB5 B0+ *TARF* IS BUSY
  3440.  
  3441. CLB SUBR ENTRY/EXIT
  3442. SA1 B2+TSLFW GET FWA OF ASSIGNED *TARF* FROM *TSEQ*
  3443. LX1 TSLFN-1-TSLFS
  3444. SB5 X1 FWA OF *TARF*
  3445. SA1 B5+TADNW *ARF* DOWN FLAG
  3446. SA2 B5+TAFCW GET *ARF* FET COMPLETION FIELD FROM *TARF*
  3447. LX1 59-TADNS
  3448. LX2 59-0
  3449. SX6 TERAK *ARF-S* DOWN ERROR CODE
  3450. NG X1,CLBX IF *ARF* DOWN
  3451. SX6 B0+
  3452. PL X2,CLB3 IF *CIO* ACTIVE ON *ARF* - *ARF* BUSY
  3453. SX2 A2+ FWA OF FET
  3454. RJ CAT CHECK/CLEAR ABNORMAL TERMINATION FIELD
  3455. ZR X1,CLB1 IF NO *CIO* ERROR ON *ARF*
  3456. RJ LDN DOWN *ARF*
  3457. SX6 TERAK *ARF* DOWN ERROR CODE
  3458. EQ CLBX RETURN
  3459.  
  3460. CLB1 SA1 B5+TAFBW
  3461. BX7 X1 *TAFB* FIELD IN SAME WORD AS *TART*
  3462. LX7 59-TAFBS
  3463. PL X7,CLB2 IF *ARF* BUFFER NOT FLUSHED
  3464. MX7 -TAFBN
  3465. LX7 TAFBS-TAFBN+1
  3466. BX7 X7*X1 CLEAR *ARF* BUFFER FLUSHED FLAG
  3467. SA7 A1
  3468. SA1 B5+TAFTW *FIRST*
  3469. SX7 X1
  3470. SX1 B1
  3471. SA7 A1+B1 SET *TARF* FET IN/OUT POINTERS FOR EMPTY
  3472. SA7 A7+B1 STORE *OUT*
  3473. GETFLD 2,B5,TARI GET CURRENT RANDOM INDEX FROM FET+6
  3474. IX6 X2-X1 *RR* FOR BEFORE *EOF* POSSITION
  3475. SA6 A2+ STORE *RR* FOR NEXT *ARF* WRITE
  3476.  
  3477. * CHECK IF *TARF* IS RESERVED BY ANOTHER TASK.
  3478.  
  3479. CLB2 GETFLD 1,B5,TASQ FWA OF *TSEQ* ENTRY IF RESERVED
  3480. SX2 B2 FWA OF CURRENT *TSEQ* ENTRY
  3481. SX6 B0+
  3482. ZR X1,CLBX IF *ARF* NOT RESERVED
  3483. IX2 X1-X2
  3484. NZ X2,CLB3 IF RESERVED BY OTHER TRANSACTION - BUSY
  3485. EQ CLBX RETURN - *ARF* NOT BUSY - NO ERROR
  3486.  
  3487. CLF SPACE 4,10
  3488. ** CLF - CLOSE *FIT*.
  3489. *
  3490. * ENTRY (X4) = LINK TO NEXT FILE CONTROL ENTRY.
  3491. *
  3492. * EXIT ALL *FIT-S* IN LINK ARE CLOSED.
  3493. *
  3494. * USES X - 0, 4, 5, 7.
  3495. * A - 4, 5, 7.
  3496. * B - 1.
  3497. *
  3498. * CALL CLR.
  3499. *
  3500. * MACROS CLOSEM, FETCH.
  3501.  
  3502.  
  3503. CLF SUBR ENTRY/EXIT
  3504. CLF1 SX7 X4-TFNFW FWA OF FILE CONTROL ENTRY
  3505. SX4 X4+
  3506. ZR X4,CLFX IF END OF ENTRIES - RETURN
  3507. SA7 RFCB
  3508. SX0 X7+TFFTW FWA OF *FIT*
  3509. FETCH X0,OC,X5 *FIT* OPEN STATUS
  3510. SX5 X5-1
  3511. NZ X5,CLF4 IF *FIT* NOT OPEN
  3512. FETCH X0,FNF,X5 FETCH FATAL ERROR FLAG
  3513. NG X5,CLF4 IF FATAL ERROR
  3514. SA4 RCOD
  3515. SX5 X4-TRTC
  3516. NZ X5,CLF3 IF NOT A RECOVERY REQUEST
  3517. BX7 X0 SAVE *FIT* ADDRESS
  3518. SA7 CLFA
  3519.  
  3520. * NOTE - THE FOLLOWING CODE DEPENDS UPON THIS INTERFACE
  3521. * WITH CRM.
  3522. *
  3523. * 1. FWA OF FET OF DATA BASE FILE = FWA OF FIT.
  3524. * 2. (FWA OF FIT + 25B) = FWA OF FSTT OF INDEX FILE.
  3525. * 3. FWA OF FET OF INDEX FILE = FWA OF FSTT + 202B.
  3526. * 4. CRM CIO BUFFER IS NOT A CIRCULAR BUFFER.
  3527. * 5. (FIRST - 4) = FWA OF CMM BLOCK.
  3528. * (FIRST - 3) = 6/X,18/FWA OF FSTT,36/X.
  3529. * (FIRST - 2) = 24/RANDOM ADDRESS,36/X.
  3530. * (FIRST - 1) = 29/X,13/LENGTH OF BLOCK IN WORDS,18/X.
  3531.  
  3532. BX5 X0
  3533. RJ CLR CHECK FILE REQUEST
  3534.  
  3535. * CHECK INDEX FILE STATUS.
  3536.  
  3537. SA5 X5+25B FWA OF FSTT OF INDEX FILE
  3538. SX4 X5
  3539. SX5 X4+202B FWA OF INDEX FILE FET
  3540. ZR X4,CLF2 IF NO INDEX FILE
  3541. RJ CLR CHECK FILE REQUEST
  3542. CLF2 SA4 CLFA
  3543. SX0 X4
  3544. CLF3 MX7 -59 CLEAR *FNF* FLAG
  3545. SA5 X0+21B
  3546. BX7 -X7*X5
  3547. SA4 X0+FTFSTTW GET FWA OF *FSTT*
  3548. SA7 A5
  3549. BX7 X7-X7
  3550. SA7 X4+174B
  3551. SA5 X0+25B GET FWA OF MIP *FSTT*
  3552. SX5 X5
  3553. ZR X5,CLF3.1 IF NO MIP FILE
  3554. SA7 X5+174B
  3555. CLF3.1 CLOSEM X0 CLOSE *FIT*
  3556. SB1 1 RESTORE B1
  3557. CLF4 SA4 RFCB FWA OF FILE CONTROL ENTRY
  3558. SA4 X4+TFNFW LINK TO NEXT FILE CONTROL ENTRY
  3559. EQ CLF1 CHECK NEXT *FIT*
  3560.  
  3561. CLFA BSSZ 1 FWA OF *FIT*
  3562. CLR SPACE 4,20
  3563. ** CLR - CHECK FILE REQUEST.
  3564. *
  3565. * ENTRY (X5) = FWA OF FET.
  3566. *
  3567. * EXIT (X5) = FWA OF FET.
  3568. * FILE NOT BUSY.
  3569. *
  3570. * USES X - 0, 4, 5, 6, 7.
  3571. * A - 4, 5, 7.
  3572. *
  3573. * CALLS SYS=.
  3574. *
  3575. * NOTE - THIS ROUTINE DEPENDS ON THE INTERFACE WITH CRM
  3576. * DESCRIBED IN ROUTINE *CLF*. *CLR* WILL CHANGE THE
  3577. * *CIO* REQUEST BASED ON THE TABLE *CLRA* AND REISSUE
  3578. * THE REQUEST.
  3579.  
  3580.  
  3581. CLR SUBR ENTRY/EXIT
  3582. BX7 X5 SAVE FWA OF FET
  3583. SA4 X5
  3584. SA7 CLRB
  3585. LX4 59-0
  3586. NG X4,CLRX IF FILE NOT BUSY
  3587. MX0 7 GET CIO REQUEST
  3588. LX4 59-59+0-59
  3589. LX0 9
  3590. BX7 X0*X4
  3591. SA4 CLRA FWA OF REQUEST TABLE
  3592. CLR1 ZR X4,CLR3 IF END OF TABLE
  3593. BX6 X0*X4
  3594. IX6 X6-X7
  3595. ZR X6,CLR2 IF REQUEST MATCH
  3596. SA4 A4+1
  3597. EQ CLR1 CHECK NEXT REQUEST CODE
  3598.  
  3599. CLR2 AX4 18
  3600. SX6 X5
  3601. SA5 X5
  3602. BX7 -X0*X5 GET FILE NAME
  3603. BX7 X7+X4 ADD NEW REQUEST CODE
  3604. SA7 A5
  3605. SA4 A5+B1 GET FIRST
  3606. SX7 X4
  3607. SA7 A4+2 SET OUT
  3608. SA4 X7-1 GET BLOCK LENGTH
  3609. MX0 -13
  3610. LX4 -18
  3611. BX0 -X0*X4
  3612. IX7 X7+X0
  3613. SA7 A5+2 SET IN
  3614. SA4 A4-1 GET RANDOM ADDRESS
  3615. MX0 24
  3616. BX7 X0*X4
  3617. LX7 24
  3618. SA7 A5+6 SET RANDOM ADDRESS
  3619. SA4 CLRC CIO REQUEST
  3620. BX6 X4+X6
  3621. RJ SYS= ISSUE CIO REQUEST
  3622. SA5 CLRB RESTORE FWA OF FET
  3623. EQ CLRX RETURN
  3624.  
  3625. * CHANGE FET TO NOT-BUSY.
  3626.  
  3627. CLR3 SX7 B1
  3628. SA4 X5
  3629. BX7 X4+X7
  3630. SA7 A4
  3631. EQ CLRX RETURN
  3632.  
  3633.  
  3634. * TABLE OF CIO REQUEST CODE.
  3635.  
  3636. CLRA VFD 24/0,18/215B,18/004B WRITE PHYSICAL RECORD
  3637. VFD 24/0,18/215B,18/014B BUFFER WRITE
  3638. VFD 24/0,18/225B,18/024B WRITE END OF RECORD
  3639. VFD 24/0,18/235B,18/034B WRITE END OF FILE
  3640. VFD 24/0,18/215B,18/214B BUFFER REWRITE
  3641. VFD 24/0,18/225B,18/224B END OF RECORD REWRITE
  3642. VFD 24/0,18/235B,18/234B END OF FILE REWRITE
  3643. VFD 60/0 END OF TABLE
  3644.  
  3645. CLRB BSSZ 1 FWA OF FET
  3646. CLRC VFD 24/4LCIOP,36/0 CIO REQUEST
  3647. CMM SPACE 4,15
  3648. ** CMM - CYBER MEMORY MANAGER FOR INTERFACE.
  3649. *
  3650. * RETURN TO *CRM* WITH FL AVAILABLE.
  3651. *
  3652. * EXIT (X1) = FL AVAILABLE.
  3653. *
  3654. * USES X - 1.
  3655. * A - 1.
  3656.  
  3657.  
  3658. CMM SUBR ENTRY/EXIT
  3659. SA1 CMMD
  3660. EQ CMMX RETURN WITH FL AVAILABLE
  3661.  
  3662. CMMB BSS 1 FWA OF *CMM*
  3663. CMMC BSS 1 CURRENT FL FOR *CMM*
  3664. CMMD BSS 1 MAXIMUM FL FOR *CMM*
  3665. CMML BSSZ 1 *CMM* SPACE FOR *FSTT-S*
  3666. CMMM BSSZ 1 ADDITIONAL *FIT* SPACE
  3667.  
  3668. SPACE 4,10
  3669. ** CQB - CHECK FOR BEFORE IMAGE RECOVERY FILE BUSY AND ERROR.
  3670. *
  3671. * ENTRY (B2) = FWA OF *TSEQ*.
  3672. *
  3673. * EXIT TO CALLER
  3674. * (B5) = FWA OF *TBRF* IF NOT BUSY.
  3675. * = ZERO IF *TBRF* BUSY.
  3676. * (X6) = *TERAK*, IF DATA BASE DOWN / *BRF* DOWN.
  3677. *
  3678. * USES X - 1, 2, 6, 7.
  3679. * A - 1, 2, 7.
  3680. * B - 5.
  3681. *
  3682. * MACROS GETFLD.
  3683. *
  3684. * CALLS CAT, QDN.
  3685.  
  3686.  
  3687. CQB2 SB5 B0+ *TBRF* IS BUSY
  3688.  
  3689. CQB SUBR ENTRY/EXIT
  3690. GETFLD 1,B2,TSQF GET FWA OF ASSIGNED *TBRF* FROM *TSEQ*
  3691. SB5 X1 FWA OF *TBRF*
  3692. SA1 B5+TQSTW GET *BRF* STATUS FROM *TBRF*
  3693. SA2 B5+TQFCW GET *BRF* FET COMPLETION FIELD FROM *TBRF*
  3694. SX6 TERAK *BRF* DOWN ERROR CODE
  3695. LX1 59-TQSTS
  3696. NG X1,CQBX IF *BRF* IS DOWN
  3697. LX2 59-0
  3698. SX6 B0
  3699. PL X2,CQB2 IF *CIO* ACTIVE ON *BRF* - *BRF* BUSY
  3700. SX2 A2 FWA OF FET
  3701. RJ CAT CHECK/CLEAR ABNORMAL TERMINATION FIELD
  3702. ZR X1,CQB1 IF NO ERROR ON *BRF*
  3703. RJ QDN DOWN *BRF*
  3704. SX6 TERAK *BRF* DOWN ERROR
  3705. EQ CQBX RETURN - (X6) .EQ. *BRF* DOWN ERROR
  3706.  
  3707. CQB1 SX2 B0 CLEAR TRANSACTION WRITING BEFORE IMAGE
  3708. PUTFLD 2,B5,TQSI CLEAR FWA *TSEQ*
  3709. SA1 B5+TQBIW GET BEFORE IMAGE WRITE PENDING FLAG
  3710. GETFLD 2,B5,TQSQ FWA OF *TSEQ* ENTRY IF RESERVED
  3711. LX1 59-TQBIS
  3712. SX6 B0+
  3713. NG X1,CQB2 IF BEFORE IMAGE WRITE PENDING - *BRF* BUSY
  3714. SX1 B2 FWA OF *TSEQ* ENTRY
  3715. IX1 X1-X2
  3716. ZR X2,CQBX IF *BRF* NOT RESERVED
  3717. NZ X1,CQB2 IF *BRF* RESERVED BY OTHER TRANSACTION
  3718. EQ CQBX RETURN - *ARF* NOT BUSY, NO ERROR
  3719.  
  3720. CRQ SPACE 4,20
  3721. ** CRQ - COMPLETE REQUEST.
  3722. *
  3723. * ENTRY (X6) = TRANSACTION STATUS CODE.
  3724. * (TADR) = ABSOLUTE ADDRESSES OF REQUEST PARAMETERS.
  3725. * (REQT) = REQUEST.
  3726. * (RFCB) = FWA OF FILE CONTROL ENTRY.
  3727. * (RCOD) = REQUEST CODE.
  3728. *
  3729. * EXIT (X6) = 0, IF OUTPUT QUEUE IS NOT FULL.
  3730. * (REQT) = 0, IF OUTPUT QUEUE IS NOT FULL.
  3731. * LAST REQUEST IF QUEUE IS FULL.
  3732. * (RERR) = ERROR CODE FOR REQUEST.
  3733. *
  3734. * USES X - ALL.
  3735. * A - 1, 2, 3, 4, 6, 7.
  3736. * B - 3, 4, 5.
  3737. *
  3738. * CALLS RFI, STK.
  3739. *
  3740. * MACROS FETCH.
  3741.  
  3742.  
  3743. CRQ SUBR ENTRY/EXIT
  3744.  
  3745. * RESTORE ALL *FIT* FORCE WRITE INDICATORS
  3746. * CHANGED AT *DLX* TO ORIGINAL STATE OF OFF.
  3747.  
  3748. RJ RFI RESTORE *FIT* FWI*S
  3749.  
  3750. * CLEAR REQUEST IN FILE CONTROL ENTRY TO PREVENT
  3751. * FURTHER PROCESSING BY ROUTINE *CAR*.
  3752.  
  3753. SA6 RERR ERROR CODE
  3754. SA4 RFCB FWA OF FILE CONTROL ENTRY
  3755. MX0 60-TFPAN
  3756. SB4 X4
  3757. ZR X4,CRQ1 IF NO FILE CONTROL ENTRY
  3758. SA3 X4+TFPAW REQUEST
  3759. BX7 X0*X3 CLEAR REQUEST ADDRESS
  3760. SA7 A3
  3761. SX0 X4+TFFTW FWA OF *FIT*
  3762. SA2 X4+TFKOW GET ALTERNATE KEY ORDINAL
  3763. MX1 -TFKON
  3764. LX2 TFKON-TFKOS-1
  3765. BX2 -X1*X2
  3766. ZR X2,CRQ1 IF PRIMARY KEY
  3767. SA1 X4+TFLNW GET FWA OF LOGICAL NAME ENTRY
  3768. MX7 -TFLNN
  3769. LX1 TFLNN-TFLNS-1
  3770. BX1 -X7*X1
  3771. IX2 X2+X1
  3772. SA3 X2+TLKWW GET KEY DESCRIPTOR
  3773. RJ STK RESTORE ALTERNATE KEY IN CRM *FIT*
  3774. CRQ1 SB3 X6-TTENL
  3775. GE B3,CRQ6 IF FATAL TASK ERROR
  3776.  
  3777. * RETURN TRANSACTION STATUS TO TASK.
  3778.  
  3779. SA3 RCOD REQUEST CODE
  3780. SA1 TADR+TPSX STATUS RETURN ADDRESS FOR COMMIT/FREE
  3781. SX4 X3-TRDC
  3782. ZR X4,CRQ1.0 IF *DBCOMIT* REQUEST
  3783. SX4 X3-TRDF
  3784. ZR X4,CRQ1.0 IF *DBFREE* REQUEST
  3785. SA1 TADR+TPTS FWA OF TASK TRANSACTION STATUS
  3786. CRQ1.0 SX4 X3-TREQL
  3787. SA2 REQT CURRENT REQUEST
  3788. PL X4,CRQ2 IF *TAF* REQUEST
  3789. SA6 X1+
  3790. SX7 X3-TRWR
  3791. ZR X7,CRQ2 IF WRITE
  3792. NG X0,CRQ2 IF NO *FIT*
  3793. SA3 X3+TCRM
  3794. AX3 36
  3795. SB5 X3+ NUMBER OF PARAMETERS
  3796. AX3 18
  3797. ZR X3,CRQ2 IF NO OPTIONAL PARAMETER
  3798. BX3 -X3
  3799. SX3 X3+B5
  3800. SA1 TADR+X3 FIRST OPTIONAL PARAMETER
  3801. NG X1,CRQ2 IF NO OPTIONAL PARAMETER
  3802. FETCH X0,FP,X7 FETCH FILE POSITION
  3803. SA5 RCOD REQUEST CODE
  3804. SX6 4
  3805. SX3 X7-#EOI#
  3806. ZR X3,CRQ1.2 IF END OF INFORMATION STATUS
  3807. SX6 2
  3808. SX3 X7-#EOK#
  3809. ZR X3,CRQ1.2 IF END OF KEY STATUS
  3810. SX3 X7-#EOR#
  3811. NZ X3,CRQ1.1 IF NOT END OF RECORD STATUS
  3812. SX6 X5-TRST
  3813. NZ X6,CRQ1.1 IF NOT START
  3814. FETCH X0,REL,X5 FETCH RELATION OPERATOR
  3815. SX6 X5-#GE#
  3816. NZ X6,CRQ1.1 IF RELATION NOT *GE*
  3817. FETCH X0,KNE,X5 FETCH ON KEY INDICATOR
  3818. PL X5,CRQ1.1 IF ON KEY
  3819. SX6 1 SET NOT ON KEY STATUS
  3820. EQ CRQ1.2 RETURN
  3821.  
  3822. CRQ1.1 SX6 B0+
  3823. CRQ1.2 SA6 X1+ RETURN KEY STATUS
  3824. CRQ2 MX0 TSSQN-60
  3825. BX6 -X0*X2 CLEAR TRANSACTION SEQUENCE NUMBER
  3826. CRQ3 SA3 AMOQ+3 OUT FOR OUTPUT QUEUE
  3827. SA2 A3-B1 IN
  3828. SB5 X3
  3829. SA3 A3+B1 LIMIT
  3830. SB3 X2+B1 (IN+1)
  3831. SB4 X3+
  3832. CRQ4 NE B3,B4,CRQ5 IF NOT AT LIMIT
  3833. SA1 A2-B1
  3834. SB3 X1
  3835. CRQ5 EQ B3,B5,CRQX IF BUFFER FULL
  3836. SX7 B3
  3837. SA6 X2 STORE ENTRY IN OUTPUT QUEUE
  3838. SA7 A2 ADVANCE IN
  3839. BX6 X6-X6 INDICATE QUEUE IS NOT FULL
  3840. SA6 REQT
  3841. EQ CRQX RETURN
  3842.  
  3843. * ON FATAL ERRORS DO NOT RETURN STATUS TO TASK SINCE
  3844. * THE TASK WILL BE ABORTED. FATAL ERRORS OCCUR WHEN
  3845. * THE TASK PARAMETER ADDRESSES ARE ILLEGAL.
  3846.  
  3847. CRQ6 SA1 REQT REQUEST
  3848. MX0 TSSQN-60
  3849. BX4 -X0*X1 CLEAR TRANSACTION SEQUENCE
  3850.  
  3851. * RIGHT JUSTIFY ERROR CODE IN TRANSACTION SEQUENCE FIELD.
  3852.  
  3853. LX6 TSSQS-TSSQN+1-0
  3854. BX6 X6+X4
  3855. EQ CRQ3 PUT REQUEST IN OUTPUT QUEUE
  3856. CTW SPACE 4,10
  3857. ** CTW - CHARACTERS TO WORDS.
  3858. *
  3859. * ENTRY (X7) = LENGTH IN CHARACTERS.
  3860. *
  3861. * EXIT (X1) = LENGTH IN WORDS.
  3862. * (X6) = REMAINDER IN CHARACTERS.
  3863. *
  3864. * USES X - 1, 4, 5, 6.
  3865. * B - 7.
  3866.  
  3867.  
  3868. CTW SUBR ENTRY/EXIT
  3869. SX6 10
  3870. PX4 X7
  3871. PX5 X6
  3872. NX6 X5
  3873. FX4 X4/X6
  3874. UX6 B7,X4
  3875. LX1 B7,X6
  3876. PX6 X1 COMPUTE REMAINDER
  3877. DX4 X6*X5
  3878. UX6 X4
  3879. IX6 X7-X6 REMAINDER
  3880. ZR X6,CTWX IF REMAINDER .EQ. ZERO - RETURN
  3881. SX1 X1+1
  3882. EQ CTWX RETURN
  3883. SPACE 4,10
  3884. ** DLX - DEFERRED LOGGING EXIT ROUTINE.
  3885. *
  3886. * THIS ROUTINE IS ENTERED FROM *CRM*.
  3887. *
  3888. * ENTRY (X1) = FWA OF DEFERRED LOGGING EXIT PACKET.
  3889. *
  3890. * EXIT TO CALLER (*CRM*) IF *BRF* WRITE NOT ACTIVE.
  3891. * TO *TAF* VIA *AMIX* IF *BRF* WRITE INITIATED.
  3892. *
  3893. * USES X - 0, 1, 2, 3, 5, 6, 7.
  3894. * A - 1, 2, 3, 4, 5, 7.
  3895. * B - 1, 2, 3, 4, 5, 7.
  3896. *
  3897. * MACROS FETCH, GETFLD, PUTFLD, STORE.
  3898. *
  3899. * CALLS FDB, LBK.
  3900.  
  3901.  
  3902. DLX SUBR ENTRY/EXIT IF *BRF* WRITE INITIATED
  3903. SB1 1 RESTORE (B1)
  3904. SB7 X1+ FWA OF LOGGING EXIT PACKET
  3905. SA1 B7+DXBTW 42/, 1/DXBT, 1/DXCN, 1/DXIC, 15/
  3906. LX1 59-DXBTS CHECK BLOCK TYPE
  3907. NG X1,DLXX IF MIP BLOCK - RETURN TO *CRM*
  3908. LX1 DXBTS-DXCNS CHECK IF FIRST CALL
  3909. PL X1,DLXX IF FIRST CALL - RETURN TO *CRM*
  3910.  
  3911. * SECOND CALL PROCESS.
  3912. * FOR *FIT* GIVEN IN PARAMETER BLOCK.
  3913.  
  3914. SA2 B7+DXFTW 24/, 18/DXFT, 18/DXBA
  3915. SA5 X2+B1 FSTT ID IN SECOND WORD OF BLOCK
  3916. LX2 DXFTN-1-DXFTS RIGHT JUSTIFY
  3917. LX1 DXCNS-DXICS CHECK INCONSISTENT FLAG
  3918. SX0 X2 FWA OF *FIT*
  3919. SB4 X0-TFFTW FWA 0F *TFCB*
  3920. PL X1,DLX1 IF CONSISTENT - ONE BLOCK INVOLVED
  3921.  
  3922. * MULTIPLE BLOCKS INVOLVED - INCONSISTENT.
  3923.  
  3924. FETCH X0,FWI,X1,1 FWI FROM *FIT*
  3925. NG X1,DLX1 IF FORCED WRITE INDICATOR ALREADY SET
  3926. STORE X0,FWI=YES,1 SET FORCED WRITE INDICATOR
  3927. SA1 B4+TFFIW FWI CHANGED BY *DLX* FLAG
  3928. MX7 -TFFIN
  3929. LX7 TFFIS-TFFIN+1
  3930. BX7 -X7+X1
  3931. SA7 A1 SET FLAG TO INDICATE FWI CHANGED BY *DLX*
  3932. SX2 AMST FWA OF *AMI* STATUS WORD
  3933. GETFLD 3,X2,AMFI GLOBAL COUNT OF CHANGED *FIT* FWI*S
  3934. SX1 B1
  3935. IX3 X3+X1 INCREMENT COUNT
  3936. PUTFLD 3,X2,AMFI STORE NEW GLOBAL COUNT
  3937. SA1 B7+ FILE NAME WITH DATA BASE ID
  3938. RJ FDB FIND DATA BASE *TDRF* ENTRY
  3939. ZR X7,DLXX IF *TDRF* ENTRY NOT FOUND
  3940. SX2 X7+ FWA OF *TDRF* ENTRY FOR DATA BASE
  3941. GETFLD 1,X2,TDFI FWI CHANGED COUNTER
  3942. SX6 X1+B1 INCREMENT COUNT
  3943. PUTFLD 6,X2,TDFI
  3944.  
  3945. * CHECK IF FSTT TYPE BLOCK.
  3946.  
  3947. DLX1 SA1 DLXA FSTT BLOCK TYPE IDENTIFIER CODE
  3948. MX7 30
  3949. BX5 X7*X5 GET UPPER 30 BITS OF 2ND WORD OF BLOCK
  3950. BX1 X5-X1
  3951. ZR X1,DLXX IF FSTT BLOCK TYPE
  3952.  
  3953. * FIND *TSEQ* ENTRY FOR BLOCK CAUSING *DLX* ENTRY.
  3954.  
  3955. SX2 B4 FWA OF *TFCB* ENTRY FOR BLOCK
  3956. DLX2 SA2 X2+TFPTW FOLLOW PREVIOUS *TFCB* LINK TO *TSEQ*
  3957. LX2 TFPTN-1-TFPTS RIGHT JUSTIFY LINK TO PREVIOUS ENTRY
  3958. SX2 X2
  3959. NZ X2,DLX2 IF PREVIOUS *TFCB* ENTRY
  3960. SB2 A2-TSNFW GET FWA OF *TSEQ* ENTRY
  3961. SA2 B2+TSQFW FWA OF ASSIGNED *TBRF* ENTRY
  3962. LX2 TSQFN-1-TSQFS RIGHT JUSTIFY
  3963. SB5 X2 FWA OF ASSIGNED *TBRF* ENTRY
  3964. ZR B5,DLXX IF NO *BRF* ASSIGNED, EXIT TO *CRM*
  3965.  
  3966. * CHECK IF BEFORE IMAGE WRITE IS PENDING
  3967. * FOR THE *TSEQ* ENTRY (*TBRF* RESERVED IF TRUE).
  3968.  
  3969. GETFLD 1,B5,TQSQ *BRF* RESERVATION
  3970. SB7 X1 FWA OF *TSEQ* RESERVING *BRF*
  3971. NE B7,B2,DLX3 IF NOT RESERVED FOR THIS TASK, NO BI PEND
  3972.  
  3973. * THE *TBRF* ENTRY IS RESERVED FOR THE *TSEQ*.
  3974. * *LBK* WILL DETECT BEFORE IMAGE PENDING AND INITIATE
  3975. * THE *BRF* WRITE.
  3976.  
  3977. SA3 B4+TFLNW
  3978. LX3 TFLNN-1-TFLNS
  3979. SB3 X3 FWA OF *TLNT* ENTRY
  3980. SX6 B0+ SET NO ERROR FOR *LBK*
  3981. RJ LBK LOG KEYS AND INITIATE *BRF* I/O
  3982.  
  3983. * CHECK IF *BRF* IS BUSY FOR THIS TASK (*TSEQ* ENTRY).
  3984. * INSURE I/O ON *BRF* IS COMPLETE BEFORE RETURN TO *CRM*.
  3985.  
  3986. DLX3 GETFLD 2,B5,TQSI *TSEQ* ENTRY WRITING BI
  3987. SX7 B5 FWA OF *TBRF* ENTRY
  3988. SA1 B5+TQFFW FIRST WORD OF *BRF* FET
  3989. LX1 59-0
  3990. NG X1,DLXX IF COMPLETE BIT SET, RETURN TO *CRM*
  3991. SB7 X2 FWA OF *TSEQ* ENTRY DOING *BRF* WRITE
  3992. NE B2,B7,DLXX IF *BRF* BUSY FOR SOME OTHER TASK
  3993. SA2 AMST *AMI* STATUS
  3994. BX7 X7+X2 SAVE FWA OF ACTIVE *TBRF* ENTRY
  3995. SA7 A2 STORE IN *AMI* STATUS
  3996.  
  3997. * ON SUBSEQUENT ENTRIES TO *AMI* FROM *TAF*
  3998. * *AMI* WILL CHECK FOR I/O OPERATION COMPLETE
  3999. * ON *BRF* FOR *TBRF* ENTRY IN *AMST*.
  4000. * IF NOT COMPLETE, *AMI* RETURNS TO *TAF*.
  4001. * IF COMPLETE, *AMI* RETURNS TO *CRM* VIA *DLXX*.
  4002.  
  4003. EQ AMIX EXIT TO *TAF*
  4004.  
  4005. DLXA DATA 0L"FSTTID"
  4006. EAK SPACE 4,35
  4007. ** EAK - EMBEDDED ACTUAL KEY PROCESS FOR WRITE REQUEST.
  4008. *
  4009. * THIS SUBROUTINE IS CALLED FROM *LBK* TO PERFORM
  4010. * SPECIAL PROCESSING FOR WRITE REQUESTS ON FILES
  4011. * WHICH ARE FILE ORGANIZATION TYPE ACTUAL KEY WITH
  4012. * EMBEDDED KEYS. THIS SPECIAL PROCESSING IS NECESSARY
  4013. * FOR BOTH RECOVERABLE AND NON-RECOVERABLE TYPE FILES
  4014. * SO THAT -
  4015. * 1. THE EMBEDDED KEY IS RETURNED TO THE TASK.
  4016. * 2. THE ACTUAL KEY IS MOVED TO THE KEY AREA OF
  4017. * THE *TFCB* ENTRY FOR USE BY *LOK*, AND FOR
  4018. * RECOVERABLE FILES, FOR USE BY *LBK*.
  4019. * FLOW -
  4020. * IF WRITE REQUEST AND -
  4021. * FILE ORGANIZATION IS ACTUAL KEY AND -
  4022. * EMBEDDED KEY
  4023. * THEN -
  4024. * MOVE THE RECORD WITH EMBEDDED KEY ASSIGNED
  4025. * BY *CRM* FROM (VAMB) TO THE TASKS WORKING STORAGE
  4026. * AREA (WSA) (TASKS ORIGINAL RECORD IN WSA IS
  4027. * RE-WRITTEN TO CONTAIN RECORD WITH EMBEDDED KEY).
  4028. * THIS IS DONE VIA *MVR* WHICH RETURNS AN ERROR CODE
  4029. * IF THE TASKS WSA IS NOT LARGE ENOUGH TO HOLD THE RECORD,
  4030. * HOWEVER THIS ERROR CONDITION SHOULD NEVER OCCUR IN THIS
  4031. * CASE BECAUSE THE RECORD WAS INITIALLY CONTAINED IN WSA.
  4032. * NOTE THAT THE CODE CHECKS FOR ERROR FROM *MVR* TO
  4033. * FACILITATE POSSIBLE DEBUGGING.
  4034. * MOVE THE EMBEDDED KEY FROM THE RECORD IN THE TASK
  4035. * WSA TO THE KEY AREA OF THE FILE CONTROL ENTRY (*TFCB*).
  4036. * THIS IS DONE VIA *KEX* WHICH RETURNS AN ERROR CODE
  4037. * IF INVALID KEY POSITION IS SPECIFIED, HOWEVER
  4038. * THIS ERROR SHOULD NEVER OCCUR BECAUSE THE PARAMETER
  4039. * IS TAKEN FROM THE *FIT*. NOTE THAT (X6) AS RETURNED
  4040. * BY *KEX* IS NOT CHANGED TO FACILITATE BUG DETECTION.
  4041. *
  4042. * ELSE - NO OPERATION.
  4043. *
  4044. * ENTRY (B2) = FWA OF *TSEQ* ENTRY.
  4045. * (B3) = FWA OF *TLNT* ENTRY.
  4046. * (B4) = FWA OF *TFCB* ENTRY.
  4047. * (X0) = FWA OF *FIT*.
  4048. * (X6) = ZERO, NO *CRM* ERROR.
  4049. * (RCOD) = REQUEST CODE.
  4050. * (TADR) = ABSOLUTE ADDRESS OF REQUEST PARAMETERS.
  4051. *
  4052. * EXIT (X6) = ZERO, IF NO ERROR.
  4053. * = *TERN*, IF TASK WSA TOO SMALL. (FROM *MVR*)
  4054. * = *TERQ*, IF INVALID KEY POSITION. (FROM *KEX*)
  4055. * NOTE THESE ERRORS SHOULD NEVER OCCUR IN THIS
  4056. * SUBROUTINE BUT ARE DOCUMENTED HERE TO FACILITATE
  4057. * DEBUGGING IF THEY SHOULD OCCUR.
  4058. *
  4059. * USES X - 1, 2, 3, 5, 7.
  4060. * A - 1, 2, 3, 7.
  4061. *
  4062. * MACROS FETCH.
  4063. *
  4064. * CALLS KEX, MVR.
  4065.  
  4066.  
  4067. EAK SUBR ENTRY/EXIT
  4068. SA1 RCOD CURRENT REQUEST CODE
  4069. SX1 X1-TRWR
  4070. NZ X1,EAKX IF NOT WRITE REQUEST
  4071. FETCH X0,FO,X2 FILE ORGANIZATION
  4072. SX2 X2-6
  4073. NZ X2,EAKX IF NOT ACTUAL KEY
  4074. FETCH X0,EMK,X5
  4075. ZR X2,EAKX IF NOT EMBEDDED KEY
  4076.  
  4077. * MOVE RECORD TO TASK WSA AND MOVE KEY TO *TFCB*.
  4078.  
  4079. RJ MVR MOVE RECORD TO TASK WSA
  4080. NZ X6,EAKX IF WSA TOO SMALL (SHOULD NEVER OCCUR)
  4081. FETCH X0,RKW,X1 RECORD KEY WORD
  4082. SA2 TADR+TPWS FWA OF RECORD IN TASK WSA
  4083. IX1 X1+X2 FWA OF EMBEDDED KEY IN RECORD
  4084. FETCH X0,RKP,X5 RECORD KEY POSITION
  4085. SX7 X5+1 RKP PLUS 1 TO CONFORM TO KEY OFFSET RULE
  4086. SA7 EAKA SAVE KEY POSITION FOR KEX
  4087. SX2 A7 ADDRESS CONTAINING KEY POSITION
  4088. FETCH X0,KL,X3 KEY LENGTH
  4089. RJ KEX EXTRACT KEY FROM TASK
  4090. EQ EAKX RETURN
  4091.  
  4092. EAKA CON 0 RECORD KEY POSITION
  4093. SPACE 4,10
  4094. ** FDB - FIND DATA BASE *TDRF* ENTRY.
  4095. *
  4096. * ENTRY (X1) = DATA BASE ID, LEFT JUSTIFIED.
  4097. * (RDRT) = FWA OF FIRST *TDRF* ENTRY.
  4098. *
  4099. * EXIT (X7) = FWA OF DATA BASE *TDRF* ENTRY.
  4100. * = ZERO IF DATA BASE *TDRF* NOT FOUND.
  4101. *
  4102. * USES X - 2, 7.
  4103. * A - 2.
  4104. * B - NONE.
  4105.  
  4106.  
  4107. FDB SUBR ENTRY/EXIT
  4108. SA2 RDRT FWA OF FIRST *TDRT* ENTRY
  4109. FDB1 SX7 X2+ FWA OF *TDRF* ENTRY
  4110. ZR X7,FDBX IF END OF *TDRF* TABLE
  4111. SA2 X7+TDIDW DATA BASE ID
  4112. BX2 X2-X1
  4113. AX2 60-TDIDN
  4114. ZR X2,FDBX IF DATA BASE ID MATCHES - FOUND
  4115. SA2 A2-TDIDW+TDDLW FWA OF NEXT *TDRF* ENTRY
  4116. EQ FDB1 CHECK NEXT ENTRY
  4117.  
  4118. SPACE 4,10
  4119. ** FLS - *FLUSHM* RECOVERABLE FILES.
  4120. *
  4121. * ENTRY (B2) = FWA OF *TSEQ*.
  4122. * (RSEQ) = FWA OF *TSEQ*.
  4123. *
  4124. * EXIT (B1) = 1.
  4125. * (B2) = FWA OF *TSEQ*.
  4126. * (RFCB) = ZERO.
  4127. *
  4128. * USES X - 1, 2, 4, 7.
  4129. * A - 1, 2, 4, 7.
  4130. * B - 1, 2, 4, 6, 7.
  4131. *
  4132. * MACROS GETFLD, FETCH, FLUSHM.
  4133.  
  4134.  
  4135. FLS SUBR ENTRY/EXIT
  4136. SA4 B2+TSNFW FWA OF FIRST FILE LINK FOR TRANSACTION
  4137. FLS1 SB7 BUFL LENGTH OF FITLIST AREA
  4138. SB6 B0+ INITIALIZE FITLIST INDEX
  4139. FLS2 SB4 X4+ FWA OF NEXT LINK FOR TRANSACTION
  4140. ZR B4,FLS3 IF END OF *TFCB* CHAIN FOR TRANSACTION
  4141. SB4 X4-TFNTW FWA OF *TFCB* ENTRY
  4142. SA4 B4+TFNTW FWA OF NEXT *TFCB* ENTRY FOR TRANSACTION
  4143. GETFLD 1,B4,TFLN FWA OF *TLNT* ENTRY FOR FILE
  4144. SA2 X1+TLRFW RECOVERABLE FILE FLAG
  4145. LX2 59-TLRFS
  4146. PL X2,FLS2 IF NOT RECOVERABLE FILE TYPE
  4147. SX7 B4+TFFTW FWA OF *FIT*
  4148. FETCH X7,FWI,X1,1,2 FORCE WRITE INDICATOR
  4149. NG X1,FLS2 IF FORCE WRITE INDICATOR IS SET
  4150. FETCH X7,FNF,X1,1,2
  4151. NG X1,FLS2 IF FATAL *CRM* ERROR
  4152. SA1 X7 FILE NAME FROM *FIT*
  4153. MX2 42D
  4154. BX1 X2*X1 FILE NAME
  4155. BX7 X1+X7 MERGE FILE NAME AND FWA OF *FIT*
  4156. SA7 B6+BUF STORE IN FITLIST
  4157. SB6 B6+1 INCREMENT FITLIST INDEX
  4158. NE B6,B7,FLS2 IF FITLIST NOT FULL
  4159. FLS3 SX7 X4 FWA OF NEXT *TFCB* FOR TRANSACTION
  4160. SA7 RFCB SAVE FWA OF NEXT *TFCB*
  4161. SX7 B0
  4162. ZR B6,FLSX IF NO FILES TO FLUSH
  4163. SA7 B6+BUF STORE ZERO TO MARK END OF FITLIST
  4164. SA1 BUF SET *FSTT* WRITE-SUPPRESS BIT
  4165. SA1 X1+13D
  4166. MX2 1
  4167. LX2 32-59
  4168. BX6 X2+X1
  4169. SA6 A1
  4170. FLUSHM BUF
  4171. SA1 BUF CLEAR *FSTT* WRITE-SUPPRESS BIT
  4172. SA1 X1+13D
  4173. MX2 60-1
  4174. LX2 32-0
  4175. BX6 X2*X1
  4176. SA6 A1
  4177. SA2 RSEQ FWA OF *TSEQ* ENTRY FOR TRANSACTION
  4178. SA4 RFCB FWA OF NEXT *TFCB* ENTRY FOR TRANSACTION
  4179. SB2 X2+ FWA OF *TSEQ*
  4180. SB1 1 RESTORE (B1)
  4181. EQ FLS1 CHECK NEXT *TFCB* FOR TRANSACTION
  4182.  
  4183. FTS SPACE 4,10
  4184. ** FTS - FIND TRANSACTION SEQUENCE NUMBER.
  4185. *
  4186. * ENTRY (REQT) = CURRENT REQUEST.
  4187. *
  4188. * EXIT (B2) = FWA OF TRANSACTION SEQUENCE ENTRY.
  4189. * (B7) = (B2) IF NEW ENTRY CREATED (NEW REQUEST).
  4190. *
  4191. * USES X - 0, 1, 3, 4, 6.
  4192. * A - 1, 3, 6.
  4193. * B - 2, 6, 7.
  4194.  
  4195.  
  4196. FTS SUBR ENTRY/EXIT
  4197. SB2 TSEQ FWA OF TRANSACTION SEQUENCE TABLE
  4198. SA1 REQT CURRENT REQUEST
  4199. MX0 TSSQN MASK FOR TRANSACTION SEQUENCE NUMBER
  4200. BX6 X0*X1
  4201. SA3 TSEQLWA LWA+1 OF IN-USE *TSEQ* TABLE
  4202. SB6 X3+
  4203. FTS1 SA3 B2 TRANSACTIONS SEQUENCE ENTRY
  4204. BX3 X0*X3 SEQUENCE NUMBER
  4205. IX4 X3-X6
  4206. ZR X4,FTSX IF ENTRY FOUND - RETURN
  4207. SB2 B2+TSEQE FWA OF NEXT ENTRY
  4208. NZ X3,FTS2 IF ENTRY USED
  4209. SB7 A3+ SAVE UNUSED ENTRY
  4210. FTS2 LT B2,B6,FTS1 IF MORE ENTRIES
  4211. SA6 B7 CREATE NEW ENTRY
  4212. SB2 B7
  4213. EQ FTSX RETURN
  4214. SPACE 4,10
  4215. ** FUI - FIND AND SET DATA BASE USER NUMBER AND FAMILY.
  4216. *
  4217. * ENTRY (X1) = DATA BASE ID, LEFT JUSTIFIED.
  4218. *
  4219. * EXIT (X6) = *TERB*, IF DATA BASE *EDT* ENTRY NOT FOUND,
  4220. * OR ILLEGAL FAMILY NAME IN *EDT* ENTRY.
  4221. * = ZERO, IF NO ERROR.
  4222. *
  4223. * USES X - 1, 2, 6, 7.
  4224. * A - 1, 2.
  4225. * B - NONE.
  4226. *
  4227. * CALLS SED, SFM.
  4228.  
  4229.  
  4230. FUI SUBR ENTRY/EXIT
  4231. RJ SED FIND DATA BASE *EDT* ENTRY
  4232. SX6 TERB DATA BASE NOT INSTALLED ERROR CODE
  4233. ZR B7,FUIX IF DATA BASE *EDT* ENTRY NOT FOUND
  4234. SA1 B7+2 USER NUMBER FROM *EDT*
  4235. SA2 B7+6 FAMILY NAME FROM *EDT*
  4236. MX7 42
  4237. BX7 X7*X2 (FAMILY)
  4238. RJ SFM SET UN AND FAMILY
  4239. SX6 TERB ILLEGAL FAMILY NAME IN *EDT* ERROR
  4240. NG X1,FUIX IF ILLEGAL FAMILY NAME IN *EDT*
  4241. SX6 B0+ NO ERROR
  4242. EQ FUIX RETURN
  4243.  
  4244. SPACE 4,10
  4245. ** IDB - IDLE DATA BASE.
  4246. *
  4247. * ENTRY (RDRF) = FWA OF CURRENT *TDRF* ENTRY.
  4248. *
  4249. * EXIT (X6) = ZERO, IF DATA BASE IDLED AND COUNTED.
  4250. * = *TERAG*, IF DATA BASE WAS ALREADY IDLED.
  4251. * = *TERAK*, IF DATA BASE WAS ALREADY DOWNED.
  4252. *
  4253. * USES X - 1, 2, 6, 7.
  4254. * A - 1, 2, 7.
  4255. *
  4256. * MACROS GETFLD, PUTFLD.
  4257. *
  4258. * CALL NMS.
  4259.  
  4260.  
  4261. IDB SUBR ENTRY/EXIT
  4262. SA1 RDRF FWA OF CURRENT *TDRF* ENTRY
  4263. SA2 X1+TDSDW
  4264. SX6 TERAK DATA BASE DOWN ERROR CODE
  4265. NG X2,IDBX IF DATA BASE ALREADY DOWN
  4266. MX7 -TDSIN
  4267. LX7 TDSIS-TDSIN+1
  4268. BX7 -X7+X2 SET DATA BASE IDLE FLAG
  4269. SA7 A2 STORE FLAGS
  4270. LX2 59-TDSIS
  4271. SX1 B1
  4272. SX6 TERAG DATA BASE IDLE ERROR CODE
  4273. NG X2,IDBX IF DATA BASE WAS ALREADY IDLED
  4274. GETFLD 2,AMST,AMIB COUNT OF IDLED DATA BASES
  4275. IX2 X2+X1 INCREMENT COUNT
  4276. PUTFLD 2,AMST,AMIB STORE NEW COUNT
  4277. MX7 TDIDN DATA BASE ID MASK
  4278. SA2 RDRF
  4279. SA1 MSGH DATA BASE IDLING MESSAGE
  4280. SA2 X2+TDIDW DATA BASE ID
  4281. RJ NMS REPORT DATA BASE IDLING DOWN
  4282. SX6 B0 DATA BASE IDLED AND COUNTED
  4283. EQ IDBX RETURN
  4284.  
  4285. SPACE 4,10
  4286. ** IDF - IDLE DATA BASE FILE.
  4287. *
  4288. * ENTRY (RDRF) = FWA OF CURRENT *TDRF* ENTRY.
  4289. * (RLNT) = FWA OF CURRENT *TLNT* ENTRY.
  4290. *
  4291. * EXIT (X6) = ZERO, IF FILE SET IDLE AND COUNTED.
  4292. * = *TERAG*, IF FILE ALREADY IDLED.
  4293. * = *TERAK*, IF FILE ALREADY DOWNED.
  4294. *
  4295. * USES X - 1, 2, 5, 6, 7.
  4296. * A - 1, 2, 5, 7.
  4297. * B - NONE.
  4298. *
  4299. * MACROS GETFLD, PUTFLD.
  4300. *
  4301. * CALLS NMS.
  4302.  
  4303.  
  4304. IDF SUBR ENTRY/EXIT
  4305. SA1 RLNT FWA OF FILE *TLNT* ENTRY
  4306. SX6 TERAK FILE DOWN ERROR CODE
  4307. SA2 X1+TLFDW
  4308. NG X2,IDFX IF FILE ALREADY DOWN
  4309. MX7 -TLFIN
  4310. LX7 TLFIS-TLFIN+1
  4311. BX7 -X7+X2 SET FILE IDLE FLAG
  4312. SA7 A2 STORE FLAG
  4313. SX6 TERAG FILE IDLE ERROR CODE
  4314. LX2 59-TLFIS
  4315. SX1 B1
  4316. NG X2,IDFX IF FILE WAS ALREADY IDLE
  4317. SA5 RDRF FWA OF CURRENT DATA BASE *TDRF* ENTRY
  4318. GETFLD 2,X5,TDIF COUNT OF IDLED FILES IN DATA BASE
  4319. IX2 X2+X1 INCREMENT COUNT
  4320. PUTFLD 2,X5,TDIF STORE NEW COUNT
  4321. SX1 B1
  4322. GETFLD 2,AMST,AMIF COUNT OF IDLED FILES IN ALL DATA BASES
  4323. IX2 X2+X1 INCREMENT COUNT
  4324. PUTFLD 2,AMST,AMIF STORE NEW COUNT
  4325. MX7 TLFNN FILE NAME MASK
  4326. SA2 RLNT
  4327. SA1 MSGI FILE IDLING MESSAGE
  4328. SA2 X2+TLFNW FILE NAME FROM *TLNT*
  4329. RJ NMS REPORT FILE IDLING DOWN
  4330. SX6 B0 FILE IDLED AND COUNTED
  4331. EQ IDFX RETURN
  4332. IOP SPACE 4,20
  4333. ** IOP - INITIAL OPEN FILE PROCESS.
  4334. *
  4335. * ENTRY (X0) = FWA OF *FIT*.
  4336. *
  4337. * EXIT (B1) = 1.
  4338. * (X6) = ZERO, IF NO ERROR.
  4339. * = *TERI*, IF *CRM* ERROR.
  4340. * = *TERT*, IF INVALID KEY LENGTH.
  4341. * = *TERU*, IF INVALID RECORD LENGTH.
  4342. *
  4343. * USES X - ALL.
  4344. * A - 1, 2, 3, 5, 6, 7.
  4345. * B - 1, 2, 3, 6.
  4346. *
  4347. * MACROS CLOSEM, FETCH, GETFLD, OPENM, PUTFLD, REWINDM.
  4348. *
  4349. * CALLS CCS, CFS, COD, NMS, SNM, STK.
  4350.  
  4351.  
  4352. IOP SUBR ENTRY/EXIT
  4353. RJ CFS CHECK FATAL *CRM* STATUS
  4354. NZ X6,IOP8 IF FATAL *CRM* STATUS (*TERI*)
  4355. OPENM X0 OPEN FILE
  4356. RJ CCS CHECK *CRM* STATUS
  4357. NZ X6,IOP6 IF ERROR ON OPEN (*TERI*)
  4358.  
  4359. * CHECK KEY LENGTH AND MAXIMUM RECORD LENGTH FROM FILE
  4360. * AGAINST VALUES FROM *CRM* CARD AT INSTALL TIME.
  4361. * IF *CRM* CARD VALUES ARE LESS THAN THOSE FROM
  4362. * THE FILE, DO NOT ALLOW ACCESS TO THE FILE SINCE
  4363. * FURTHER USE MAY CAUSE *TAF* TO ABORT.
  4364.  
  4365. IOP0 FETCH X0,KL,X5 KEY LENGTH FROM FILE *FIT*
  4366. GETFLD 1,B3,TLKS KEY LENGTH SPECIFIED ON *CRM* CARD
  4367. GETFLD 2,B3,TLRS RECORD LENGTH SPECIFIED ON *CRM* CARD
  4368. IX7 X1-X5
  4369. SX6 TERT INVALID KEY LENGTH ON INSTALLATION ERROR
  4370. NG X7,IOP6 IF INVALID KEY LENGTH ON *CRM* CARD
  4371. FETCH X0,MRL,X5 MAXIMUM RECORD LENGTH FROM FILE
  4372. IX7 X2-X5
  4373. SX6 TERU INVALID RECORD LENGTH ON INSTALLATION
  4374. NG X7,IOP6 IF INVALID RECORD LENGTH ON *CRM* CARD
  4375.  
  4376. * STORE KEY DESCRIPTION FROM FILE INTO *TLNT* ENTRY.
  4377.  
  4378. FETCH X0,RKW,X4 KEY RELATIVE POSITION
  4379. FETCH X0,RKP,X7 KEY BEGINNING CHARACTER POSITION
  4380. LX4 36
  4381. LX7 18
  4382. BX4 X7+X4
  4383. FETCH X0,KL,X5 PRIMARY KEY LENGTH
  4384. BX7 X4+X5
  4385.  
  4386. * PRIMARY KEY DESCRIPTION WORD -
  4387. * TLKW - 6/0,18/ RKW,18/ RKP,18/ KL.
  4388.  
  4389. SA7 B3+TLKWW STORE PRIMARY KEY DESCRIPTION INTO *TLNT*
  4390. PUTFLD 5,B3,TLKL STORE PRIMARY KEY LENGTH INTO *TLNT*
  4391. GETFLD 1,B3,TLNA NUMBER OF ALTERNATE KEYS
  4392. BX7 X1
  4393. ZR X7,IOP3 IF NO ALTERNATE KEYS
  4394.  
  4395. * REWIND FILE FOR ALL ALTERNATE KEYS.
  4396.  
  4397. IOP1 SA7 IOPA NUMBER OF ALTERNATE KEYS TO SET
  4398. SX7 X7+TLKWW KEY DESCRIPTION WORD IN *TLNT*
  4399. SA3 B3+X7 KEY DESCRIPTION
  4400. NG X3,IOP2 IF KEY DELETED
  4401. RJ STK SET KEY DESCRIPTION IN *FIT*
  4402. REWINDM X0 REWIND FOR KEY
  4403. RJ CCS CHECK *CRM* STATUS
  4404. NZ X6,IOP6 IF *CRM* ERROR
  4405. IOP2 SA1 IOPA NUMBER OF ALTERNATE KEYS TO SET
  4406. SX7 X1-1 DECREMENT NUMBER OF ALTERNATE KEYS
  4407. NZ X7,IOP1 IF MORE ALTERNATE KEYS TO SET
  4408.  
  4409. * RESTORE PRIMARY KEY IN *FIT*.
  4410.  
  4411. SX6 B0+
  4412. PUTFLD 6,B4,TFKO PRIMARY KEY ORDINAL
  4413. SA3 B3+TLKWW PRIMARY KEY DESCRIPTION
  4414. RJ STK SET PRIMARY KEY IN *FIT*
  4415.  
  4416. * OPEN ALL *FIT-S* FOR FILE SO THAT THE *CRM* OPEN CAPSULE
  4417. * IS LOADED ONLY ONCE FOR A FILE.
  4418.  
  4419. IOP3 SA1 B3+TLNFW FILE CONTROL ENTRY LINK
  4420. SA2 B3+TLICW
  4421. MX6 60-TLICN CLEAR INCONSISTENT FLAG
  4422. LX6 TLICS-TLICN+1
  4423. BX6 X6*X2
  4424. SA6 A2
  4425. IOP4 SX1 X1+ FILE CONTROL ENTRY LINK
  4426. ZR X1,IOP5 IF NO MORE FILE CONTROL ENTRIES
  4427. SX7 X1-TFNFW FWA OF FILE CONTROL ENTRY
  4428. SA7 IOPB SAVE FWA OF *TFCB*
  4429. SX0 X7+TFFTW FWA OF *FIT*
  4430. OPENM X0 OPEN *FIT*
  4431. SA1 IOPB FWA OF *TFCB*
  4432. SA1 X1+TFNFW FILE CONTROL LINK
  4433. EQ IOP4 OPEN NEXT *FIT*
  4434.  
  4435. IOP5 SB1 1 RESTORE (B1)
  4436. SX6 0 NO ERROR
  4437. EQ IOPX RETURN
  4438.  
  4439. * ERROR ON INITIAL OPEN FILE.
  4440.  
  4441. IOP6 SA6 IOPC SAVE ERROR CODE
  4442. FETCH X0,OC,X5 *FIT* OPEN STATUS
  4443. SX5 X5-1
  4444. NZ X5,IOP7 IF *FIT* NOT OPEN
  4445. FETCH X0,FNF,X5 FETCH FATAL STATUS
  4446. NG X5,IOP7 IF FATAL STATUS
  4447. SB1 1 RESTORE (B1)
  4448. SA1 IOPC
  4449. SA2 B3+TLRFW
  4450. SX6 X1-TERI
  4451. NZ X6,IOP6.3 IF NOT CRM ERROR
  4452. LX2 59-TLRFS
  4453. PL X2,IOP6.3 IF NOT RECOVERABLE
  4454. GETFLD 1,X0,FTFSTT FWA OF FILE *FSTT*
  4455. SA2 X1+FSHEADW *FSTT* HEADER WORD
  4456. SA3 IOPD *FSTT* BLOCK TYPE INDICATOR
  4457. BX3 X2-X3 COMPARE WITH *FSTT* HEADER WORD
  4458. AX3 30 ONLY UPPER 30 BITS ARE COMPARED
  4459. NZ X3,IOP6.2 IF *FSTT* BLOCK NOT FOUND
  4460. SA2 X1+FS2BLOW FILE INCONSISTENT FLAG WORD
  4461. LX2 59-FS2BLOS INCONSISTENT FLAG TO SIGN BIT
  4462. NG X2,IOP6.1 IF FILE IS INCONSISTENT
  4463. LX2 59-FS2BLIS-59+FS2BLOS
  4464. NG X2,IOP6.1 IF FILE IS INCONSISTENT
  4465.  
  4466. * THE *CRM* ERROR IS NON-FATAL, AND THE FILE
  4467. * IS OPEN, AND THE FILE IS CONSISTENT THEN CLEAR
  4468. * *FILE NOT CLOSED PROPERLY* FLAG FROM *FSTT* AND
  4469. * ISSUE INFORMATIVE MESSAGE BEFORE RESUMING RECOVERY PROCESS.
  4470.  
  4471. SA3 X1+FSNCLW FILE NOT CLOSED PROPERLY FLAG WORD
  4472. MX7 60-FSNCLN NOT CLOSED PROPERLY FLAG MASK
  4473. LX7 FSNCLS-FSNCLN+1 POSITION MASK
  4474. BX7 X7*X3 CLEAR NOT CLOSED PROPERLY FLAG
  4475. SA7 A3 RESTORE IN *FSTT*
  4476. SX6 B0+ CLEAR *CRM* ERROR INDICATOR
  4477. SA6 IOPC
  4478. SA1 RNFE CONSTRUCT AND ISSUE INFORMATIVE MESSAGE
  4479. SB6 B3+
  4480. RJ COD ADD ERROR STATUS
  4481. MX7 1
  4482. SB2 B2-B1
  4483. AX7 X7,B2
  4484. BX1 X7*X4
  4485. SB2 1R/
  4486. SB3 NMSB
  4487. SB5 -MSGN
  4488. RJ SNM
  4489. FETCH X0,LFN,X2 ADD FILE NAME
  4490. MX7 42
  4491. SA1 NMSB
  4492. RJ NMS
  4493. SB3 B6
  4494. EQ IOP0 CONTINUE NORMAL RECOVERY PROCESS
  4495.  
  4496. IOP6.1 SA2 A2 SET PERMANENT *FSTT* INCONSISTENT FLAG
  4497. MX1 FS2BLIN
  4498. LX1 FS2BLIS-59
  4499. BX6 X1+X2
  4500. SA6 A2
  4501. FETCH X0,LFN,X2 * LFN IS INCONSISTENT.*
  4502. SA1 MSGO
  4503. MX7 42
  4504. RJ NMS
  4505. MX2 TLICN SET INCONSISTENT FLAG
  4506. SA1 B3+TLICW
  4507. LX2 TLICS-59
  4508. BX6 X2+X1
  4509. SA6 A1+
  4510.  
  4511. * IDLE AND CLOSE FILE.
  4512.  
  4513. IOP6.2 RJ IDF SET FILE IDLE FLAG
  4514. SA1 RLNT
  4515. SA1 X1+TLFEW
  4516. MX7 -TLFEN
  4517. LX7 TLFES-TLFEN+1
  4518. BX1 -X7+X1 SET FILE DOWN FOR FATAL *CRM* ERROR
  4519. LX7 TLRFS-TLFES
  4520. BX7 -X7*X1
  4521. LX7 TLBRS-TLRFS POSITION RECOVERABLE FILE FLAG
  4522. BX7 X7+X1 SET DOWN FOR BATCH RECOVERY IF RECOVERABLE
  4523. SA7 A1
  4524. IOP6.3 CLOSEM X0 CLOSE FILE
  4525. IOP7 SB1 1 RESTORE (B1)
  4526. SA1 IOPC ERROR CODE
  4527. SX6 X1+
  4528. EQ IOPX RETURN
  4529.  
  4530. IOP8 RJ CCS CHECK ERROR STATUS
  4531. EQ IOPX RETURN
  4532.  
  4533. IOPA BSS 1 NUMBER OF ALTERNATE KEYS
  4534. IOPB BSS 1 FWA OF *TFCB*
  4535. IOPC BSS 1 ERROR CODE
  4536. IOPD DATA 0L"FSTTID"
  4537. KEX SPACE 4,20
  4538. ** KEX - KEY EXTRACT.
  4539. *
  4540. * ENTRY (X1) = FWA OF KEY AREA.
  4541. * (X2) = FWA OF KEY POSITION.
  4542. * (X3) = KEY LENGTH IN CHARACTERS.
  4543. * (B4) = FWA OF FILE CONTROL ENTRY.
  4544. *
  4545. * EXIT KEY IS MOVED TO KEY AREA OF FILE CONTROL ENTRY.
  4546. * (X6) = 0, IF NO ERRORS.
  4547. * = *TERQ*, IF INVALID KEY POSITION.
  4548. *
  4549. * USES X - ALL.
  4550. * A - 1, 2, 3, 4, 5, 6, 7.
  4551. * B - 5, 6, 7.
  4552. *
  4553. * CALLS CTW.
  4554.  
  4555.  
  4556. KEX5 SX6 TERQ INVALID KEY POSITION ERROR
  4557.  
  4558. KEX SUBR ENTRY/EXIT
  4559. SA2 X2 KEY POSITION
  4560. BX6 X1
  4561. SA6 KEXA
  4562. ZR X2,KEX5 IF INVALID KEY POSITION
  4563. NG X2,KEX5 IF INVALID KEY POSITION
  4564. BX7 X2
  4565. SA7 KEXB KEY POSITION
  4566. IX7 X3+X2 LENGTH OF KEY PLUS KEY POSITION
  4567. RJ CTW CONVERT CHARACTERS TO WORDS
  4568. NG X1,KEX5 IF INVALID KEY OFFSET
  4569. SA2 KEXA FWA OF KEY
  4570. SB6 X2
  4571. IX4 X2+X1 LWA OF KEY
  4572. SA5 TADR+TPFL FL OF TASK
  4573. SA1 TADR+TPRA REQUEST RA
  4574. IX5 X1+X5 LWA + 1 OF TASK
  4575. IX0 X5-X4
  4576. NG X0,KEX5 IF LWA OF KEY NOT IN TASK FL
  4577. SA4 KEXB KEY POSITION IN CHARACTERS
  4578. SX7 X4-1
  4579. RJ CTW CONVERT CHARACTERS TO WORDS
  4580. SX0 6 FORM MASK FOR SAVING CHARACTERS
  4581. IX5 X6*X0
  4582. SB5 X5 SHIFT TO LEFT JUSTIFY KEY
  4583. BX2 X2-X2 MASK FOR SAVING KEY FOR WORD I+1
  4584. MX0 60 MASK FOR SAVING KEY FOR WORD I
  4585. ZR X5,KEX1 IF KEY STARTS ON WORD BOUNDARY
  4586. SB7 B5-B1 CREATE MASK FOR SAVING KEY FOR WORD I
  4587. MX2 1
  4588. AX2 B7 MASK FOR WORD I+1
  4589. BX0 -X2
  4590. LX0 X0,B5 MASK J CHARACTERS FOR WORD I
  4591. SX1 X1-1
  4592. KEX1 SB6 B6+X1 FWA OF KEY IN TASK
  4593. SX7 X3
  4594. RJ CTW CONVERT CHARACTERS TO WORDS
  4595. MX5 60
  4596. BX4 X2
  4597. ZR X6,KEX2 IF KEY ENDS ON WORD BOUNDARY
  4598. SX3 6 CREATE MASK FOR LAST WORD
  4599. IX6 X3*X6
  4600. MX5 1
  4601. SB7 X6-1
  4602. AX5 B7 MASK TO SAVE CHARACTERS IN LAST WORD
  4603. KEX2 SB7 B4+TFKYW FWA OF KEY DESTINATION
  4604. SA3 B6 WORD I OF KEY
  4605. BX2 X3
  4606. KEX3 LX2 B5 LEFT JUSTIFY KEY TO WORD BOUNDARY
  4607. BX7 X0*X2 EXTRACT J CHARACTERS IN WORD I
  4608. SA3 A3+1 WORD I+1 OF KEY
  4609. BX6 X4*X3 EXTRACT 10-J CHARACTERS IN WORD I+1
  4610. LX6 B5
  4611. BX7 X7+X6 MERGE WORDS I AND I+1
  4612. BX2 X3
  4613. SX1 X1-1
  4614. ZR X1,KEX4 IF LAST WORD OF KEY
  4615. SA7 B7
  4616. SB7 B7+B1
  4617. EQ KEX3 MOVE NEXT KEY WORD
  4618.  
  4619. KEX4 BX7 X5*X7 EXTRACT CHARACTERS FROM LAST WORD
  4620. BX6 X6-X6 NO ERRORS ON RETURN
  4621. SA7 B7+ SAVE LAST WORD OF KEY
  4622. EQ KEXX RETURN
  4623.  
  4624. KEXA BSS 1 FWA OF KEY
  4625. KEXB BSS 1 KEY POSITION
  4626. KSR SPACE 4,20
  4627. ** KSR - KEY SEARCH.
  4628. *
  4629. * ENTRY (B3) = FWA OF LOGICAL NAME TABLE ENTRY.
  4630. * (B4) = FWA OF FILE CONTROL TABLE ENTRY.
  4631. * (B7) = 1, IF FILE LOCK REQUESTED.
  4632. *
  4633. * EXIT (X5) = 0, IF RECORD/FILE NOT LOCKED.
  4634. * = 1, IF FILE LOCKED.
  4635. * = 2, IF RECORD LOCKED.
  4636. * (B5) = FWA OF LOCK ENTRY.
  4637. * (B7) = ENTRY VALUE.
  4638. *
  4639. * USES X - ALL.
  4640. * A - 1, 2, 3, 4, 5.
  4641. * B - 5, 6, 7.
  4642. *
  4643. * CALLS CTW.
  4644. *
  4645. * MACROS FETCH.
  4646.  
  4647.  
  4648. KSR5 SX5 B1+B1 RECORD IS LOCKED
  4649.  
  4650. KSR SUBR ENTRY/EXIT
  4651. SA5 B3+TLKLW GET PRIMARY KEY LENGTH IN CHARACTERS
  4652. MX7 -TLKLN
  4653. LX5 TLKLN-TLKLS-1
  4654. BX7 -X7*X5
  4655. SB6 B7 SAVE (B7)
  4656. RJ CTW CONVERT CHARACTERS TO WORDS
  4657. SB7 B6 RESTORE (B7)
  4658. BX5 X5-X5 NO LOCK CONFLICTS
  4659. SA4 B3+TLNLW FIRST LOCK LINK FOR FILE
  4660. KSR1 SX6 X4+
  4661. SB5 X6-TKNFW FWA OF LOCK ENTRY
  4662. ZR X6,KSRX IF END OF LOCK ENTRIES - RETURN
  4663. SA3 B5+TKFKW FILE LOCK FIELD
  4664. NG X3,KSR4 IF FILE LOCKED
  4665. EQ B7,B1,KSR5 IF FILE LOCK REQUESTED
  4666. SA2 B5+TKKYW FIRST WORD OF LOCKED KEY
  4667. SB6 X1-1 WORD COUNT TO COMPARE KEYS
  4668. SA3 B4+TFKYW FIRST WORD OF REQUESTED KEY
  4669. KSR2 IX2 X2-X3
  4670. SA3 A3+B1 NEXT WORD OF REQUESTED KEY
  4671. NZ X2,KSR3 IF REQUESTED KEY NOT LOCKED
  4672. ZR B6,KSR5 IF REQUESTED KEY LOCKED
  4673. SB6 B6-B1
  4674. SA2 A2+B1 NEXT WORD OF KEY FROM LOCK TABLE
  4675. EQ KSR2 CONTINUE COMPARING KEYS
  4676.  
  4677. KSR3 SA4 B5+TKNFW LINK TO NEXT LOCK ENTRY
  4678. EQ KSR1 CHECK NEXT LOCK ENTRY
  4679.  
  4680. KSR4 SX5 B1 FILE IS LOCKED
  4681. EQ KSRX
  4682.  
  4683. SPACE 4,10
  4684. ** LAI - LOG AFTER IMAGE RECORD.
  4685. *
  4686. * ENTRY (X0) = FWA OF *FIT*.
  4687. * (B2) = FWA OF *TSEQ*.
  4688. * (B3) = FWA OF *TLNT*.
  4689. * (B4) = FWA OF *TFCB*.
  4690. * (RCOD) = REQUEST CODE.
  4691. *
  4692. * EXIT TO CALLER IF AFTER IMAGE LOGGED.
  4693. * (X6) = ZERO.
  4694. *
  4695. * TO *CAR7* IF *ARF* BUSY, IMAGE NOT LOGGED.
  4696. * (X6) = ZERO.
  4697. *
  4698. * USES X - 1, 2, 3, 5, 6, 7.
  4699. * A - 1, 2, 3, 5, 7.
  4700. * B - 7.
  4701. *
  4702. * MACROS GETFLD, PUTFLD.
  4703. *
  4704. * CALLS CLB, CTW, MVD, PAH, PAQ, WAI.
  4705.  
  4706.  
  4707. LAI SUBR ENTRY/EXIT
  4708. SA1 B3+TLRFW GET RECOVERABLE FILE FLAG FROM *TLNT*
  4709. LX1 59-TLRFS
  4710. SX6 B0
  4711. PL X1,LAIX IF FILE NOT RECOVERABLE TYPE - RETURN
  4712. SX2 B1
  4713. PUTFLD 2,B2,TSAI SET WAITING FOR *ARF* FLAG IN *TSEQ*
  4714. RJ CLB CHECK IF *ARF* BUSY
  4715. NZ X6,LAI4 IF *ARF* DOWN
  4716. ZR B5,CAR7 IF *ARF* IS BUSY
  4717. RJ PAQ CHECK IF *BRF* DOWN STAMP TO BE WRITTEN
  4718. NG X1,CAR7 IF *BRF* DOWN STAMP WRITE ACTIVE
  4719.  
  4720. * THE *ARF* IS AVAILABLE.
  4721. * PREPARE THE AFTER IMAGE RECORD HEADER.
  4722.  
  4723. SA5 RCOD REQUEST CODE
  4724. RJ PAH PREPARE AFTER IMAGE HEADER
  4725. MX7 -TSBWN
  4726. LX7 TSBWS-TSBWN+1
  4727. SA2 B2+TSBWW
  4728. BX7 X7*X2 CLEAR FIRST IMAGE FLAG
  4729. SA7 A2
  4730.  
  4731. * PREPARE KEY AREA OF AFTER IMAGE RECORD.
  4732.  
  4733. GETFLD 3,B3,TLKL PRIMARY KEY LENGTH IN CHARACTERS
  4734. BX7 X3 KEY SIZE IN CHARACTERS
  4735. RJ CTW CONVERT KEY SIZE TO WORDS
  4736. GETFLD 3,B5,TAIN GET *IN* OF *ARF* BUFFER FROM *TARF*
  4737. SX2 B4+TFKYW FWA OF KEYS IN *TFCB*
  4738. IX5 X3+X1 FWA OF RECORD-AREA IN AFTER IMAGE RECORD
  4739. BX7 X5
  4740. SA7 B5+TAINW UPDATE *IN* POINTER
  4741. SB7 X1 SAVE KEY SIZE IN WORDS
  4742. RJ MVD MOVE KEYS FROM *TFCB* INTO *ARF* BUFFER
  4743. SA1 RCOD REQUEST CODE
  4744. SX1 X1-TRDE
  4745. ZR X1,LAI3 IF DELETE REQUEST, NO AFTER RECORD
  4746.  
  4747. * PREPARE RECORD AREA OF AFTER IMAGE RECORD.
  4748.  
  4749. SA1 B4+TFBFW
  4750. SA2 B2+TSQFW
  4751. LX1 59-TFBFS
  4752. LX2 TSQFN-1-TSQFS
  4753. PL X1,LAI1 IF NOT INTERNAL DBFREE PROCESSING
  4754. SA3 X2+TQFTW FWA OF *BRF* BUFFER FROM *TBRF* FET
  4755. SX2 B7+TQRHL KEY SIZE IN WORDS PLUS HEADER LENGTH
  4756. GETFLD 1,X3,XQRS RECORD SIZE IN CHARS. FROM BI HEADER
  4757. SX3 X3 FWA OF *BRF* BUFFER
  4758. IX2 X2+X3 FWA OF RECORD-AREA IN *BRF* BUFFER
  4759. EQ LAI2 MOVE BI RECORD INTO AI RECORD AREA
  4760.  
  4761. LAI1 SA1 TADR+TPWR FWA OF TASK RECORD LENGTH
  4762. SA2 TADR+TPWS FWA OF TASK WORKING STORAGE
  4763. SA1 X1+ RECORD LENGTH IN CHARACTERS
  4764. LAI2 BX7 X1
  4765. BX3 X5 FWA OF RECORD-AREA IN AFTER IMAGE RECORD
  4766. RJ CTW CONVERT RECORD LENGTH TO WORDS
  4767. IX5 X3+X1 LWA+1 OF AFTER IMAGE RECORD
  4768. BX7 X5
  4769. SA7 B5+TAINW UPDATE *IN* POINTER
  4770. RJ MVD MOVE DATA FROM RECORD AREA INTO BUFFER
  4771. LAI3 SB7 B0+ NORMAL *ARF* WRITE
  4772. RJ WAI WRITE AFTER IMAGE TO *ARF*
  4773. LAI4 SX6 B0+
  4774. PUTFLD 6,B2,TSAI CLEAR WAIT FOR *ARF* FLAG
  4775. EQ LAIX RETURN
  4776. SPACE 4,10
  4777. ** LBI - LOG BEFORE IMAGE RECORD.
  4778. *
  4779. * ENTRY (X0) = FWA OF *FIT*.
  4780. * (B2) = FWA OF *TSEQ*.
  4781. * (B3) = FWA OF *TLNT*.
  4782. * (B4) = FWA OF *TFCB*.
  4783. * (RCOD) = REQUEST CODE.
  4784. *
  4785. * EXIT RETURN TO CALLER -
  4786. * IF BEFORE IMAGE LOGGED OR BRF DOWN OR CRM ERROR.
  4787. * (X6) = *TERI*, IF FATAL ERROR ON FILE.
  4788. * TO *CAR7* IF *BRF* IS BUSY.
  4789. * (X6) = ZERO.
  4790. *
  4791. * USES X - 1, 2, 3, 4, 5, 6, 7.
  4792. * A - 1, 2, 4, 5, 6, 7.
  4793. * B - 5, 6, 7.
  4794. *
  4795. * MACROS FETCH, GET, GETFLD, PUTFLD.
  4796. *
  4797. * CALLS CCS, CTW, CQB, KSR, PBH.
  4798.  
  4799.  
  4800. LBI3 SX6 B0+ NO ERROR
  4801.  
  4802. LBI SUBR ENTRY/EXIT
  4803. SA1 B3+TLRFW RECOVERABLE FILE FLAG FROM *TLNT*
  4804. SA2 B4+TFBFW *DBFREE* PROCESS FLAG FROM *TFCB*
  4805. LX1 59-TLRFS
  4806. PL X1,LBI3 IF FILE NOT RECOVERABLE TYPE - RETURN
  4807. LX2 59-TFBFS
  4808. NG X2,LBI3 IF INTERNAL *DBFREE* PROCESSING - RETURN
  4809.  
  4810. * IF *BRF* IS BUSY CONTROL IS PASSED TO *CAR7*.
  4811.  
  4812. RJ CQB CHECK IF *BRF* BUSY OR ERROR
  4813. NZ X6,LBI3 IF *BRF* DOWN
  4814. ZR B5,CAR7 IF *TBRF* IS BUSY
  4815. SB7 B0+ (FOR *KSR*)
  4816. RJ KSR USE *KSR* TO FIND *TKOK* ENTRY
  4817. SB6 B5 FWA OF *TKOK* ENTRY FOR RECORD
  4818. GETFLD 1,B2,TSQF GET FWA OF ASSIGNED *TBRF* FROM *TSEQ*
  4819. SB5 X1 FWA OF *TBRF* ENTRY
  4820. AX5 1 (*KSR* SET X5 = 1 IF FL, = 2 IF RL)
  4821. ZR X5,LBI1 IF NO LOCK, FILE LOCKED, LOG BEFORE IMAGE
  4822. SA2 B6+TKQRW ONCE RECORDED FLAG FORM *TKOK*
  4823. LX2 59-TKQRS
  4824. MX6 -TKQRN
  4825. NG X2,LBI3 IF BI RECORDED EARLIER AND RECORD LOCK
  4826. SA2 A2
  4827. LX6 TKQRS-TKQRN+1
  4828. BX6 -X6+X2 SET RECORDED ONCE FLAG
  4829. SA6 A2 STORE BEFORE IMAGE RECORDED ONCE FLAG
  4830.  
  4831. * PREPARE THE BEFORE IMAGE RECORD HEADER.
  4832.  
  4833. LBI1 SA5 RCOD REQUEST CODE
  4834. RJ PBH PREPARE BEFORE IMAGE RECORD HEADER
  4835. GETFLD 1,B3,TLKL PRIMARY KEY LENGTH IN CHARACTERS
  4836. BX7 X1
  4837. RJ CTW CONVERT KEY SIZE TO WORDS
  4838. SA4 B5+TQFTW FWA OF *BRF* BUFFER
  4839. SX4 X4+XQKAW FWA OF BEFORE IMAGE RECORD KEY AREA
  4840. BX6 X1 NUMBER OF WORDS REQUIRED FOR KEY AREA
  4841. SA6 X4+ SAVE NUMBER OF KEY WORDS IN KEY AREA
  4842. IX4 X4+X1 FWA OF BEFORE IMAGE RECORD RECORD AREA
  4843. SA1 RCOD REQUEST CODE
  4844. SX1 X1-TRWR
  4845. ZR X1,LBI2 IF REQUEST IS *WRITE*, NO RECORD DATA
  4846.  
  4847. * THE REQUEST IS *REWRITE* OR *DELETE*,
  4848. * GET BEFORE IMAGE OF RECORD INTO *BRF* BUFFER.
  4849.  
  4850. SX3 B4+TFKYW GET FWA OF KEY FROM *TFCB*
  4851. GET X0,X4,0,,X3 GET BEFORE IMAGE OF RECORD
  4852. RJ CCS CHECK STATUS
  4853. NZ X6,LBIX IF *CRM* ERROR
  4854. FETCH X0,RL,X5 GET BEFORE IMAGE RECORD LENGTH
  4855. GETFLD 1,B2,TSQF FWA OF ASSIGNED *TBRF*
  4856. LX5 XQRSS-XQRSN+1
  4857. GETFLD 1,X1,TQFT GET FWA OF *BRF* BUFFER FROM *TBRF*
  4858. SA1 X1+XQRSW GET RECORD HEADER WORD 3
  4859. BX6 X5+X1
  4860. SA6 A1 STORE RECORD LENGTH IN RECORD HEADER
  4861.  
  4862. * THE BEFORE IMAGE RECORD IS RECORDED, THE ACTUAL
  4863. * WRITE TO *BRF* WILL OCCUR AFTER THE FILE IS CHANGED.
  4864.  
  4865. LBI2 GETFLD 2,B2,TSQF GET FWA OF *TBRF* FROM *TSEQ*
  4866. SB5 X2 RESTORE FWA OF *TBRF*
  4867. SX3 B2 FWA OF *TSEQ*
  4868. PUTFLD 3,B5,TQSQ RESERVE *TBRF* FOR THIS TASK
  4869. SA2 B5+TQBIW GET BEFORE IMAGE WRITE PENDING WORD
  4870. MX7 -TQBIN
  4871. LX7 TQBIS-TQBIN+1
  4872. BX7 -X7+X2 SET BEFORE IMAGE WRITE PENDING FLAG
  4873. SA7 A2 REPLACE *TBRF* WORD WITH *TQBI* FLAG SET
  4874. EQ LBI3 RETURN - NO ERROR, NOT BUSY
  4875.  
  4876. SPACE 4,10
  4877. ** LBJ - AFTER IMAGE RECOVERY FILE BATCH JOB.
  4878. *
  4879. * ENTRY (B5) = FWA OF *TARF* FOR ACTIVE *ARF*.
  4880. * (RDRF) = FWA OF *TDRF* FOR CURRENT DATA BASE.
  4881. *
  4882. * USES X - 1, 2, 5, 6, 7.
  4883. * A - 1, 2, 5.
  4884. *
  4885. * MACROS GETFLD.
  4886. *
  4887. * CALLS SBJ.
  4888.  
  4889.  
  4890. LBJ SUBR ENTRY/EXIT
  4891. SA2 RDRF FWA OF DATA BASE *TDRF* ENTRY
  4892. SA1 X2+TDSDW DATA BASE STATUS
  4893. PL X1,LBJ1 IF DATA BASE NOT DOWN
  4894. GETFLD 5,X2,TDQD FWA OF *TBRF* DOWN FOR RECOVERY
  4895. SX6 B1+B1 OPTION 2, DUMP *ARF* AND RECOVER *BRF*
  4896. NZ X5,LBJ2 IF NO *TBRF* TO RECOVER
  4897. LBJ1 GETFLD 5,X2,TDLD FWA OF *TLNT* DOWN FOR RECOVERY
  4898. SX6 B0 OPTION 0, DUMP *ARF* AND RECOVER DB FILE
  4899. NZ X5,LBJ2 IF *TLNT* DOWN FOR RECOVERY
  4900. SX6 B1+ OPTION 1, DUMP *ARF* ONLY
  4901. LBJ2 RJ SBJ BUILD AND SUBMIT BATCH JOB
  4902. EQ LBJX RETURN
  4903. SPACE 4,10
  4904. ** LBK - LOG BEFORE IMAGE RECORD KEYS.
  4905. *
  4906. * NOTE - CALL TO *EAK* IS REQUIRED FOR BOTH
  4907. * RECOVERABLE AND NON-RECOVERABLE FILES TYPES.
  4908. *
  4909. * ENTRY (B2) = FWA OF *TSEQ*.
  4910. * (B3) = FWA OF *TLNT*.
  4911. * (B4) = FWA OF *TFCB*.
  4912. * (X0) = FWA OF *FIT*.
  4913. * (X6) = NON-ZERO IF *CRM* ERROR.
  4914. * FIRST WORD OF BEFORE IMAGE RECORD KEY AREA
  4915. * CONTAINS NUMBER OF WORDS REQUIRED FOR KEYS,
  4916. * (SET BY *LBI*).
  4917. *
  4918. * EXIT FOR RECOVERABLE FILE TYPES -
  4919. * IF (X6) IS NON-ZERO ON ENTRY THE BEFORE IMAGE
  4920. * WRITE PENDING FLAG IS CLEARED, AND (X6) IS NOT
  4921. * CHANGED.
  4922. *
  4923. * IF (X6) IS ZERO ON ENTRY THE KEYS ARE MOVED
  4924. * INTO THE BEFORE IMAGE RECORD KEY AREA.
  4925. *
  4926. * USES X - 1, 2, 3, 6, 7.
  4927. * A - 1, 2, 3, 7.
  4928. * B - 5.
  4929. *
  4930. * MACROS GETFLD.
  4931. *
  4932. * CALLS EAK, MVD, WBI.
  4933.  
  4934.  
  4935. LBK5 NZ X6,LBKX IF CRM ERROR
  4936. RJ EAK DO AK EMBEDDED KEY PROCESS IF AK/EMK
  4937.  
  4938. LBK SUBR ENTRY/EXIT
  4939. SA1 B3+TLRFW RECOVERABLE FILE FLAG FROM *TLNT*
  4940. SA2 B2+TSQFW FWA OF ASSIGNED *TBRF* FROM *TSEQ*
  4941. LX1 59-TLRFS
  4942. PL X1,LBK5 IF NOT RECOVERABLE FILE
  4943. LX2 TSQFN-1-TSQFS
  4944. SB5 X2 FWA OF *TBRF*
  4945. SA1 B5+TQBIW BEFORE IMAGE WRITE PENDING FLAG IN *TBRF*
  4946. LX1 59-TQBIS
  4947. PL X1,LBK3 IF NO BEFORE IMAGE WRITE PENDING
  4948. NZ X6,LBK2 IF *CRM* ERROR
  4949. RJ EAK DO AK EMBEDDED KEY PROCESS IF AK/EMK
  4950. SA1 B2+TSQFW FWA OF *TBRF* ENTRY
  4951. LX1 TSQFN-1-TSQFS RIGHT JUSTIFY
  4952. SB5 X1 FWA OF *TBRF*
  4953. GETFLD 3,B5,TQFT FWA OF *BRF* BUFFER FROM *TBRF* FET
  4954. SX3 X3+XQKAW FIRST WORD ADDRESS OF KEY AREA
  4955. SX6 B0
  4956. SA1 B5+TQSTW
  4957. NG X1,LBK2 IF *BRF* DOWN
  4958. SX2 B4+TFKYW FWA OF KEYS IN *TFCB*
  4959. SA1 X3+ NUMBER OF WORDS TO MOVE
  4960. RJ MVD MOVE KEYS INTO KEY-AREA OF BEFORE IMAGE
  4961. RJ WBI WRITE BEFORE IMAGE RECORD TO *BRF*
  4962. SX6 B0+ RESTORE (X6) TO NO *CRM* ERROR
  4963. LBK1 SA1 B5+TQSQW
  4964. MX7 -TQSQN
  4965. LX7 TQSQS-TQSQN+1
  4966. BX7 X7*X1 CLEAR RESERVE ON *TBRF*
  4967. SA7 A1
  4968. EQ LBKX RETURN
  4969.  
  4970. * *CRM* ERROR ON UPDATE, RELEASE BEFORE IMAGE.
  4971.  
  4972. LBK2 SA1 A1 *TQBI* WORD
  4973. MX7 -TQBIN
  4974. LX7 TQBIS-TQBIN+1
  4975. BX7 X7*X1 CLEAR BEFORE IMAGE PENDING FLAG
  4976. SA7 A1+
  4977. EQ LBK1 CLEAR *TBRF* RESERVE, RETURN *CRM* ERROR
  4978.  
  4979. LBK3 ZR X6,LBKX IF NO *CRM* ERROR
  4980. SA1 B4+TFBFW
  4981. LX1 59-TFBFS FREE PROCESS ACTIVE FLAG
  4982. PL X1,LBKX IF NOT FREE PROCESSING
  4983. SA2 B3+TLICW CHECK FOR INCONSISTENT FILE
  4984. LX2 59-TLICS
  4985. PL X2,LBK3.1 IF FILE IS NOT INCONSISTENT
  4986. SX6 B0+
  4987. EQ LBK4 CLEAR ERROR
  4988.  
  4989.  
  4990. * IF FATAL *CRM* ERROR OCCURS WHILE FREEING,
  4991. * SAVE *CRM* ERROR CODE, CLEAR X6, AND
  4992. * CONTINUE SO THAT ROLL-BACK IMAGES ARE
  4993. * LOGGED ON THE AFTER IMAGE FILE.
  4994. * IF NON-FATAL ERROR OCCURS ON SECOND ATTEMPT
  4995. * TO APPLY ROLLBACK UPDATE, GIVE UP AND
  4996. * PROCESS AS FATAL ERROR.
  4997. * IF NON-FATAL ERROR OCCURS ON FIRST ATTEMPT
  4998. * TO APPLY ROLLBACK UPDATE, RETURN TO *WDC*
  4999. * OR *WRD* WITH (X6) NONE ZERO SO THAT
  5000. * AFTER IMAGE IS NOT RECORDED AND *FRE* HAS
  5001. * A CHANCE TO RETRY THE ROLLBACK IF NECESSARY.
  5002.  
  5003. LBK3.1 SA1 B2+TSRFW GET SECOND ATTEMPT FLAG
  5004. SA2 RNFE NON-FATAL *CRM* ERROR FROM *CCS*
  5005. LX1 59-TSRFS
  5006. NG X1,LBK4 IF SECOND ATTEMPT TO ROLLBACK UPDATE
  5007. SX1 X2-445B (KEY NOT FOUND ERROR CODE)
  5008. ZR X1,LBKX IF KEY NOT FOUND RETURN WITH ERROR
  5009. SX1 X2-446B (DUPLICATE KEY ERROR CODE)
  5010. ZR X1,LBKX IF KEY ALREADY EXISTS RETURN ERROR
  5011.  
  5012. LBK4 PUTFLD 6,B2,TSER SAVE *CRM* ERROR
  5013. SX6 B0+ CLEAR ERROR FOR FREEING
  5014. EQ LBKX RETURN
  5015. LDE SPACE 4,10
  5016. ** LDE - LINK DELETE.
  5017. *
  5018. * ENTRY (X5) = 24/,18/LAST,18/NEXT
  5019. * LAST - FWA OF LINK WORD IN LAST ENTRY.
  5020. * NEXT - FWA OF LINK WORD IN NEXT ENTRY.
  5021. *
  5022. * EXIT (X5) = (X5) ON ENTRY.
  5023. *
  5024. * USES X - 0, 1, 2, 3, 5, 6.
  5025. * A - 3, 6.
  5026.  
  5027.  
  5028. LDE SUBR ENTRY/EXIT
  5029. MX0 42
  5030. SX1 X5 FWA OF NEXT LINK
  5031. LX5 17-35 FWA OF LAST LINK
  5032. SX2 X5
  5033. ZR X1,LDE1 IF NO NEXT LINK
  5034.  
  5035. * UPDATE LINKAGE IN NEXT ENTRY.
  5036.  
  5037. SA3 X1 NEXT ENTRY
  5038. LX3 17-35 RIGHT JUSTIFY LAST LINK
  5039. BX6 X0*X3 CLEAR OLD LAST LINK
  5040. BX6 X6+X2 SET NEW LAST LINK
  5041. LX6 35-17
  5042. SA6 A3
  5043.  
  5044. * UPDATE LINKAGE IN LAST ENTRY.
  5045.  
  5046. LDE1 SA3 X2 LAST ENTRY
  5047. BX3 X0*X3
  5048. BX6 X3+X1 NEW NEXT LINK
  5049. SA6 A3
  5050. LX5 35-17
  5051. EQ LDEX RETURN
  5052. LDN SPACE 4,10
  5053. ** LDN - DOWN AFTER IMAGE RECOVERY FILE.
  5054. *
  5055. * ENTRY (B5) = FWA OF *TARF* ENTRY.
  5056. * (RDRF) = FWA OF DATA BASE *TDRF* ENTRY.
  5057. *
  5058. * USES X - 1, 2, 6, 7.
  5059. * A - 1, 2, 7.
  5060. *
  5061. * CALLS IDB, NMS.
  5062.  
  5063.  
  5064. LDN SUBR ENTRY/EXIT
  5065. SA1 MSGB RECOVERY FILE DOWN MESSAGE
  5066. SA2 B5+TAFNW *ARF* FILE NAME
  5067. MX7 TAFNN FILE NAME MASK
  5068. RJ NMS REPORT *ARF* DOWN
  5069. MX7 -TADNN
  5070. LX7 TADNS-TADNN+1
  5071. SA1 B5+TADNW
  5072. BX7 -X7+X1 SET *ARF* DOWN FLAG
  5073. SA7 A1 STORE FLAG
  5074. RJ IDB IDLE DATA BASE
  5075. MX7 -TDRLN
  5076. LX7 TDRLS-TDRLN+1
  5077. SA1 RDRF FWA OF DATA BASE *TDRF* ENTRY
  5078. SA1 X1+TDRLW
  5079. BX7 -X7+X1 SET DOWN FOR *ARF* RECOVERY
  5080. SA7 A1 STORE FLAG
  5081. EQ LDNX RETURN
  5082. LIN SPACE 4,15
  5083. ** LIN - LINK INSERT.
  5084. *
  5085. * ENTRY (X4) = 42/,18/NEXT
  5086. * NEXT - FWA OF NEXT LINK WORD IN ENTRY.
  5087. * (A4) = FWA OF LINK WORD IN LAST ENTRY.
  5088. * (X5) = LINK WORD OF NEW ENTRY.
  5089. * (A5) = FWA OF LINK WORD IN NEW ENTRY.
  5090. *
  5091. * EXIT LINKAGE IS UPDATED FOR INSERTED ENTRY.
  5092. *
  5093. * USES X - 0, 2, 4, 6, 7.
  5094. * A - 2, 6.
  5095.  
  5096.  
  5097. * INITIALIZE POINTER TO FIRST NEXT ENTRY.
  5098.  
  5099. LIN1 MX0 42
  5100. SX6 A5
  5101. BX4 X0*X4
  5102. BX6 X4+X6
  5103. SA6 A4
  5104.  
  5105. LIN SUBR ENTRY/EXIT
  5106. MX0 24
  5107. SX7 X4 FWA OF NEXT LINK
  5108. SX2 A4 FWA OF LAST LINK
  5109.  
  5110. * INSERT NEXT ENTRY.
  5111.  
  5112. BX6 X0*X5 CLEAR OLD LAST AND NEXT POINTERS
  5113. LX2 35-17
  5114. BX6 X6+X7 NEXT LINK
  5115. BX6 X6+X2 LAST LINK
  5116. SA6 A5
  5117.  
  5118. * UPDATE LAST LINKAGE.
  5119.  
  5120. ZR X7,LIN1 IF NO OLD NEXT ENTRY
  5121. SX6 A5 FWA OF LAST LINK
  5122. SA2 X7
  5123. MX0 42
  5124. LX2 17-35
  5125. BX2 X0*X2 CLEAR OLD LAST LINK
  5126. BX6 X2+X6 NEW LAST LINK
  5127. LX6 35-17
  5128. SA6 A2
  5129. EQ LIN1 INITIALIZE POINTER TO FIRST ENTRY
  5130. LOK SPACE 4,25
  5131. ** LOK - LOCK A RECORD OR A FILE.
  5132. *
  5133. * ENTRY (B7) = 1, IF FILE LOCK REQUEST.
  5134. * = 0, IF RECORD LOCK REQUEST.
  5135. * (B3) = FWA OF LOGICAL NAME ENTRY.
  5136. * (B4) = FWA OF FILE CONTROL ENTRY.
  5137. *
  5138. * EXIT (X6) = 0, IF NO ERRORS.
  5139. * *TERC*, IF ANOTHER USER HAS FILE LOCKED.
  5140. * *TERD*, IF ANOTHER USER HAS RECORD LOCKED.
  5141. * *TERE*, IF RECORD ALREADY LOCKED BY USER.
  5142. * *TERF*, IF FILE ALREADY LOCKED BY USER.
  5143. * *TERH*, IF NO TABLE SPACE FOR LOCK.
  5144. * *TERM*, IF TRANSACTION HAS ALL LOCKS.
  5145. * (B5) = FWA OF ASSIGNED *TKOK* ENTRY.
  5146. *
  5147. * USES X - ALL.
  5148. * A - 1, 2, 4, 5, 6, 7.
  5149. * B - 5, 6, 7.
  5150. *
  5151. * CALLS CTW, KSR, LIN, MVE=, RAL.
  5152. *
  5153. * MACROS FETCH.
  5154.  
  5155.  
  5156. LOK SUBR ENTRY/EXIT
  5157. RJ KSR KEY SEARCH FOR REQUESTED LOCK
  5158. NZ X5,LOK2 IF FILE/RECORD ALREADY LOCKED
  5159.  
  5160. * ALLOCATE A LOCK ENTRY.
  5161.  
  5162. SA1 B3+TLNKW NEXT FREE LOCK LINK
  5163. SB5 X1-TKNFW FWA OF LOCK ENTRY
  5164. SA4 B3+TLRLW UPDATE LOCKS ATTEMPTED
  5165. SX5 B1
  5166. IX7 X5+X4
  5167. SA7 A4+
  5168. ZR X1,LOK4 IF NO FREE LOCK ENTRIES
  5169. SA2 X1 UPDATE FREE LOCK CHAIN
  5170. MX0 60-TLNKN
  5171. SX6 X2+
  5172. BX5 X0*X1
  5173. BX6 X6+X5
  5174. SA6 A1
  5175.  
  5176. * FORMAT NEW LOCK ENTRY.
  5177.  
  5178. SA5 B5+TKNTW
  5179. MX0 TSSQN
  5180. SA4 B2+TSSQW LINK FOR TRANSACTION LOCKS
  5181. BX5 X0*X4
  5182. RJ LIN INSERT LOCK INTO TRANSACTION-S CHAIN
  5183. SA5 B5+TKNFW
  5184. SA4 B3+TLNLW
  5185. SX5 B7 FILE LOCK FLAG
  5186. LX5 TKFKS-0
  5187. SX7 B3 FWA OF LOGICAL NAME TABLE
  5188. LX7 TKLNS-17
  5189. BX5 X7+X5
  5190. RJ LIN INSERT LOCK INTO CHAIN FOR FILE
  5191. BX6 X6-X6 NO ERRORS
  5192. NZ B7,LOKX IF FILE LOCK REQUESTED RETURN
  5193. SA5 B3+TLKLW GET PRIMARY KEY LENGTH IN CHARACTERS
  5194. MX7 -TLKLN
  5195. LX5 TLKLN-TLKLS-1
  5196. BX7 -X7*X5
  5197. RJ CTW CONVERT CHARACTERS TO WORDS
  5198. SX2 B4+TFKYW ORIGIN FWA
  5199. SX3 B5+TKKYW DESTINATION FWA
  5200. TJ MVE= MOVE KEY TO LOCK ENTRY
  5201. BX6 X6-X6 NO ERRORS
  5202. EQ LOKX RETURN
  5203.  
  5204. * CHECK IF LOCK HELD BY USER.
  5205.  
  5206. LOK2 SA1 B5+TKSQW TRANSACTION OWNING LOCK
  5207. SA2 B2+TSSQW TRANSACTION REQUESTING LOCK
  5208. MX0 TKSQN
  5209. BX1 X0*X1 TRANSACTION SEQUENCE NUMBER
  5210. BX2 X0*X2
  5211. IX1 X2-X1
  5212. BX6 X6-X6
  5213. ZR X1,LOKX IF LOCK HELD BY USER
  5214.  
  5215. * TO PREVENT DEADLOCKS FROM RECORD/FILE LOCKS,
  5216. * RELEASE ALL LOCKS WHEN A LOCK CANNOT BE GRANTED
  5217. * BECAUSE ANOTHER USER HAS DESIRED LOCK.
  5218.  
  5219. LOK3 SB6 X5 SAVE LOCK REASON
  5220. SA1 B2+TSQFW FWA OF ASSIGNED *TBRF*
  5221. LX1 TSQFN-1-TSQFS RIGHT JUSTIFY
  5222. SX1 X1
  5223. NZ X1,LOK7 IF RECOVERY FILES ASSIGNED
  5224. SB7 B0 RELEASE ALL LOCKS
  5225. RJ RAL RELEASE ALL LOCKS FOR TRANSACTION
  5226. SX6 TERC ANOTHER TRANSACTION HAS FILE LOCKED
  5227. SB6 B6-1
  5228. ZR B6,LOKX IF FILE LOCKED - RETURN
  5229. SX6 TERD ANOTHER TRANSACTION HAS RECORD LOCKED
  5230. EQ LOKX RETURN
  5231.  
  5232. * CHECK IF TRANSACTION HAS ALL LOCKS FOR FILE.
  5233.  
  5234. LOK4 SX6 TERH NO TABLE SPACE FOR LOCK ERROR
  5235. SA4 B3+TLWLW UPDATE LOCK REJECTS
  5236. IX7 X4+X5
  5237. SA7 A4
  5238. SA2 B2+TSSQW TRANSACTION REQUESTING LOCK
  5239. MX0 TKSQN MASK FOR TRANSACTION
  5240. BX4 X0*X2
  5241. SA1 B3+TLNLW FWA OF USED LOCK ENTRIES
  5242. SB5 X1-TKNFW
  5243. LOK5 SA2 B5+ LOCK ENTRY
  5244. BX5 X0*X2 TRANSACTION OWNING LOCK ENTRY
  5245. BX7 X5-X4
  5246. NZ X7,LOK6 IF TRANSACTION DOES NOT OWN LOCK
  5247. SB5 X2+ FWA OF NEXT LOCK ENTRY
  5248. NZ B5,LOK5 IF MORE LOCK ENTRIES
  5249. SX6 TERM TRANSACTION OWNS ALL LOCK ENTRIES
  5250. LOK6 SA6 RERR SAVE ERROR CODE
  5251.  
  5252. * TO PREVENT DEADLOCKS WHEN NO TABLE SPACE IS
  5253. * AVAILABLE FOR A LOCK, RELEASE ALL LOCKS FOR A TRANSACTION.
  5254.  
  5255. SA1 B2+TSQFW FWA OF ASSIGNED *TBRF*
  5256. LX1 TSQFN-1-TSQFS RIGHT JUSTIFY
  5257. SX1 X1
  5258. NZ X1,LOKX IF RECOVERY FILES ASSIGNED
  5259. SB7 B0+ RELEASE ALL LOCKS
  5260. RJ RAL RELEASE ALL LOCKS FOR USER
  5261. SA1 RERR ERROR CODE
  5262. BX6 X1
  5263. EQ LOKX RETURN
  5264.  
  5265. * IF LOCK CANNOT BE GRANTED FOR RECOVERABLE TASK
  5266. * MODS MUST BE ROLLED BACK VIA FORCED *DBFREE*.
  5267.  
  5268. LOK7 SX6 TERC ANOTHER TASK HAS FILE LOCKED ERROR
  5269. SB6 B6-1
  5270. ZR B6,LOKX IF ANOTHER TASK HAS FILE LOCKED
  5271. SX6 TERD ANOTHER TASK HAS RECORD LOCKED ERROR
  5272. EQ LOKX RETURN
  5273. SPACE 4,15
  5274. * MWD - MOVE WORDS.
  5275. *
  5276. * ENTRY (B2) = FWA OF SOURCE.
  5277. * (B6) = LENGTH OF THR MOVE(CM WORDS).
  5278. * (B7) = FWA OF DESTINATION.
  5279. *
  5280. * EXIT (B2) = LWA+1 OF SOURCE FIELD.
  5281. * (B6) = 0.
  5282. * (B7) = LWA+1 OF DESTINATION.
  5283. *
  5284. * USES X - 1, 6.
  5285. * A - 1, 6.
  5286. * B - 2, 6, 7.
  5287.  
  5288.  
  5289. MWD SUBR
  5290. MWD1 SA1 B2
  5291. SB6 B6-B1
  5292. BX6 X1
  5293. SB2 B2+B1
  5294. SA6 B7
  5295. SB7 B7+B1
  5296. NZ B6,MWD1 IF NOT ENTIRE FIELD MOVED
  5297. EQ MWDX RETURN
  5298.  
  5299. MVD SPACE 4,15
  5300. ** MVD - MOVE DATA TO TASK.
  5301. *
  5302. * ENTRY (X1) = LENGTH TO MOVE IN WORDS.
  5303. * (X2) = ORIGIN FWA.
  5304. * (X3) = DESTINATION FWA.
  5305. * (X6) = NUMBER OF CHARACTERS OVER A WORD BOUNDARY.
  5306. *
  5307. * EXIT DATA IS MOVED TO TASK.
  5308. *
  5309. * USES X - 1, 2, 3, 4, 6, 7.
  5310. * A - 1, 2, 3, 4, 6, 7.
  5311. * B - 6.
  5312. *
  5313. * CALLS MVE=.
  5314.  
  5315.  
  5316. MVD SUBR ENTRY/EXIT
  5317. SA6 MVDA REMAINDER OF CHARACTERS OVER A WORD
  5318. NZ X6,MVD2 IF DATA DOES NOT END ON A WORD BOUNDARY
  5319. MVD1 TJ MVE= MOVE DATA TO TASK
  5320. SA1 MVDA
  5321. ZR X1,MVDX IF DATA ENDS ON WORD BOUNDARY
  5322.  
  5323. * RESTORE CHARACTERS IN LAST WORD.
  5324.  
  5325. SA2 MVDB LWA OF TASK BUFFER
  5326. SA1 MVDC OLD LAST WORD OF BUFFER
  5327. SA3 X2 NEW LAST WORD OF BUFFER
  5328. SA4 MVDA MASK FOR SAVING NEW CHARACTERS IN WORD
  5329. BX3 X4*X3 SAVE NEW CHARACTERS IN WORD
  5330. BX4 -X4*X1 SAVE OLD CHARACTERS IN WORD
  5331. BX7 X4+X3 MERGE NEW AND OLD WORDS
  5332. SA7 A3
  5333. EQ MVDX RETURN
  5334.  
  5335. * SAVE LAST WORD OF BUFFER.
  5336.  
  5337. MVD2 IX5 X3+X1
  5338. SA4 X5-1
  5339. SX7 6
  5340. IX7 X6*X7
  5341. SB6 X7-6 SHIFT TO FORM MASK TO SAVE CHARACTERS
  5342. SX7 A4 LWA OF BUFFER
  5343. BX6 X4
  5344. SA7 MVDB
  5345. SA6 MVDC
  5346. MX7 6 MASK TO SAVE NEW CHARACTERS IN BUFFER
  5347. AX7 B6
  5348. SA7 MVDA
  5349. EQ MVD1 MOVE DATA
  5350.  
  5351. MVDA BSS 1 MASK FOR SAVING NEW CHARACTERS
  5352. MVDB BSS 1 LWA OF TASK BUFFER
  5353. MVDC BSS 1 LAST WORD IN TASK BUFFER
  5354.  
  5355. MVK SPACE 4,15
  5356. ** MVK - MOVE KEY.
  5357. *
  5358. * ENTRY (B4) = FWA OF FILE CONTROL ENTRY.
  5359. * (X2) = FWA OF KEY RETURN AREA LENGTH
  5360. * (X3) = FWA OF KEY RETURN AREA
  5361. * (TADR) = ABSOLUTE ADDRESSES OF PARAMETERS.
  5362. *
  5363. * EXIT (X6) = 0, IF NO ERRORS.
  5364. * *TERO*, IF KEY AREA LENGTH TOO SMALL.
  5365. *
  5366. * USES X - 0, 1, 2, 3, 5, 6, 7.
  5367. * A - 1, 2, 3, 5.
  5368. *
  5369. * CALLS CTW, MVD.
  5370.  
  5371.  
  5372. MVK1 SX6 TERO KEY AREA LENGTH TOO SMALL ERROR
  5373.  
  5374. MVK SUBR ENTRY/EXIT
  5375.  
  5376. * IF KEY RETURN AREA WILL NOT HOLD KEY,
  5377. * RETURN ERROR CODE TO TASK.
  5378.  
  5379. SA1 RLNT GET PRIMARY KEY LENGTH IN CHARACTERS
  5380. SA5 X1+TLKLW
  5381. MX7 -TLKLN
  5382. LX5 TLKLN-TLKLS-1
  5383. BX7 -X7*X5
  5384. SA1 X2 TASK KEY RETURN AREA LENGTH IN CHARACTERS
  5385. IX1 X1-X7
  5386. NG X1,MVK1 IF KEY RETURN AREA TOO SMALL
  5387. RJ CTW CONVERT CHARACTERS TO WORDS
  5388. SA5 TADR+TPFL TASK FIELD LENGTH
  5389. SA2 TADR+TPRA TASK RA
  5390. IX7 X3+X1 LWA + 1 FOR KEY
  5391. IX5 X2+X5 LWA + 1 OF TASK
  5392. IX0 X5-X7
  5393. NG X0,MVK1 IF KEY WILL NOT FIT IN TASK FL
  5394.  
  5395. * MOVE KEY TO TASK.
  5396.  
  5397. SX2 B4+TFKYW FWA OF KEY
  5398. RJ MVD MOVE KEY TO TASK
  5399. BX6 X6-X6 NO ERRORS
  5400. EQ MVKX RETURN
  5401. MVR SPACE 4,15
  5402. ** MVR - MOVE RECORD.
  5403. *
  5404. * ENTRY (B4) = FWA OF FILE CONTROL ENTRY.
  5405. * (TADR) = ABSOLUTE ADDRESSES OF PARAMETERS.
  5406. *
  5407. * EXIT (X6) = 0, IF NO ERRORS.
  5408. * *TERN*, IF WORKING STORAGE TOO SMALL.
  5409. *
  5410. * USES X - 0, 1, 2, 3, 4, 6, 7.
  5411. * A - 1, 2, 3, 4, 7.
  5412. *
  5413. * CALLS CTW, MVD.
  5414. *
  5415. * MACROS FETCH.
  5416.  
  5417.  
  5418. MVR1 SX6 TERN WORKING STORAGE AREA TOO SMALL ERROR
  5419.  
  5420. MVR SUBR ENTRY/EXIT
  5421.  
  5422. * IF WORKING STORAGE WILL NOT HOLD RECORD,
  5423. * RETURN ERROR STATUS TO TASK.
  5424.  
  5425. SX0 B4+TFFTW FWA OF *FIT*
  5426. FETCH X0,RL,X7
  5427. SA2 TADR+TPWL FWA WORKING STORAGE LENGTH
  5428. SA4 TADR+TPRL FWA OF RECORD LENGTH
  5429. SA1 X2+ TASK RECORD LENGTH IN CHARACTERS
  5430. IX3 X1-X7
  5431. SA7 X4 RETURN RECORD LENGTH TO TASK
  5432. NG X3,MVR1 IF WORKING STORAGE TOO SMALL
  5433.  
  5434. * MOVE RECORD TO TASK.
  5435.  
  5436. RJ CTW CONVERT CHARACTERS TO WORDS
  5437. SA5 TADR+TPFL TASK FIELD LENGTH
  5438. SA3 TADR+TPWS FWA OF WORKING STORAGE
  5439. SA2 TADR+TPRA REQUEST RA
  5440. IX7 X3+X1 LWA+1 FOR RECORD
  5441. IX5 X2+X5 LWA +1 OF TASK
  5442. IX0 X5-X7
  5443. NG X0,MVR1 IF RECORD WILL NOT FIT IN TASK FL
  5444. SA2 VAMB FWA OF TRANSACTION BUFFER
  5445. SX2 X2
  5446. RJ MVD MOVE RECORD TO TASK
  5447. BX6 X6-X6 NO ERRORS
  5448. EQ MVRX RETURN
  5449.  
  5450. SPACE 4,10
  5451. ** PAH - PREPARE AFTER IMAGE HEADER.
  5452. *
  5453. * ENTRY (B2) = FWA OF *TSEQ*.
  5454. * (B3) = FWA OF *TLNT*.
  5455. * (B4) = FWA OF *TFCB*.
  5456. * (B5) = FWA OF *TARF*.
  5457. * (X5) = REQUEST CODE.
  5458. *
  5459. * EXIT TO CALLER.
  5460. * (X5) = REQUEST CODE.
  5461. *
  5462. * USES X - 1, 2, 3, 4, 6, 7.
  5463. * A - 1, 2, 3, 4, 6, 7.
  5464. * B - 7.
  5465. *
  5466. * MACROS GETFLD, PDATE.
  5467.  
  5468.  
  5469. PAH SUBR ENTRY/EXIT
  5470. GETFLD 1,B2,TSSQ TRANSACTION SEQUENCE NUMBER FROM *TSEQ*
  5471. LX1 XLSQS-XLSQN+1
  5472. GETFLD 2,B2,TSBW *DBEGIN* WRITE PENDING FLAG FROM *TSEQ*
  5473. LX2 XLBWS-XLBWN+1
  5474. BX3 X5 REQUEST CODE
  5475. SX4 X5-TRDC
  5476. BX6 X1+X2
  5477. NZ X4,PAH1 IF NOT *DBCOMIT* REQUEST
  5478. SX3 B0+ TYPE CODE FOR *DBCOMIT* REQUEST
  5479. PAH1 BX6 X6+X3 FORM RECORD HEADER WORD 0
  5480. SA1 B5+TAINW *ARF* BUFFER *IN* POINTER FROM *TARF* FET
  5481. SB7 X1 *IN*
  5482. SA6 B7 STORE RECORD HEADER WORD 0
  5483. SA1 B2+TSBPW PREVIOUS AND CURRENT *DBEGIN* ID CODES
  5484. BX6 X1
  5485. SA6 A6+B1 STORE RECORD HEADER WORD 1
  5486. SX1 A6+B1
  5487. PDATE X1 PACKED DATE/TIME INTO HEADER WORD 2
  5488. SX6 B0
  5489. SX7 B0
  5490. SA7 B7+XLRSW CLEAR RECORD AND KEY SIZE (WORD 3)
  5491. SA6 A7+B1 CLEAR WORD 4
  5492. SA7 A6+B1 CLEAR WORD 5
  5493. SA6 A7+B1 CLEAR WORD 6
  5494. SA7 A6+B1 CLEAR WORD 7
  5495. ZR X4,PAH4 IF *DBCOMIT* REQUEST
  5496. SX2 X5-TRDF
  5497. ZR X2,PAH4 IF *DBFREE* REQUEST
  5498. SX2 X5-DMCC
  5499. ZR X2,PAH4 IF DATA MANAGER *CEASE* REQUEST
  5500. GETFLD 1,B3,TLKL PRIMARY KEY LENGTH IN CHARACTERS
  5501. LX1 XLKSS-XLKSN+1
  5502. SX2 X5-TRDE
  5503. SA3 B2+TSQFW FWA OF ASSIGNED *TBRF*
  5504. ZR X2,PAH3 IF *DELETE* REQUEST NO RECORD LENGTH
  5505. SA2 B4+TFBFW INTERNAL DBFREE PROCESS FLAG
  5506. LX2 59-TFBFS
  5507. PL X2,PAH2 IF NOT DBFREE PROCESSING
  5508. LX3 TSQFN-1-TSQFS
  5509. SA3 X3+TQFTW FWA OF *BRF* BUFFER FROM *TBRF* FET
  5510. GETFLD 2,X3,XQRS RECORD SIZE FROM BI HEADER
  5511. EQ PAH3 CONTINUE HEADER BUILD
  5512.  
  5513. PAH2 SA2 TADR+TPWR FWA OF TASK RECORD LENGTH
  5514. SA2 X2+ RECORD LENGTH
  5515. PAH3 LX2 XLRSS-XLRSN+1
  5516. BX6 X1+X2 MERGE RECORD SIZE WITH KEY SIZE
  5517. SA6 B7+XLRSW STORE RECORD HEADER WORD 3
  5518. SA1 B3+TLFNW LOGICAL FILE NAME FROM *TLNT*
  5519. BX6 X1
  5520. SA6 A6+B1 STORE RECORD HEADER WORD 4
  5521. PAH4 SA4 B2+TSTNW TASK NAME FROM *TSEQ* ENTRY
  5522. BX6 X4 TASK NAME
  5523. SA6 B7+XLTNW STORE RECORD HEADER WORD 5
  5524. SX6 B7+TARHL LWA+1 OF HEADER
  5525. SA6 B5+TAINW UPDATE *IN* POINTER IN *TARF* FET
  5526. EQ PAHX RETURN
  5527.  
  5528. SPACE 4,10
  5529. ** PAQ - PREPARE AFTER IMAGE HEADER FOR DOWN *BRF*.
  5530. *
  5531. * ENTRY (B2) = FWA OF *TSEQ* ENTRY.
  5532. * (B5) = FWA OF *TARF* ENTRY.
  5533. *
  5534. * EXIT (X1) = POSITIVE, IF NO *BRF* DOWN STAMP WRITE.
  5535. * = NEGATIVE, IF *BRF* DOWN STAMP WRITE ACTIVE.
  5536. * (X6) = ZERO.
  5537. *
  5538. * USES X - 1, 2, 3, 4, 6, 7.
  5539. * A - 1, 2, 3, 4, 6, 7.
  5540. * B - 7.
  5541. *
  5542. * MACROS GETFLD.
  5543. *
  5544. * CALLS WAI.
  5545.  
  5546.  
  5547. PAQ SUBR ENTRY/EXIT
  5548. GETFLD 4,B2,TSQF FWA OF ASSIGNED *TBRF* ENTRY
  5549. SA1 X4+TQSTW GET *BRF* STATUS BITS
  5550. SX6 B0
  5551. PL X1,PAQX IF *BRF* IS NOT DOWN
  5552.  
  5553. * THE *BRF* IS DOWN, CHECK IF AFTER IMAGE STAMP
  5554. * FOR DOWN *BRF* HAS BEEN WRITTEN.
  5555.  
  5556. MX7 -TQDIN
  5557. LX7 TQDIS-TQDIN+1
  5558. BX2 -X7*X1
  5559. BX7 -X7+X1 SET DOWN IMAGE WRITTEN FLAG
  5560. SX1 B0+ (X1) POSITIVE IF ALREADY WRITTEN
  5561. NZ X2,PAQX IF *BRF* DOWN IMAGE WRITTEN
  5562. SA7 A1+ STORE FLAGS
  5563.  
  5564. * PREPARE AFTER IMAGE HEADER FOR DOWN *BRF*.
  5565.  
  5566. SX6 XLQD *BRF* DOWN TYPE CODE
  5567. GETFLD 1,B2,TSSQ TRANSACTION SEQUENCE NUMBER
  5568. LX1 XLSQS-XLSQN+1
  5569. BX6 X1+X6 FORM HEADER WORD 0
  5570. SA3 B5+TAINW ARF BUFFER *IN* POINTER
  5571. SA6 X3 STORE HEADER WORD 0
  5572. SA1 B2+TSBPW PREVIOUS AND CURRENT BEGIN ID
  5573. SA2 X4+TQDDW PACK DATE/TIME *BRF* DOWN
  5574. BX6 X1 BEGIN ID
  5575. BX7 X2 PACKED DATE
  5576. SA6 A6+B1 STORE HEADER WORD 1
  5577. SA7 A6+B1 STORE HEADER WORD 2
  5578. SX7 B0
  5579. SA7 A7+B1 CLEAR HEADER WORD 3
  5580. SA1 X4+TQFNW *BRF* NAME
  5581. BX6 X1
  5582. SA6 A7+B1 STORE HEADER WORD 4
  5583. SA1 B2+TSTNW TASK NAME FROM *TSEQ* ENTRY
  5584. BX7 X1
  5585. SA7 A6+B1 STORE HEADER WORD 5
  5586. SA7 A7+B1 CLEAR WORD 6
  5587. SX6 X3+TARHL INCREMENT *IN* BY HEADER LENGTH
  5588. SB7 B1 FORCE FLUSH FLAG
  5589. SA6 A3 STORE NEW ARF *IN* POINTER
  5590. RJ WAI WRITE AFTER IMAGE *BRF* DOWN STAMP
  5591. SX6 B0 IGNORE ANY ERROR
  5592. SX1 -B1 INDICATE *BRF* DOWN STAMP WRITE ACTIVE
  5593. EQ PAQX RETURN
  5594.  
  5595. SPACE 4,10
  5596. ** PBH - PREPARE BEFORE IMAGE RECORD HEADER.
  5597. *
  5598. * ENTRY (B5) = FWA OF *TBRF*.
  5599. * (B3) = FWA OF *TLNT* FOR WRITE, REWRITE, OR DELETE.
  5600. * (B2) = FWA OF *TSEQ*.
  5601. * (X5) = REQUEST CODE.
  5602. *
  5603. * EXIT TO CALLER.
  5604. * (X5) = REQUEST CODE.
  5605. *
  5606. * USES X - 1, 2, 3, 4, 6, 7.
  5607. * A - 1, 2, 3, 4, 6, 7.
  5608. * B - 7.
  5609. *
  5610. * MACROS GETFLD, PDATE.
  5611.  
  5612.  
  5613. PBH SUBR ENTRY/EXIT
  5614. GETFLD 1,B2,TSSQ TRANSACTION SEQUENCE NUMBER FROM *TSEQ*
  5615. LX1 XQSQS-XQSQN+1
  5616. GETFLD 2,B2,TSBR *DBEGIN* PROCESSED FLAG FROM *TSEQ*
  5617. LX2 XQBRS
  5618. BX6 X1+X2
  5619. SX3 X5-DMCC
  5620. ZR X3,PBH1 IF DATA MANAGER CEASE REQUEST
  5621. SX3 X5-TRTR
  5622. ZR X3,PBH1 IF *TRMREC* REQUEST, SAME AS CEASE
  5623. SX3 X5+ USES REQUEST CODE IN X5
  5624. PBH1 BX6 X6+X3 FORM RECORD HEADER WORD 0
  5625. SA1 B5+TQFTW FWA OF *BRF* BUFFER FROM *TBRF* FET
  5626. SB7 X1 *FIRST*
  5627. SA6 B7 STORE RECORD HEADER WORD 0
  5628. SA1 B2+TSBPW PREVIOUS AND CURRENT *DBEGIN* ID CODES
  5629. BX6 X1
  5630. SA6 A6+B1 STORE RECORD HEADER WORD 1
  5631. SX1 A6+B1
  5632. PDATE X1 DATE/TIME INTO RECORD HEADER WORD 2
  5633. SX6 B0
  5634. SX7 B0
  5635. SA6 B7+XQKSW CLEAR RECORD/KEY SIZE WORD 3
  5636. SA7 A6+B1 CLEAR WORD 4
  5637. SA6 A7+B1 CLEAR WORD 5
  5638. SA7 A6+B1 CLEAR WORD 6
  5639. SA6 A7+B1 CLEAR WORD 7
  5640.  
  5641. * CHECK IF HEADER IS FOR A *BRF* STAMP.
  5642.  
  5643. ZR X3,PBH2 IF *CEASE* OR *TRMREC* REQUEST
  5644. SX2 X5-TRDC
  5645. ZR X2,PBH2 IF *DBCOMIT* REQUEST
  5646. SX2 X5-TRDF
  5647. ZR X2,PBH2 IF *DBFREE* REQUEST
  5648.  
  5649. * HEADER IS NOT FREE, COMMIT, OR CEASE STAMP,
  5650. * FILL IN HEADER WORDS FOR BEFORE IMAGE.
  5651.  
  5652. GETFLD 1,B3,TLFL FILE LOCK FLAG FROM *TLNT*
  5653. GETFLD 2,B3,TLKL PRIMARY KEY LENGTH IN CHARACTERS
  5654. LX1 XQFLS-XQFLN+1
  5655. BX6 X1+X2 FORM HEADER WORD 3 WITHOUT RECORD SIZE
  5656. SA6 B7+XQKSW STORE RECORD HEADER WORD 3
  5657. SA1 B3+TLFNW LOGICAL FILE NAME FROM *TLNT*
  5658. BX6 X1
  5659. SA6 B7+XQFNW STORE RECORD HEADER WORD 4
  5660. PBH2 SA4 B2+TSTNW TASK NAME FROM *TSEQ* ENTRY
  5661. BX6 X4 TASK NAME
  5662. SA6 B7+XQTNW STORE RECORD HEADER WORD 5
  5663. SA4 B2+TSUNW PUT USER NAME IN *BRF*
  5664. BX6 X4
  5665. SA6 B7+XQUNW
  5666. SX6 B7+TQRHL LWA+1 OF HEADER
  5667. SA6 B5+TQINW UPDATE *IN* POINTER IN *TBRF* FET
  5668. EQ PBHX RETURN
  5669.  
  5670. SPACE 4,10
  5671. ** PFE - PREPARE FOR FREEING.
  5672. *
  5673. * ENTRY (B2) = FWA OF *TSEQ* ENTRY.
  5674. * (X6) = ERROR CODE, IF ANY.
  5675. * (RCOD) = REQUEST CODE.
  5676. * (REQT) = *TAF CRM* REQUEST.
  5677. * (RFCB) = CURRENT *TFCB* ENTRY.
  5678. *
  5679. * EXIT (X6) = AS SET ON ENTRY IF NO FREEING TO OCCUR.
  5680. * = ZERO, IF FREEING TO OCCUR.
  5681. *
  5682. * USES X - 1, 2, 4, 6, 7.
  5683. * A - 1, 2, 4, 6, 7.
  5684. * B - 7.
  5685. *
  5686. * MACROS GETFLD, PUTFLD.
  5687. *
  5688. * CALLS RAL.
  5689.  
  5690.  
  5691. PFE SUBR ENTRY/EXIT
  5692. SA1 B2+TSQFW FWA OF ASSIGNED *TBRF*
  5693. LX1 TSQFN-1-TSQFS RIGHT JUSTIFY ADDRESS
  5694. SX1 X1 FWA OF *TBRF* ENTRY
  5695. ZR X1,PFEX IF TASK NOT RECOVERABLE - EXIT
  5696.  
  5697. * RECOVERABLE TASK.
  5698.  
  5699. SA1 RCOD REQUEST CODE
  5700. SX2 X1-DMCC
  5701. ZR X2,PFE1 IF DATA MANAGER CEASE REQUEST
  5702. SX2 X1-TRTR
  5703. ZR X2,PFE1 IF *TRMREC* REQUEST, SAME AS CEASE
  5704. MX7 -TSBRN
  5705. LX7 TSBRS-TSBRN+1
  5706. SA1 B2+TSBRW DBEGIN ACTIVE FLAG WORD
  5707. BX7 X7*X1 CLEAR DBEGIN ACTIVE FLAG
  5708. SA7 A1 RESTORE FLAGS
  5709. GETFLD 2,B2,TSBI NUMBER OF BEFORE IMAGES RECORDED
  5710. ZR X2,PFE2 IF NO BEFORE IMAGES RECORDED FOR TASK
  5711.  
  5712. * PREPARE TO FREE UPDATES MADE BY TASK.
  5713.  
  5714. PFE1 PUTFLD 6,B2,TSER SAVE ERROR CODE
  5715. SA2 REQT *TAF CRM* REQUEST
  5716. BX7 X2
  5717. SA7 B2+TSRQW SAVE ORIGINAL REQUEST
  5718. SX2 FRE INITIAL CONTINUATION ADDRESS FOR FREEING
  5719. PUTFLD 2,B2,TSCP STORE CONTINUATION ADDRESS
  5720. SA4 RFCB FWA OF *TFCB* ENTRY
  5721. SX6 B0 CLEAR POSSIBLE ENTRY ERROR CODE
  5722. ZR X4,PFEX IF NO *TFCB* ENTRY
  5723. PUTFLD 6,X4,TFPA CLEAR PARAMETER ADDRESS IN *TFCB*
  5724. EQ PFEX RETURN
  5725.  
  5726. * TASK IS RECOVERABLE, HOWEVER -
  5727. * THE REQUEST IS NOT CEASE OR *TRMREC*,
  5728. * NO BEFORE IMAGES HAVE BEEN RECORDED.
  5729.  
  5730. PFE2 SA6 RERR SAVE ENTRY ERROR CODE
  5731. SX1 X1-.TRDBRL
  5732. SB7 B1 FOR RELEASE RECORD LOCKS
  5733. PL X1,PFE3 IF DATA BASE LEVEL REQUEST
  5734. SB7 B0 FOR RELEASE ALL LOCKS (RECORD AND FILE)
  5735. PFE3 RJ RAL RELEASE LOCKS
  5736. SA1 RERR ERROR CODE ON ENTRY
  5737. SX6 B0
  5738. SA6 A1
  5739. SX6 X1 RESTORE ENTRY ERROR CODE
  5740. EQ PFEX RETURN
  5741.  
  5742. SPACE 4,25
  5743. ** PPS - PACK PARAMETER STRING.
  5744. *
  5745. * THIS SUBROUTINE PACKS A SET OF PARAMETERS RESIDING IN
  5746. * CONTIGUOUS WORDS INTO A CHARACTER STRING. IF SPECIFIED
  5747. * BY THE CALLER, A DELIMITER WILL BE INSERTED BETWEEN
  5748. * EACH PARAMETER. THE TERMINATOR SPECIFIED BY THE
  5749. * CALLER WILL BE APPENDED TO THE LAST PARAMETER.
  5750. * BEFORE THE PARAMETERS ARE PACKED, 8 WORDS
  5751. * OF THE RECEIVING AREA ARE PADDED WITH BLANKS.
  5752. * UPON ENTRY, THE PARAMETERS MUST BE LEFT-JUSTIFIED IN A
  5753. * WORD, ZERO-FILLED.
  5754. *
  5755. * ENTRY (X1) = 1ST PARAMETER, LEFT-JUSTIFIED.
  5756. * (X2) = TERMINATOR, RIGHT-JUSTIFIED.
  5757. * (X3) = DELIMITER. RIGHT-JUSTIFIED (IF ANY).
  5758. * = ZERO, IF NO DELIMITER TO BE INSERTED.
  5759. * (A1) = FWA OF THE PARAMETER AREA.
  5760. * (B5) = NO. OF PARAMETER WORDS TO PROCESS.
  5761. * (PPSA) = FWA OF 8 WORD DESTINATION AREA.
  5762. *
  5763. * EXIT (A6) = ADRS. OF LAST WORD STORED IN DESTINATION AREA.
  5764. *
  5765. * USES X - 1, 2, 4, 6, 7.
  5766. * A - 1, 4, 6.
  5767. * B - 5, 6, 7.
  5768.  
  5769.  
  5770. PPS SUBR ENTRY/EXIT
  5771. SB6 8-1 COUNT 8 WORDS
  5772. SA4 PPSA DESTINATION ADDRESS
  5773. MX7 -6 RIGHT CHARACTER MASK
  5774. SB7 X4
  5775. SA4 A4+B1 BLANKS
  5776. BX6 X4
  5777. PPS1 SA6 B7+B6 BLANK FILL DESTINATION AREA
  5778. SB6 B6-B1
  5779. PL B6,PPS1 IF MORE WORDS
  5780. SX6 B0
  5781. SB6 10
  5782. SB5 B5-B1 DECREMENT WORD COUNT
  5783. PPS2 LX1 6 RIGHT JUSTIFY CHARACTER
  5784. BX4 -X7*X1
  5785. ZR X4,PPS3 IF NO CHARACTER
  5786. LX6 6
  5787. BX6 X6+X4 COPY CHARACTER
  5788. SB6 B6-B1 DECREMENT CHARACTER COUNT
  5789. BX1 X7*X1 CLEAR COPIED CHARACTER
  5790. NZ B6,PPS2 IF NOT 10 CHARACTERS
  5791. SA6 B7 STORE WORD
  5792. SB7 B7+B1 INCREMENT DESTINATION ADDRESS
  5793. SX6 0
  5794. SB6 10
  5795. EQ PPS2 CONTINUE PACKING
  5796.  
  5797. PPS3 ZR B5,PPS5 IF NO WORDS REMAIN
  5798. ZR X3,PPS4 IF NO DELIMITER TO BE INSERTED
  5799. LX6 6
  5800. BX6 X6+X3 ADD DELIMITER TO CHARACTER STRING
  5801. SB6 B6-1 DECREMENT CHARACTER COUNT
  5802. NZ B6,PPS4 IF NOT 10 CHARACTERS
  5803. SA6 B7 STORE WORD
  5804. SB7 B7+B1 INCREMENT DESTINATION ADDRESS
  5805. SX6 0
  5806. SB6 10
  5807. PPS4 SB5 B5-B1 DECREMENT WORD COUNT
  5808. SA1 A1+B1 GET NEXT WORD
  5809. EQ PPS2 PROCESS NEXT WORD
  5810.  
  5811. * ADD TERMINATOR TO CHARACTER STRING.
  5812.  
  5813. PPS5 LX6 6
  5814. BX6 X6+X2 ADD TERMINATOR TO CHARACTER STRING
  5815. SB6 B6-1 DECREMENT CHARACTER COUNT
  5816. SX2 1R BLANK FILL REMAINDER OF WORD
  5817. NZ B6,PPS5 IF NOT 10 CHARACTERS
  5818. PPS6 SA6 B7 STORE LAST WORD
  5819. EQ PPSX RETURN
  5820.  
  5821. PPSA BSS 1 FWA OF DESTINATION AREA
  5822. PPSB CON 10H
  5823. SPACE 4,10
  5824. ** QDN - DOWN BEFORE IMAGE RECOVERY FILE.
  5825. *
  5826. * ENTRY (B5) = FWA OF *TBRF*.
  5827. * (RDRF) = FWA OF DATA BASE *TDRF* ENTRY.
  5828. *
  5829. * USES X - 1, 2, 6, 7.
  5830. * A - 1, 2, 7.
  5831. * B - NONE.
  5832. *
  5833. * MACROS GETFLD, PDATE, PUTFLD.
  5834. *
  5835. * CALLS IDB, NMS.
  5836.  
  5837.  
  5838. QDN SUBR ENTRY/EXIT
  5839. SA1 MSGB *BRF* DOWN MESSAGE
  5840. SA2 B5+TQFNW *BRF* FILE NAME
  5841. MX7 TQFNN *BRF* NAME MASK
  5842. RJ NMS REPORT *BRF* DOWN
  5843. SA1 B5+TQSTW GET *BRF* DOWN FLAG FROM *TBRF*
  5844. MX7 -TQSTN
  5845. LX7 TQSTS-TQSTN+1
  5846. BX7 -X7+X1
  5847. SA7 A1 SET *BRF* DOWN FLAG IN *TBRF*
  5848. SX1 B5+TQDDW ADDRESS FOR *BRF* DOWN DATE/TIME
  5849. PDATE X1 PDATE FOR *BRF* DOWN STAMP
  5850. RJ IDB SET DATA BASE IDLE FLAG
  5851. SA2 RDRF FWA OF *TDRF* ENTRY
  5852. SA1 X2+TDRQW
  5853. MX7 -TDRQN
  5854. LX7 TDRQS-TDRQN+1
  5855. BX7 -X7+X1 SET DOWN FOR *BRF* RECOVERY
  5856. SA7 A1 STORE FLAG
  5857. GETFLD 1,X2,TDQD *TBRF* OF FIRST DOWN *BRF*
  5858. NZ X1,QDNX IF A *BRF* ALREADY DOWN
  5859. SX6 B5 FWA OF CURRENT DOWN *TBRF*
  5860. PUTFLD 6,X2,TDQD STORE FWA OF FIRST DOWN *TBRF*
  5861. EQ QDNX RETURN
  5862. RAF SPACE 4,15
  5863. ** RAF - RELEASE ALL FILES FOR TRANSACTION.
  5864. *
  5865. * ENTRY (B2) = FWA OF TRANSACTION SEQUENCE ENTRY.
  5866. * (RDRF) = FWA OF *TDRF* ENTRY.
  5867. *
  5868. * EXIT ALL FILES RELEASED FOR TRANSACTION.
  5869. *
  5870. * USES X - 1, 2, 3, 4, 5, 7.
  5871. * A - 1, 2, 3, 4, 5, 7.
  5872. * B - 4.
  5873. *
  5874. * MACROS GETFLD, PUTFLD.
  5875. *
  5876. * CALLS LDE, LIN.
  5877.  
  5878.  
  5879. RAF SUBR ENTRY/EXIT
  5880. RAF1 SA5 B2+TSNFW LINK FOR OPEN FILES FOR TRANSACTION
  5881. SB4 X5+
  5882. ZR B4,RAFX IF NO FILES FOR TRANSACTION - RETURN
  5883. SA5 B4+ LINK FOR TRANSACTION FILES
  5884. RJ LDE DELETE FILE LINK FOR TRANSACTION
  5885. SA5 B4-TFNTW+TFNFW LINK FOR OPEN FILES
  5886. RJ LDE DELETE FILE FROM OPEN CHAIN
  5887. SA3 B4-TFNTW+TFLNW FWA OF LOGICAL NAME ENTRY
  5888. LX3 17-TFLNS
  5889. SA4 X3+TLNFW LINK FOR FREE FILES
  5890. RJ LIN INSERT FILE INTO FREE CHAIN
  5891. SA5 RDRF FWA OF CURRENT *TDRF* ENTRY
  5892. GETFLD 2,X5,TDOP CURRENT OPEN FILE COUNT
  5893. SX1 B1
  5894. ZR X2,RAF1 IF OPEN FILE COUNT ZERO
  5895. IX2 X2-X1 DECREMENT OPEN FILE COUNT
  5896. PUTFLD 2,X5,TDOP
  5897. EQ RAF1 RELEASE NEXT FILE
  5898. RAL SPACE 4,20
  5899. ** RAL - RELEASE ALL LOCKS FOR A TRANSACTION.
  5900. *
  5901. * ENTRY (B2) = FWA OF TRANSACTION SEQUENCE ENTRY.
  5902. * (B7) = ZERO IF RELEASE ALL LOCKS FOR TRANSACTION.
  5903. * = NON-ZERO IF RELEASE ALL RECORD LOCKS
  5904. * FOR TRANSACTION.
  5905. *
  5906. * EXIT ALL LOCKS FOR TRANSACTION RELEASED.
  5907. *
  5908. * USES X - 3, 4, 5, 7.
  5909. * A - 3, 4, 5, 7.
  5910. * B - 5, 7.
  5911. *
  5912. * CALLS LDE, LIN.
  5913.  
  5914.  
  5915. RAL SUBR ENTRY/EXIT
  5916. RAL1 SA5 B2+TSNLW FWA OF NEXT LINK FOR TRANSACTION
  5917. RAL2 SB5 X5+
  5918. ZR B5,RALX IF NO LOCKS FOR TRANSACTION - RETURN
  5919. MX7 -TKQRN
  5920. LX7 TKQRS-TKQRN+1
  5921. SA3 B5+TKQRW BI ONCE RECORDED FLAG FROM *TKOK*
  5922. BX7 X7*X3 CLEAR FLAG
  5923. SA7 A3
  5924. SA5 B5+TKNTW LINK FOR TRANSACTION LOCKS
  5925. ZR B7,RAL3 IF ALL LOCKS TO BE RELEASED
  5926. SA3 B5+TKFKW FILE LOCK FLAG
  5927. NG X3,RAL2 IF FILE LOCKED
  5928. RAL3 RJ LDE DELETE LOCK FOR TRANSACTION
  5929. SA5 B5+TKNFW LINK FOR LOCKS FOR FILE
  5930. RJ LDE DELETE LOCK FROM USED LOCK CHAIN
  5931. SA3 B5+TKLNW FWA OF LOGICAL NAME ENTRY
  5932. LX3 17-TKLNS
  5933. SA4 X3+TLNKW LINK FOR FREE LOCKS FOR FILE
  5934. RJ LIN INSERT LOCK INTO FREE LOCK CHAIN
  5935. EQ RAL1 RELEASE NEXT LOCK
  5936. SPACE 4,10
  5937. ** RFI - RESTORE *FIT* FORCE WRITE INDICATOR.
  5938. *
  5939. * ALL *FIT* FWI*S CHANGED AT *DLX* ARE
  5940. * RESTORED TO THE ORIGINAL STATE OF OFF.
  5941. *
  5942. * ENTRY FIELD *AMFI* OF *AMI* STATUS WORD *AMST*
  5943. * IS SET TO NUMBER OF *FIT* FWI*S CHANGED BY *DLX*.
  5944. * FIELD *TDFI* OF EACH DATA BASE *TDRF* ENTRY
  5945. * IS SET TO NUMBER OF *FIT* FWI*S CHANGED BY *DLX*
  5946. * FOR THE DATA BASE.
  5947. *
  5948. * EXIT FIELD *AMFI* OF *AMI* STATUS WORD *AMST* = ZERO.
  5949. * FIELD *TDFI* OF EACH DATA BASE *TDRF* ENTRY = ZERO.
  5950. *
  5951. * USES X - 0, 1, 2, 3, 4, 5, 7.
  5952. * A - 0, 1, 2, 3, 4, 5, 7.
  5953. * B - 6, 7.
  5954. *
  5955. * MACROS GETFLD, PUTFLD, STORE.
  5956.  
  5957.  
  5958. RFI SUBR ENTRY/EXIT
  5959. SA1 AMST *AMI* STATUS WORD
  5960. LX1 AMFIN-1-AMFIS RIGHT JUSTIFY COUNT
  5961. SX1 X1 NUMBER OF *FIT* FWI*S CHANGED
  5962. ZR X1,RFIX IF NO *FIT* FWI*S CHANGED BY *DLX*
  5963. SA2 RDRT FWA OF FIRST *TDRF* ENTRY FOR *AMI*
  5964.  
  5965. * CHECK ALL DATA BASE *TDRF* ENTRIES.
  5966.  
  5967. RFI1 SB7 X2 FWA OF NEXT *TDRF* ENTRY FOR *AMI*
  5968. ZR B7,RFIX IF ALL *TDRF* ENTRIES PROCESSED
  5969. MX7 -TDFIN
  5970. SA2 B7+TDDLW FWA OF NEXT *TDRF* ENTRY FOR *AMI*
  5971. SA1 B7+TDFIW NUMBER OF *FIT* FWI CHANGED FOR DATA BASE
  5972. LX1 TDFIN-1-TDFIS RIGHT JUSTIFY COUNT
  5973. BX5 -X7*X1 NUMBER OF FWI*S CHANGED FOR DATA BASE
  5974. ZR X5,RFI1 IF NO FWI*S CHANGED FOR DATA BASE
  5975. SA3 B7+TDNLW FWA OF FIRST *TLNT* ENTRY FOR DATA BASE
  5976. LX3 TDNLN-1-TDNLS RIGHT JUSTIFY ADDRESS
  5977. EQ RFI3 CHECK IF RECOVERABLE FILE TYPE
  5978.  
  5979. * CHECK ALL DATA BASE *TLNT* ENTRIES.
  5980.  
  5981. RFI2 SA1 B7+TDLLW FWA OF LAST *TLNT* ENTRY FOR DATA BASE
  5982. LX1 TDLLN-1-TDLLS RIGHT JUSTIFY ADDRESS
  5983. BX1 X3-X1
  5984. SX1 X1+
  5985. ZR X1,RFI1 IF ALL *TLNT* FOR DATA BASE PROCESSED
  5986. SA3 X3+TLNTW FWA OF NEXT *TLNT* ENTRY
  5987. RFI3 SA1 X3+TLRFW RECOVERABLE FILE TYPE FLAG
  5988. LX1 59-TLRFS
  5989. PL X1,RFI2 IF NOT RECOVERABLE FILE TYPE
  5990. SA4 X3+TLNOW FWA OF FIRST OPEN FILE LINK (*TFCB*)
  5991.  
  5992. * CHECK ALL *TFCB* ENTRIES FOR FILE.
  5993.  
  5994. RFI4 SB6 X4+ FWA OF *TFCB* ENTRY FOR FILE
  5995. ZR B6,RFI2 IF NO MORE *TFCB* FOR FILE
  5996. SB6 B6-TFNFW FWA OF *TFCB* ENTRY
  5997. SA4 B6+TFNFW FWA OF NEXT *TFCB* ENTRY FOR FILE
  5998. SA1 B6+TFFIW FWI CHANGED FLAG
  5999. PL X1,RFI4 IF *FIT* FWI NOT CHANGED FOR THIS *TFCB*
  6000.  
  6001. * RESTORE *FIT* FWI TO ORIGINAL STATE OF OFF.
  6002.  
  6003. MX7 TFFIN
  6004. BX7 -X7*X1 CLEAR FLAG
  6005. SA7 A1 STORE CLEARED FLAG IN *TFCB*
  6006. SX0 B0 (OFF)
  6007. SA0 B6+TFFTW FWA OF *FIT*
  6008. STORE A0,FWI=X0,1,7,4 CLEAR FWI IN *FIT*
  6009. SX5 X5-1 DECREMENT DATA BASE COUNT OF CHANGED FWI*S
  6010. PUTFLD 5,B7,TDFI STORE NEW COUNT IN *TDRF*
  6011. SA1 AMST GET *AMI* COUNT FROM STATUS WORD
  6012. LX1 AMFIN-1-AMFIS RIGHT JUSTIFY COUNT
  6013. SX0 X1
  6014. SX0 X0-1 DECREMENT *AMI* COUNT OF CHANGED FWI*S
  6015. SA0 A1 FWA OF *AMST*
  6016. PUTFLD 0,A0,AMFI STORE NEW GLOBAL COUNT
  6017. SA4 B6+TFNFW FWA OF NEXT *TFCB* ENTRY FOR FILE
  6018. NZ X5,RFI4 IF MORE FWI*S TO RESTORE FOR DATA BASE
  6019. NZ X0,RFI1 IF MORE FWI*S TO RESTORE FOR *AMI*
  6020. EQ RFIX ALL *FIT* FWI*S RESTORED
  6021. RFN SPACE 4,10
  6022. ** RFN - RESET *FIT* FATAL STATUS TO ZERO.
  6023. *
  6024. * CLEAR *FIT* FIELDS *FNF* AND *ES*.
  6025. *
  6026. * ENTRY (X4) = LINK TO NEXT FREE *TFCB* ENTRY.
  6027. *
  6028. * USES X - 0, 1, 4, 7.
  6029. * A - 1, 4, 7.
  6030. *
  6031. * MACROS STORE.
  6032.  
  6033.  
  6034. RFN SUBR ENTRY/EXIT
  6035. RFN1 SX4 X4+ LINK ADDRESS (TFNF)
  6036. ZR X4,RFNX IF END OF LINK
  6037. SX0 X4-TFNFW+TFFTW FWA OF *FIT*
  6038. STORE X0,ES=0 CLEAR ERROR CODE
  6039.  
  6040. * NOTE - *FIT* FIELD *FNF* IS PROTECTED FROM STORE MACRO.
  6041. * *FNF* WORD AND BIT VALUE IS HARD CODE.
  6042.  
  6043. MX7 1 *FNF* BIT IS 59
  6044. SA1 X0+21B *FNF* WORD IS 21B
  6045. BX7 -X7*X1 CLEAR BIT 59
  6046. SA7 A1 STORE *FIT* WORD 21B WITH *FNF* ZERO
  6047. SA4 X4 LINK TO NEXT *TFCB* LINK
  6048. EQ RFN1 CHECK IF END OF CHAIN
  6049. RLS SPACE 4,20
  6050. ** RLS - RETURN LOCK STATUS FOR TRANSACTION.
  6051. * LOCK STATUS ON READ REQUESTS (WITHOUT LOCK) IS
  6052. * OPTIONAL PARAMETER.
  6053. *
  6054. * ENTRY (B2) = FWA OF TRANSACTION SEQUENCE ENTRY.
  6055. * (B3) = FWA OF LOGICAL NAME ENTRY.
  6056. * (B4) = FWA OF FILE CONTROL ENTRY.
  6057. * (X0) = ADDRESS TO RECIEVE RECORD LOCK STATUS.
  6058. *
  6059. * EXIT ((X0)) = *TERC*, IF ANOTHER USER HAS FILE LOCKED.
  6060. * *TERD*, IF ANOTHER USER HAS RECORD LOCKED.
  6061. * (X6) = 0.
  6062. *
  6063. * USES X - 1, 2, 5, 6.
  6064. * A - 1, 2, 6.
  6065. * B - 7.
  6066. *
  6067. * CALLS KSR.
  6068.  
  6069.  
  6070. RLS SUBR ENTRY/EXIT
  6071. SB7 B0+ NOT FILE LOCK REQUEST
  6072. RJ KSR
  6073. SX6 B0 NO ERROR
  6074. ZR X5,RLS1 IF NO LOCK FOR FILE OR RECORD
  6075. MX6 TKSQN
  6076. SA1 B5+TKSQW TRANSACTION OWNING LOCK
  6077. SA2 B2+TSSQW TRANSACTION INQUIRING ABOUT LOCK
  6078. BX1 X1-X2
  6079. BX6 X6*X1
  6080. ZR X6,RLS1 IF TRANSACTION INQUIRING OWNS LOCK
  6081. SX6 TERC ANOTHER HAS FILE LOCK ERROR
  6082. SX5 X5-1
  6083. ZR X5,RLS1 IF ANOTHER TRANSACTION HAS FILE LOCKED
  6084. SX6 TERD ANOTHER TRANSACTION HAS RECORD LOCK ERROR
  6085. RLS1 SA6 X0 SET LOCK STATUS TO TASK
  6086. SX6 B0
  6087. EQ RLSX RETURN
  6088. ROF SPACE 4,15
  6089. ** ROF - RELEASE ONE FILE.
  6090. *
  6091. * ENTRY (B3) = FWA OF LOGICAL NAME ENTRY.
  6092. * (B4) = FWA OF FILE CONTROL ENTRY.
  6093. * (RDRF) = FWA OF *TDRF* ENTRY.
  6094. *
  6095. * EXIT FILE IS RELEASED.
  6096. *
  6097. * USES X - 1, 2, 4, 5, 7.
  6098. * A - 1, 2, 4, 5, 7.
  6099. *
  6100. * MACROS GETFLD, PUTFLD.
  6101. *
  6102. * CALLS LDE, LIN.
  6103.  
  6104.  
  6105. ROF SUBR ENTRY/EXIT
  6106. SA5 B4+TFNTW LINK FOR FILES FOR TRANSACTION
  6107. RJ LDE DELETE FILE FOR TRANSACTION
  6108. SA5 B4+TFNFW LINK FOR OPEN FILES
  6109. RJ LDE DELETE FILE FROM OPEN CHAIN
  6110. SA4 B3+TLNFW LINK TO FREE FILES
  6111. RJ LIN INSERT FILE INTO FREE CHAIN
  6112. SA5 RDRF FWA OF CURRENT *TDRF* ENTRY
  6113. GETFLD 2,X5,TDOP CURRENT OPEN FILE COUNT
  6114. SX1 B1
  6115. ZR X2,ROFX IF OPEN FILE COUNT ZERO
  6116. IX2 X2-X1 DECREMENT OPEN FILE COUNT
  6117. PUTFLD 2,X5,TDOP
  6118. EQ ROFX RETURN
  6119. ROL SPACE 4,10
  6120. ** ROL - RELEASE ONE LOCK.
  6121. *
  6122. * ENTRY (B3) = FWA OF LOGICAL NAME ENTRY.
  6123. * (B5) = FWA OF LOCK ENTRY.
  6124. *
  6125. * EXIT LOCK ENTRY IS RELEASED.
  6126. *
  6127. * USES X - 4, 5.
  6128. * A - 4, 5.
  6129. *
  6130. * CALLS LDE, LIN.
  6131.  
  6132.  
  6133. ROL SUBR ENTRY/EXIT
  6134. SA5 B5+TKNTW LINK FOR LOCKS FOR TRANSACTION
  6135. RJ LDE DELETE LOCK FOR TRANSACTION
  6136. SA5 B5+TKNFW LINK FOR USED LOCKS FOR FILE
  6137. RJ LDE DELETE LOCK FROM USED CHAIN FOR FILE
  6138. SA4 B3+TLNKW LINK FOR FREE LOCKS FOR FILE
  6139. RJ LIN INSERT LOCK INTO FREE CHAIN FOR FILE
  6140. EQ ROLX RETURN
  6141. SPACE 4,10
  6142. ** RQF - RELEASE *TBRF* SEGMENT.
  6143. *
  6144. * ENTRY (B2) = FWA OF *TSEQ*.
  6145. *
  6146. * EXIT TO CALLER.
  6147. *
  6148. * USES X - 1, 2, 3, 7.
  6149. * A - 1, 2, 3, 7.
  6150. * B - 6, 7.
  6151. *
  6152. * MACROS GETFLD.
  6153.  
  6154.  
  6155. RQF SUBR ENTRY/EXIT
  6156. SA3 B2+TSQFW GET FWA OF ASSIGNED *TBRF*
  6157. LX3 TSQFN-1-TSQFS
  6158. GETFLD 1,B2,TSQW BIT MAP WORD NUMBER
  6159. GETFLD 2,B2,TSQB BIT MAP BIT NUMBER
  6160. SX1 X1+TQBMW INDEX INTO *TBRF* FOR BIT MAP WORD
  6161. IX1 X1+X3 FORM ADDRESS OF BIT MAP WORD
  6162. SB7 X2 BIT MAP BIT NUMBER
  6163. MX7 -1
  6164. SA2 X1 BIT MAP WORD FROM *TBRF*
  6165. LX7 B7,X7
  6166. BX7 X7*X2 CLEAR BIT
  6167. SA7 A2 STORE BIT MAP WORD
  6168. MX7 -TSQFN
  6169. SA1 A3+ POINTER TO ASSIGNED *TBRF* IN *TSEQ*
  6170. LX7 TSQFS-TSQFN+1
  6171. BX7 X7*X1
  6172. SA7 A1+ CLEAR *TBRF* POINTER
  6173. SA1 RDRF CURRENT *TDRF* ENTRY
  6174. SB6 X1
  6175. GETFLD 2,B6,TDCT COUNT OF ACTIVE TRANSACTIONS
  6176. SX2 X2-1 DECREMENT ACTIVE TRANSACTION COUNT
  6177. PUTFLD 2,B6,TDCT
  6178. EQ RQFX RETURN
  6179. SPACE 4,10
  6180. ** SED - SEARCH ELEMENT DESCRIPTOR TABLES (*EDT*).
  6181. *
  6182. * ENTRY (X1) = 2 CHARACTER DATA BASE ID, LEFT JUSTIFIED.
  6183. *
  6184. * EXIT (X1) = UNCHANGED.
  6185. * (B7) = FWA OF *EDT* ENTRY FOR SPECIFIED DATA BASE.
  6186. * (B7) = ZERO IF *EDT* ENTRY NOT FOUND.
  6187. *
  6188. * USES X - 2, 3, 7.
  6189. * A - 2.
  6190. * B - 7.
  6191.  
  6192.  
  6193. SED SUBR ENTRY/EXIT
  6194. SA2 VEDT GET ADDRESS OF FIRST *EDT*
  6195. AX2 24
  6196. MX7 12
  6197. SB7 X2+
  6198. SED1 ZR B7,SEDX IF END OF *EDT*S
  6199. SA2 B7 GET FIRST WORD OF *EDT*
  6200. SX3 X2 SAVE LINK TO NEXT *EDT*
  6201. BX2 X2-X1
  6202. BX2 X7*X2
  6203. ZR X2,SEDX IF DATA BASE *EDT* FOUND
  6204. SB7 X3
  6205. EQ SED1 CHECK NEXT *EDT*
  6206. SEK SPACE 4,20
  6207. ** SEK - SEEK KEY.
  6208. *
  6209. * ENTRY (B4) = FWA OF FILE CONTROL ENTRY.
  6210. * (REQT) = REQUEST.
  6211. * (RFCB) = FWA OF FILE CONTROL ENTRY.
  6212. *
  6213. * EXIT (TFSK) = NUMBER OF SEEKS TO BE DONE.
  6214. * (TFRQ) = REQUEST.
  6215. * (X6) = 0, IF NO ERRORS.
  6216. * *TERI*, IF *CRM* ERROR.
  6217. *
  6218. * USES X - 0, 1, 4, 5, 6, 7.
  6219. * A - 1, 5, 6, 7.
  6220. *
  6221. * CALLS CCS, CFS, CRQ.
  6222. *
  6223. * MACROS FETCH, SEEK.
  6224.  
  6225.  
  6226. SEK SUBR
  6227.  
  6228. * INITIALIZE SEEK COUNT.
  6229.  
  6230. SX0 B4+TFFTW FWA OF *FIT*
  6231. RJ CFS CHECK FATAL STATUS
  6232. NZ X6,SEK3 IF FATAL STATUS
  6233. FETCH X0,FO,X6 GET FILE ORGANIZATION
  6234. SX7 X6-#IS#
  6235. SX6 1 PRESET TO 1 SEEK
  6236. NZ X7,SEK1 IF FO .NE. *IS*
  6237. FETCH X0,NL,X6 GET NUMBER OF INDEX LEVELS
  6238. SEK1 SA1 B4+TFLNW GET FWA OF LOGICAL NAME ENTRY
  6239. MX5 -TFLNN
  6240. LX1 TFLNN-1-TFLNS
  6241. BX1 -X5*X1
  6242. MX5 -TLNAN
  6243. SA4 X1+TLNAW GET NUMBER OF ALTERNATE KEYS
  6244. BX1 -X5*X4
  6245. ZR X1,SEK2 IF NOT A MIPPED FILE
  6246. SX6 X6+2 INCREASE SEEK COUNT
  6247. SEK2 SA1 B4+TFSKW SEEK COUNT
  6248. MX5 60-TFSKN
  6249. LX1 TFSKN-1-TFSKS RIGHT JUSTIFY SEEK COUNT
  6250. BX4 X5*X1 CLEAR OLD SEEK COUNT
  6251. BX6 X4+X6 NEW SEEK COUNT
  6252. SA5 REQT SAVE REQUEST IN FILE CONTROL ENTRY
  6253. LX6 TFSKS-TFSKN+1
  6254. BX7 X5
  6255. SA6 A1+
  6256. SA7 B4+TFRQW
  6257.  
  6258. * IF *FIT* IS BUSY, DO SEEK LATER.
  6259.  
  6260. FETCH X0,BZF,X7
  6261. SA1 X7
  6262. BX6 X6-X6
  6263. LX1 59-0
  6264. PL X1,SEKX IF *FIT* IS BUSY - RETURN
  6265. SX1 B4+TFKYW FWA OF KEY
  6266. SEEK X0,,X1 SEEK KEY
  6267. SEK3 RJ CCS CHECK CRM STATUS
  6268. NZ X6,SEKX IF *CRM* ERROR
  6269.  
  6270. * DECREMENT SEEK COUNT.
  6271.  
  6272. SX5 B1
  6273. MX0 -TFSKN
  6274. SA1 B4+TFSKW
  6275. LX1 TFSKN-1-TFSKS RIGHT JUSTIFY SEEK COUNT
  6276. BX7 -X0*X1 CURRENT SEEK COUNT
  6277. ZR X7,SEKX IF SEEK COUNT EXHAUSTED
  6278. IX7 X1-X5
  6279. LX7 TFSKS-TFSKN+1
  6280. SA7 A1
  6281. EQ SEKX RETURN
  6282. SPACE 4,10
  6283. ** SFC - SEARCH FILE CONTROL TABLE FOR FILE ENTRY.
  6284. *
  6285. * ENTRY (B2) = FWA OF *TSEQ*.
  6286. * (X1) = FILE NAME, LEFT JUSTIFIED.
  6287. *
  6288. * EXIT (B4) = FWA OF *TFCB* FOR SPECIFIED FILE.
  6289. * (X0) = FWA OF *FIT*.
  6290. * (X6) = *TERL*, IF *TFCB* FOR FILE NOT FOUND.
  6291. * (X7) = FWA OF *TFCB* FOR SPECIFIED FILE.
  6292. *
  6293. * USES X - 0, 3, 6, 7.
  6294. * A - 3.
  6295. * B - 4.
  6296.  
  6297.  
  6298. SFC SUBR ENTRY/EXIT
  6299. SA3 B2+TSNFW FWA OF FIRST FILE LINK FOR TRANSACTION.
  6300. SFC1 SX7 X3+ LINK TO NEXT *TFCB*
  6301. SX6 TERL FILE NOT OPEN ERROR CODE
  6302. ZR X7,SFCX IF END OF *TFCB*S FOR TRANSACTION
  6303. SA3 X7+TFFTW FIRST WORD OF *FIT*
  6304. BX6 X3-X1 COMPARE FILE NAMES
  6305. AX6 18
  6306. SB4 X7 FWA OF *TFCB*
  6307. SX0 A3 FWA OF *FIT*
  6308. ZR X6,SFCX IF *TFCB* FOUND
  6309. SA3 X7+TFNTW FWA OF NEXT *TFCB FOR TRANSACTION
  6310. EQ SFC1 CONTINUE *TFCB* SEARCH
  6311.  
  6312. SPACE 4,25
  6313. ** SFF - SEARCH FOR FILE.
  6314. *
  6315. * THIS SUBROUTINE SEARCHES THE *TLNT* TABLES ,
  6316. * WITHIN X3 AND X4 BOUNDS FOR THE FILE, WHOSE
  6317. * NAME IS GIVEN IN X1.
  6318. *
  6319. * ENTRY (X1) = FILE NAME, LEFT JUSTIFIED.
  6320. * (X3) = FWA OF 1ST *TLNT* FOR THE D.B.
  6321. * (X4) = FWA OF LAST *TLNT* FOR THE D.B.
  6322. *
  6323. * EXIT (X1) = FILE NAME (LEFT-JUSTIFIED).
  6324. * (B3) = FWA OF *TLNT* FOR THIS FILE.
  6325. *
  6326. * USES X - 3, 4, 6, 7.
  6327. * A - 3.
  6328. * B - 3.
  6329.  
  6330.  
  6331. SFF SUBR
  6332. SX4 X4 FWA OF LAST *TLNT* ENTRY
  6333. MX7 TLFNN
  6334. SFF1 SB3 X3 FWA OF *TLNT* ENTRY
  6335. ZR B3,SFFX IF END OF *TLNT* TABLE FILE NOT FOUND
  6336. SA3 B3 FILE NAME AND LINK FROM *TLNT*
  6337. BX6 X3-X1
  6338. BX6 X7*X6
  6339. ZR X6,SFFX IF FILE FOUND (B3) = *TLNT* ENTRY
  6340. SX6 B3+ FWA OF *TLNT* CHECKED LAST
  6341. BX6 X4-X6
  6342. SB3 B0
  6343. ZR X6,SFFX IF RANGE OF *TLNT* ENTRIES CHECKED
  6344. EQ SFF1 CHECK NEXT *TLNT* ENTRY
  6345. SFO SPACE 4,20
  6346. ** SFO - SET FILE KEY ORDINAL TO NEW KEY.
  6347. *
  6348. *. ENTRY (X0) = FWA OF *FIT*.
  6349. * (X1) = FWA OF KEY ORDINAL.
  6350. * (B4) = FWA OF FILE CONTROL ENTRY.
  6351. * (RLNT) = FWA OF LOGICAL NAME ENTRY.
  6352. *
  6353. * EXIT KEY ORDINAL SET IN FILE CONTROL ENTRY.
  6354. * KEY IN *FIT* SET TO KEY ORDINAL.
  6355. * (X6) = *TERAB* IF BAD KEY ORDINAL.
  6356. *
  6357. * USES X - 1, 2, 3, 4, 6 ,7.
  6358. * A - 2, 3, 4, 7.
  6359. *
  6360. * CALLS STK.
  6361. *
  6362. * MACROS STORE.
  6363.  
  6364.  
  6365. SFO2 SX6 TERAB BAD KEY ORDINAL
  6366.  
  6367. SFO SUBR ENTRY/EXIT
  6368. MX6 0
  6369. NG X1,SFOX IF NO KEY ORDINAL
  6370. SA2 X1
  6371. NG X2,SFOX IF NO CHANGE
  6372. SA4 B4+TFKOW GET ALTERNATE KEY ORDINAL
  6373. MX3 -TFKON
  6374. LX4 TFKON-TFKOS-1
  6375. BX7 -X3*X4
  6376. BX7 X7-X2
  6377. ZR X7,SFOX IF NO CHANGE
  6378. BX4 X3*X4
  6379. MX3 0
  6380. ZR X2,SFO1 IF PRIMARY KEY
  6381. SX3 B4+TFKYW FWA OF KEY AREA
  6382. SFO1 STORE X0,PKA=X3 SET PRIMARY KEY ADDRESS
  6383. MX6 0
  6384. SA3 RLNT FWA OF LOGICAL NAME ENTRY
  6385. IX4 X4+X2
  6386. SA1 X3+TLNAW GET NUMBER OF ALTERNATE KEYS
  6387. MX7 -TLNAN
  6388. BX1 -X7*X1
  6389. IX1 X1-X2
  6390. NG X1,SFO2 IF BAD ALTERNATE KEY ORDINAL
  6391. IX1 X3+X2
  6392. SA3 X1+TLKWW FETCH KEY DESCRIPTION
  6393. NG X3,SFO2 IF DELETED KEY
  6394. RJ STK SET KEY DESCRIPTION IN FIT
  6395. BX7 X4
  6396. LX7 TFKOS-TFKON+1
  6397. SA7 A4+ SET KEY ORDINAL IN FILE CONTROL ENTRY
  6398. EQ SFOX RETURN
  6399. STK SPACE 4,15
  6400. ** STK - SET ALTERNATE KEY DESCRIPTION IN CRM *FIT*.
  6401. *
  6402. * ENTRY (X0) = FWA OF *FIT*.
  6403. * (X3) = 6/,18/RKW,18/RKP,18/KL.
  6404. *
  6405. * EXIT KEY SET IN *FIT*
  6406. *
  6407. * USES X - 1, 3.
  6408. *
  6409. * MACROS STORE.
  6410.  
  6411.  
  6412. STK SUBR ENTRY/EXIT
  6413. SX1 X3
  6414. STORE X0,KL=X1,5,7,2 SET KEY LENGTH
  6415. AX3 18
  6416. SX1 X3
  6417. AX3 18
  6418. STORE X0,RKP=X1,5,7,2 SET KEY BEGINNING CHARACTER
  6419. SX1 X3+
  6420. STORE X0,RKW=X1,5,7,2 SET KEY RELATIVE POSITION
  6421. EQ STKX NORMAL RETURN
  6422. TAF$RM SPACE 4,10
  6423. ** TAF$RM - TAF RECORD MANAGER INTERFACE.
  6424. *
  6425. * ENTRY (RCOD) = REQUEST CODE.
  6426. *
  6427. * EXIT (TAFA) = 1.
  6428. * (TAF$RM) = RETURN ADDRESS FOR *CRM*.
  6429. * (B1) = 1.
  6430. *
  6431. * USES X - 1, 6.
  6432. * A - 1, 6.
  6433. * B - 1.
  6434.  
  6435.  
  6436. TAF$RM SUBR ENTRY/EXIT
  6437. SX6 1 SET *CRM* IN RECALL
  6438. SA6 TAFA
  6439. SB1 1
  6440.  
  6441. * CHECK IF ENTRY DUE TO INITIALIZATION
  6442. * RECOVERY MODE PRESET FUNCTION.
  6443.  
  6444. SA1 AMI *AAMI* ENTRY
  6445. ZR X1,AMI1 IF ENTRY DUE TO INITIALIZATION
  6446. EQ AMIX RETURN TO TRANSACTION EXECUTIVE
  6447.  
  6448. TAFA CON 0 *CRM* RECALL STATUS
  6449. TSE SPACE 4,10
  6450. ** TSE - *TAF* SETUP FOR *CRM*.
  6451. *
  6452. * NOTE THIS ROUTINE IS SUBSTITUTED FOR *CRM* ROUTINE
  6453. * *SETUP.* BECAUSE *TAF* HAS ITS OWN RECOVERY
  6454. * PROCEDURES. ROUTINES NEEDED BY *SETUP.* MAY NOT
  6455. * BE IN CORE WHEN REPRIEVE PROCESSING OCCURS.
  6456.  
  6457.  
  6458. TSE SUBR ENTRY/EXIT
  6459. EQ TSEX RETURN
  6460. SPACE 4,10
  6461. ** ULF - UP AFTER IMAGE RECOVERY FILE.
  6462. * ATTEMPT TO ATTACH THE LAST *ARF* USED,
  6463. * (*ARF* NAME IN *TARF* FET).
  6464. *
  6465. * ENTRY (RDRF) = FWA OF DATA BASE *TDRF* ENTRY.
  6466. *
  6467. * EXIT (X6) = *TERAK*, IF DATA BASE *ARF* NOT UP.
  6468. * = ZERO IF *ARF* IS UP.
  6469. *
  6470. * USES X - 1, 2, 5, 6, 7.
  6471. * A - 1, 2, 5, 6, 7.
  6472. * B - 5.
  6473. *
  6474. * MACROS GETFLD, PUTFLD.
  6475. *
  6476. * CALLS NMS, SLF.
  6477.  
  6478.  
  6479. ULF SUBR ENTRY/EXIT
  6480. SA5 RDRF FWA OF DATA BASE *TDRF* ENTRY
  6481. SA1 X5+TDALW FWA OF *TARF* ENTRY
  6482. LX1 TDALN-1-TDALS RIGHT JUSTIFY ADDRESS
  6483. SB5 X1 FWA OF *TARF* ENTRY
  6484. SX6 B0
  6485. MX7 TADNN+TAFBN
  6486. ZR B5,ULFX IF NO *ARF-S* TO UP
  6487. SA1 B5+TADNW *ARF* STATUS WORD
  6488. SA6 B5+TASQW CLEAR RESERVE AND UNUSED PRU*S
  6489. BX7 -X7*X1 CLEAR DOWN AND FLUSHED FLAGS
  6490. SA7 A1
  6491. GETFLD 2,B5,TAFF LAST USED *ARF* NAME
  6492. PUTFLD 2,X5,TDLP STORE LAST CHARACTER OF *ARF* NAME
  6493. SX7 B1
  6494. BX2 X2-X7 TOGGLE LAST BIT OF NAME
  6495. PUTFLD 2,X5,TDLB CHANGE LAST BIT OF NAME
  6496. SA1 B5+TAFTW *FIRST*
  6497. SX7 X1
  6498. SA7 A1+B1 SET *IN* .EQ. *FIRST*
  6499. SA7 A7+1 SET *OUT* .EQ. *FIRST*
  6500. RJ SLF SWITCH TO ALTERNATE *ARF*
  6501. SA1 B5+TADNW *ARF* STATUS WORD
  6502. PL X1,ULFX IF *ARF* IS UP
  6503. SA5 RDRF FWA OF DATA BASE *TDRF* ENTRY
  6504. SA1 MSGG *ARF-S* UNAVAILABLE MESSAGE
  6505. MX7 TDIDN
  6506. SA2 X5+TDIDW DATA BASE ID
  6507. RJ NMS REPORT DATA BASE *ARF-S* DOWN
  6508. SX6 TERAK *ARF-S* DOWN ERROR CODE
  6509. EQ ULFX RETURN
  6510. UNL SPACE 4,15
  6511. ** UNL - UNLOCK RECORD OR FILE.
  6512. *
  6513. * ENTRY (B7) = 2, IF RECORD UNLOCK REQUESTED.
  6514. * 1, IF FILE UNLOCK REQUESTED.
  6515. * (B2) = FWA OF TRANSACTION SEQUENCE ENTRY.
  6516. * (B3) = FWA OF LOGICAL NAME ENTRY.
  6517. *
  6518. * EXIT (X6) = 0, IF NO ERRORS.
  6519. * *TERJ*, IF USER DOES NOT HAVE RECORD LOCKED.
  6520. * *TERK*, IF USER DOES NOT HAVE FILE LOCKED.
  6521. * *TERAH*, IF WITHIN BEGIN/COMMIT SEQUENCE.
  6522. *
  6523. * USES X - 0, 1, 2, 3, 4, 6.
  6524. * A - 1, 2.
  6525. *
  6526. * CALLS KSR, ROL.
  6527.  
  6528.  
  6529. UNL2 SX6 TERK USER DOES NOT HAVE FILE LOCKED
  6530.  
  6531. UNL SUBR ENTRY/EXIT
  6532. SA1 B3+TLRFW RECOVERABLE FILE FLAG FROM *TLNT*
  6533. SA2 B2+TSBRW *DBEGIN* OUTSTANDING FLAG FROM *TSEQ*
  6534. LX1 59-TLRFS
  6535. PL X1,UNL0 IF NOT RECOVERABLE FILE TYPE
  6536. LX2 59-TSBRS
  6537. SX6 TERAH REQUEST NOT ALLOWED WITHIN BEGIN/COMMIT
  6538. NG X2,UNLX IF *DBEGIN* OUTSTANDING
  6539. UNL0 RJ KSR KEY SEARCH FOR REQUESTED LOCK
  6540. ZR X5,UNL1 IF LOCK NOT FOUND
  6541. SA1 B5+TKSQW TRANSACTION OWNING LOCK
  6542. MX0 TKSQN
  6543. BX1 X0*X1
  6544. SA2 B2+TSSQW TRANSACTION REQUESTING UNLOCK
  6545. BX2 X0*X2
  6546. IX1 X2-X1
  6547. NZ X1,UNL1 IF LOCK NOT BY REQUESTING TRANSACTION
  6548. SX3 B7
  6549. BX4 X5-X3
  6550. NZ X4,UNL1 IF REQUEST UNLOCK .NE. TO ENTRY LOCK
  6551. RJ ROL RELEASE ONE LOCK FOR TRANSACTION
  6552. BX6 X6-X6 NO ERRORS
  6553. EQ UNLX RETURN
  6554.  
  6555. UNL1 EQ B7,B1,UNL2 IF FILE UNLOCK REQUESTED
  6556. SX6 TERJ TRANSACTION DOES NOT HAVE RECORD LOCKED
  6557. EQ UNLX RETURN
  6558.  
  6559. VAL SPACE 4,20
  6560. ** VAL - VALIDATE REQUEST.
  6561. *
  6562. * ENTRY (X5) = REQUEST.
  6563. *
  6564. * EXIT (X6) = 0, IF NO ERRORS.
  6565. * *TERB*, IF FILE IS NOT INSTALLED.
  6566. * *TERL*, IF FILE IS NOT OPEN.
  6567. * *TERR*, IF FILE ALREADY OPEN FOR OPEN REQUEST.
  6568. * *TERV*, IF INVALID PARAMETER LIST.
  6569. * *TERX*, IF USER NOT VALIDATED FOR DATA BASE.
  6570. * *TERAK*, IF DATA BASE, FILE, OR *AMI* IS DOWN.
  6571. * *TERAG*, IF DATA BASE IDLE.
  6572. *
  6573. * (B4) = FWA OF FILE CONTROL ENTRY.
  6574. * (B3) = FWA OF LOGICAL NAME ENTRY.
  6575. * (RDRF) = FWA OF DATA BASE RECOVERY ENTRY.
  6576. *
  6577. * USES X - ALL.
  6578. * A - 1, 2, 3, 4, 5, 6, 7.
  6579. * B - 3, 4, 5, 6, 7.
  6580. *
  6581. * CALLS GRA, ZFN.
  6582. *
  6583. * MACROS GETFLD.
  6584.  
  6585.  
  6586. VAL15 SX6 B0+ NO ERROR EXIT
  6587.  
  6588. VAL SUBR ENTRY/EXIT
  6589. MX0 -TFSCN MASK FOR SUB-CONTROL POINT
  6590. LX5 TFSCN-1-TFSCS RIGHT JUSTIFY SUB-CONTROL POINT
  6591. BX1 -X0*X5 SUB-CONTROL POINT
  6592. BX6 X6-X6 SET FLAG - CALLED BY *AAMI*
  6593. TJ GRA GET RA OF SUB-CONTROL POINT
  6594.  
  6595. * IF PARAMETERS ARE NOT WITHIN FIELD LENGTH
  6596. * RETURN ERROR CODE.
  6597.  
  6598. SX1 X7
  6599. SB6 B0 COUNTER FOR PARAMETERS PROCESSED
  6600. SA7 TADR+TPFL TASK FL
  6601. SA6 TADR+TPRA TASK RA
  6602. SA4 REQT REQUEST
  6603. BX7 X2 SAVE USER NAME
  6604. SB5 X4
  6605. SA7 RUNA
  6606. MX3 -TFFCN MASK FOR REQUEST CODE
  6607. LX4 TFFCN-1-TFFCS RIGHT JUSTIFY REQUEST CODE
  6608. BX2 -X3*X4 REQUEST CODE
  6609. SA3 X2+TCRM NUMBER OF PARAMETERS IN REQUEST
  6610. SB5 B5+X6 REQUEST ADDRESS
  6611. AX3 36
  6612. SB7 X3
  6613. BX7 X5 DATA BASE ID
  6614. SA7 RDRF SAVE DATA BASE ID
  6615. VAL1 GT B6,B7,VAL2 IF ALL PARAMETERS CHECKED
  6616. SA2 B5+B6 PARAMETER ADDRESS
  6617. SB3 X2
  6618. ZR X2,VAL3 IF END OF PARAMETERS
  6619. SB4 -B3
  6620. SX3 X1+B4
  6621. ZR X3,VAL2 IF PARAMETER ADDRESS OUT OF BOUNDS
  6622. NG X3,VAL2 IF PARAMETER ADDRESS OUT OF BOUNDS
  6623. GT B4,VAL2 IF PARAMETER ADDRESS OUT OF BOUNDS
  6624. SX7 X6+B3 ABSOLUTE ADDRESS OF PARAMETER
  6625. SA7 TADR+B6
  6626. SB6 B6+B1
  6627. EQ VAL1 GET NEXT TASK PARAMETER
  6628.  
  6629. VAL2 SX6 TERX INVALID PARAMETER LIST ERROR
  6630. EQ VALX RETURN
  6631.  
  6632. VAL3 EQ B6,B7,VAL4 IF ALL PARAMETERS PRESENT
  6633. SA3 A3 NUMBER OF OPTIONAL PARAMETERS
  6634. MX7 -18
  6635. AX3 54
  6636. MX1 59 -1
  6637. VAL3.1 ZR X3,VAL2 IF NOT ALL REQUIRED PARAMETERS
  6638. IX3 X3+X1 DECREMENT NUMBER OF OPTIONAL PARAMETERS
  6639. SA7 TADR+B6
  6640. SB6 B6+B1
  6641. NE B6,B7,VAL3.1 IF NOT ALL PARAMETERS PRESENT
  6642.  
  6643. * INSURE USER IS VALIDATED TO USE DATA BASE.
  6644. * THE FIRST TWO CHARACTERS OF THE FILE NAME MUST BE EQUAL TO
  6645. * THE DATA BASE NAME.
  6646.  
  6647. VAL4 SA1 RCOD REQUEST CODE
  6648. SX1 X1-.TRDBRL
  6649. SB3 B0 NO *TLNT* FOR DATA BASE LEVEL REQUEST
  6650. SB4 B0 NO *TFCB* FOR DATA BASE LEVEL REQUEST
  6651. PL X1,VAL11 IF DATA BASE LEVEL REQUEST
  6652. SA1 TADR+TPFN FWA OF FILE NAME
  6653. SA1 X1+ FILE NAME
  6654. RJ ZFN ZERO FILL NAME
  6655. BX2 X1
  6656. LX2 11-59
  6657. SX6 TERY USER NOT VALIDATED FOR DATA BASE
  6658. MX0 -12
  6659. BX3 -X0*X2 DATA BASE OF REQUEST
  6660. IX4 X5-X3
  6661. MX0 TLFNN MASK FOR FILE NAME
  6662. NZ X4,VALX IF USER IS NOT VALIDATED FOR DATA BASE
  6663.  
  6664. * CHECK IF FILE IS INSTALLED.
  6665.  
  6666. SA4 VAMB FWA OF LOCIAL NAME TABLE
  6667. LX2 59-59+59-11 LEFT JUSTIFY FILE NAME
  6668. AX4 24
  6669. SB3 X4+
  6670. VAL5 SA3 B3+TLFNW FILE NAME
  6671. BX6 X0*X3
  6672. IX6 X6-X2
  6673. ZR X6,VAL6 IF FILE FOUND IN LOGICAL NAME TABLE
  6674. SB3 X3+ FWA OF NEXT LOGICAL NAME ENTRY
  6675. NZ B3,VAL5 IF MORE ENTRIES IN LOGICAL NAME TABLE
  6676. SX6 TERB FILE IS NOT INSTALLED
  6677. EQ VALX RETURN
  6678.  
  6679. * CHECK IF FILE IS OPEN FOR REQUEST.
  6680.  
  6681. VAL6 SX6 TERL FILE IS NOT OPEN ERROR
  6682. SA1 RCOD REQUEST CODE
  6683. SX1 X1-TROP
  6684. SA5 REQT REQUEST
  6685. MX0 TFSQN MASK FOR TRANSACTION SEQUENCE
  6686. BX5 X0*X5
  6687. SA3 B3+TLNOW LINK TO OPEN FILES
  6688. VAL7 SX2 X3+
  6689. ZR X2,VAL9 IF FILE IS NOT OPEN - RETURN
  6690. SB4 X2-TFNFW FWA OF FILE CONTROL ENTRY
  6691. SA4 B4+TFSQW TRANSACTION SEQUENCE
  6692. BX4 X0*X4
  6693. IX3 X4-X5
  6694. ZR X3,VAL8 IF FILE IS OPEN
  6695. SA3 B4+TFNFW FWA OF NEXT FILE CONTROL ENTRY
  6696. EQ VAL7 CHECK NEXT FILE CONTROL ENTRY
  6697.  
  6698. VAL8 NZ X1,VAL10 IF NOT OPEN REQUEST
  6699. SX6 TERR FILE IS ALREADY OPEN
  6700. EQ VALX RETURN
  6701.  
  6702. VAL9 NZ X1,VALX IF NOT OPEN REQUEST
  6703. SA1 B3+TLFIW IDLE FILE FLAG
  6704. SX6 TERAG FILE IDLE ERROR CODE
  6705. LX1 59-TLFIS
  6706. NG X1,VALX IF FILE IDLE DO NOT ALLOW OPEN
  6707.  
  6708. * CHECK IF FILE IS UP.
  6709.  
  6710. VAL10 SA1 B3+TLFDW FILE DOWN FLAG
  6711. SX6 TERAK FILE DOWN ERROR CODE
  6712. NG X1,VALX IF FILE DOWN DO NOT ALLOW REQUEST
  6713.  
  6714. * LOCATE *TDRF* TABLE AND INSURE DATA BASE IS UP.
  6715.  
  6716. VAL11 SA2 RDRT FWA OF FIRST *TDRF* TABLE
  6717. VAL12 SA5 RDRF DATA BASE ID
  6718. GETFLD 3,X2,TDID GET DATA BASE ID FROM *TDRF*
  6719. IX3 X3-X5
  6720. ZR X3,VAL13 IF *TDRF* FOR DATA BASE FOUND
  6721. GETFLD 2,X2,TDDL GET FWA OF NEXT *TDRF*
  6722. NZ X2,VAL12 IF NOT LAST *TDRF*
  6723. VAL13 BX7 X2 FWA OF *TDRF* FOR DATA BASE
  6724. SA7 A5 STORE FWA OF DATA BASE *TDRF* AT *RDRF*
  6725. SX6 TERX INVALID PARAMETER LIST ERROR CODE
  6726. SA1 RCOD REQUEST CODE
  6727. SX2 X1-.TREQL
  6728. NZ X7,VAL14 IF DATA BASE *TDRF* FOUND
  6729. NG X2,VALX IF REQUEST REQUIRES *TDRF* ADDRESS
  6730. SX3 X1-TRRI
  6731. ZR X3,VALX IF *RSTDBI* AND *TDRF* NOT FOUND
  6732. VAL14 PL X2,VAL15 IF NON-USER TASK REQUEST - RETURN
  6733. SA2 X7+TDSDW DATA BASE DOWN FLAG
  6734. LX2 59-TDSDS
  6735. SX6 TERAK DATA BASE DOWN ERROR CODE
  6736. NG X2,VALX IF DATA BASE DOWN
  6737. SA2 X7+TDSIW
  6738. LX2 59-TDSIS
  6739. PL X2,VAL15 IF DATA BASE NOT IDLE
  6740.  
  6741. * DATA BASE IS IDLE.
  6742. * DO NOT ALLOW *DBEGIN* OR *OPEN* REQUESTS.
  6743.  
  6744. SX6 TERAG DATA BASE IDLE ERROR CODE
  6745. SX2 X1-TRDB
  6746. ZR X2,VALX IF *DBEGIN* REQUEST
  6747. SX2 X1-TROP
  6748. ZR X2,VALX IF *OPEN* REQUEST
  6749. EQ VAL15 RETURN NO ERROR
  6750. EJECT
  6751. * *CPCOM* IS CALLED HERE FOR USE BY AUTO RECOVERY CODE.
  6752. * ALL ROUTINE WHICH REQUIRE *CPCOM* MUST FOLLOW CALL.
  6753. LIST -L
  6754. *CALL CPCOM
  6755. LIST *
  6756. TTL AAMI - ADVANCED ACCESS METHODS INTERFACE.
  6757. TITLE SUPPORTING ROUTINES WHICH REQUIRE *CPCOM*.
  6758. SPACE 4,10
  6759. ** ADF - ATTACH OR DEFINE FILE.
  6760. *
  6761. * ENTRY (X1) = FILE NAME, LEFT JUSTIFIED.
  6762. * (B7) = ZERO IF ATTACH DATA BASE FILE .
  6763. * = ONE IF *ARF* OR *BRF* TO BE DEFINED.
  6764. * = .GT. ONE IF *ARF* OR *BRF* TO BE ATTACHED.
  6765. * (RLNT) = FWA OF *TLNT* FOR PFN IF NOT *ARF* TO *BRF*.
  6766. *
  6767. * EXIT (X1) = ZERO IF FILE ATTACHED OR DEFINED, NO ERROR.
  6768. * = ERROR CODE IF ERROR ON ATTACH OR DEFINE.
  6769. *
  6770. * USES X - 1, 2, 4, 6, 7.
  6771. * A - 1, 4, 6, 7.
  6772. * B - 7.
  6773. *
  6774. * MACROS ATTACH, DEFINE, GETFLD.
  6775.  
  6776.  
  6777. ADF SUBR ENTRY/EXIT
  6778. MX7 42
  6779. BX7 X7*X1
  6780. SX1 B1 COMPLETE BIT
  6781. BX7 X7+X1 FORM FIRST WORD OF FET
  6782. SA7 AFET PFN TO FET+0
  6783. MX7 TLDVN
  6784. SA4 A7+B1
  6785. BX7 -X7*X4
  6786. SA7 A4 CLEAR DEVICE TYPE IN FET+1
  6787. SX7 B0+ ATTACH MODE = ZERO = WRITE MODE
  6788. SA7 AFET+12 CLEAR PACKNAME/UNIT IN FET+12
  6789. NZ B7,ADF1 IF *ARF* OR *BRF* LOG FILE
  6790. SA1 A4
  6791. SA4 RLNT
  6792. SB7 X4 FWA OF *TLNT* FOR PFN
  6793. SA4 B7+TLDVW GET DEVICE TYPE FROM *TLNT*
  6794. MX7 TLDVN
  6795. LX4 59-TLDVS
  6796. BX4 X7*X4
  6797. BX7 X1+X4
  6798. SA7 A1 STORE DEVICE TYPE IN FET+1
  6799. MX7 -TLDVN
  6800. SA4 A4+ GET PACKNAME, DEVICE, UNIT FROM *TLNT*
  6801. LX7 TLDVS-TLDVN+1
  6802. BX7 X7*X4 REMOVE DEVICE TYPE
  6803. SA7 AFET+12 STORE PACKNAME / UNIT IN FET+12
  6804. GETFLD 4,B7,TLMD GET ATTACH MODE FROM *TLNT*
  6805. BX7 X4 ATTACH MODE FROM *TLNT*
  6806. ADF1 SA7 AFET+7 STORE ATTACH MODE IN FET+7
  6807. NE B7,B1,ADF2 IF ATTACH FILE
  6808. DEFINE AFET,,,,AFET+7
  6809. EQ ADF3 CHECK FOR ERRORS
  6810.  
  6811. ADF2 ATTACH AFET,,,,AFET+7
  6812. ADF3 MX7 -8
  6813. SA1 AFET FET+0
  6814. AX1 10
  6815. BX1 -X7*X1 SAVE RIGHT JUSTIFIED ERROR CODE
  6816. EQ ADFX RETURN
  6817.  
  6818. SPACE 4,10
  6819. ** DDB - DOWN DATA BASE IF POSSIBLE.
  6820. *
  6821. * ENTRY (RDRT) = FWA OF FIRST *TDRF* ENTRY.
  6822. *
  6823. * EXIT TO CALLER.
  6824. *
  6825. * USES X - 1, 2, 3, 5, 6, 7.
  6826. * A - 1, 2, 3, 5, 6, 7.
  6827. * B - 5, 7.
  6828. *
  6829. * MACROS GETFLD, PUTFLD, RETURN.
  6830. *
  6831. * CALLS DDF, FLR, NMS, WAI.
  6832.  
  6833.  
  6834. DDB SUBR ENTRY/EXIT
  6835. SA5 RDDB FWA OF *TDRF* ENTRY TO CHECK
  6836. SA1 RDRT FWA OF FIRST *TDRF* ENTRY
  6837. NZ X5,DDB1 IF NOT END OF *TDRF* ENTRIES
  6838. SX5 X1+
  6839. DDB1 SA2 X5+TDDLW FWA OF NEXT *TDRF* ENTRY
  6840. LX2 TDDLN-1-TDDLS RIGHT JUSTIFY ADDRESS
  6841. SX7 X2
  6842. SA7 A5 STORE FWA OF NEXT *TDRF* ENTRY TO CHECK
  6843. SX7 X5 CURRENT *TDRF* ENTRY
  6844. SA7 RDRF STORE FWA OF CURRENT *TDRF*
  6845. SA3 X5+TDSDW DATA BASE DOWN/IDLE FLAG WORD
  6846. NG X3,DDBX IF DATA BASE ALREADY DOWN
  6847. MX6 -TDSIN
  6848. LX6 TDSIS-TDSIN+1
  6849. NG X1,DDB2 IF FORCING DATA BASE DOWN FOR *REC*
  6850. GETFLD 2,X5,TDOP DATA BASE OPEN FILE COUNT
  6851. BX1 -X6*X3 GET IDLE FLAG
  6852. ZR X1,DDBX IF DATA BASE NOT IDLING DOWN
  6853. NZ X2,DDBX IF DATA BASE FILES OPEN
  6854. GETFLD 2,X5,TDCT COUNT OF ACTIVE TRANSACTIONS
  6855. NZ X2,DDBX IF RECOVERY TRANSACTIONS ACTIVE
  6856.  
  6857. * FORCING DATA BASE DOWN FOR *REC* REQUEST OR
  6858. * DATA BASE IS IDLE WITH NO OPEN FILES.
  6859. * DATA BASE WILL BE DOWNED AT THIS TIME.
  6860.  
  6861. GETFLD 2,AMST,AMIB COUNT OF IDLED DATA BASES
  6862. SX1 B1
  6863. IX2 X2-X1 DECREMENT IDLED DATA BASE COUNT
  6864. PUTFLD 2,AMST,AMIB STORE NEW COUNT
  6865. DDB2 BX3 X6*X3 CLEAR DATA BASE IDLE FLAG
  6866. LX6 TDSDS-TDSIS
  6867. BX7 -X6+X3 SET DATA BASE DOWN FLAG
  6868. SA7 A3 STORE FLAGS
  6869. SA2 X5+TDIDW DATA BASE ID LEFT JUSTIFIED
  6870. SA1 MSGA FIRST WORD OF DATA BASE DOWN MESSAGE
  6871. MX7 TDIDN
  6872. RJ NMS REPORT DATA BASE DOWN
  6873.  
  6874. * RETURN ALL DATA BASE BEFORE IMAGE RECOVERY FILES.
  6875.  
  6876. SA1 X5+TDQLW FWA OF FIRST DATA BASE *TBRF* ENTRY
  6877. LX1 TDQLN-1-TDQLS RIGHT JUSTIFY ADDRESS
  6878. DDB3 SB5 X1+ FWA OF *TBRF* ENTRY
  6879. ZR B5,DDB4 IF ALL *BRF-S* RETURNED
  6880. SX1 B5+TQFFW FWA OF *BRF* FET
  6881. SA2 RCOD
  6882. SX3 X2-TRTC
  6883. NZ X3,DDB3.1 IF NOT IN RECOVERY MODE
  6884. SA2 X1 SET COMPLETION FLAG
  6885. SX7 B1
  6886. BX7 X2+X7
  6887. SA7 A2
  6888. DDB3.1 RETURN X1 RETURN BRF
  6889. SA1 B5+TQNLW FWA OF NEXT *TBRF* ENTRY
  6890. EQ DDB3 PROCESS ALL DATA BASE *BRF-S*
  6891.  
  6892. * RETURN AFTER IMAGE RECOVERY FILE IF LOCAL AND
  6893. * SUBMIT BATCH JOB IF *ARF* OR *BRF* IS DOWN FOR RECOVERY.
  6894. * IF THE *ARF* OR *BRF* IS NOT DOWN THE LOCAL *ARF*
  6895. * WILL NOT BE FLUSHED AND NO BATCH JOB SUBMITTED.
  6896.  
  6897. DDB4 GETFLD 1,X5,TDLP LAST CHARACTER OF LOCAL *ARF* NAME
  6898. ZR X1,DDB7 IF AFTER IMAGE RECOVERY FILE NOT LOCAL
  6899. SA1 X5+TDALW FWA OF *TARF* ENTRY
  6900. SB5 X1
  6901. SB7 B1 FORCE FLUSH *ARF* BUFFER
  6902. SA1 B5+TADNW *ARF* STATUS
  6903. NG X1,DDB5 IF *ARF* DOWN
  6904. SA2 RCOD
  6905. SX3 X2-TRTC
  6906. NZ X3,DDB4.1 IF NOT IN RECOVERY MODE
  6907. SA2 B5+TAFFW SET COMPLETION FLAG
  6908. SX7 B1
  6909. BX7 X2+X7
  6910. SA7 A2
  6911. DDB4.1 RJ WAI FLUSH ARF BUFFER
  6912. DDB5 SA5 RDRF FWA OF DATA BASE *TDRF* ENTRY
  6913. GETFLD 1,X5,TDQD FWA OF *TBRF* DOWN FOR RECOVERY
  6914. MX7 TADNN
  6915. SA2 B5+TADNW *ARF* STATUS
  6916. BX2 X7*X2 *ARF* DOWN FLAG
  6917. BX2 X1+X2 *TBRF* DOWN PLUS *ARF* DOWN
  6918. NZ X2,DDB10 IF BATCH JOB REQUIRED
  6919. RJ FLR RETURN *ARF*
  6920. DDB6 RJ DDF DOWN AND RETURN DATA BASE FILES
  6921. EQ DDBX RETURN
  6922.  
  6923. DDB7 GETFLD 3,X5,TDQD FWA OF FIRST DOWN *TBRF* ENTRY
  6924. SX2 B0
  6925. PUTFLD 2,X5,TDQD CLEAR FWA OF DOWN *TBRF*
  6926. ZR X3,DDB6 IF NO DOWN *BRF*
  6927. SA1 X5+TDQLW FWA OF FIRST DATA BASE *TBRF*
  6928. LX1 TDQLN-1-TDQLS RIGHT JUSTIFY ADDRESS
  6929.  
  6930. * REPORT NAMES OF ALL DOWN BEFORE IMAGE RECOVERY FILES.
  6931.  
  6932. DDB8 SB5 X1+ FWA OF *TBRF* ENTRY
  6933. ZR B5,DDB6 IF ALL *BRF-S* PROCESSED
  6934. SA1 B5+TQSTW *TBRF* STATUS FLAG WORD
  6935. PL X1,DDB9 IF *TBRF* NOT DOWN
  6936. SA2 B5+TQFFW *BRF* FILE NAME FROM FET
  6937. SA1 MSGB FIRST WORD OF *BRF* DOWN MESSAGE
  6938. MX7 TQFNN
  6939. RJ NMS REPORT *BRF* DOWN
  6940. DDB9 SA1 B5+TQNLW FWA OF NEXT *TBRF* ENTRY
  6941. EQ DDB8 CHECK NEXT DATA BASE *TBRF* ENTRY
  6942.  
  6943. DDB10 SX2 B0+
  6944. PUTFLD 2,B5,TACP CLEAR UNUSED PRU COUNT FOR *FLR*
  6945. RJ FLR REWRITE HEADER, RETURN *ARF*
  6946. RJ LBJ SUBMIT BATCH JOB
  6947. EQ DDB7 CONTINUE DOWNING DB
  6948. SPACE 4,10
  6949. ** DDF - DOWN DATA BASE FILE IF POSSIBLE.
  6950. *
  6951. * IF THE FILE IDLE FLAG IN THE *TLNT* ENTRY IS SET,
  6952. * AND THERE ARE NO OPEN LINKS FOR THE FILE,
  6953. * OR IF FILES ARE TO BE FORCED DOWN (RDRT NEGATIVE),
  6954. * THE FILE DOWN BIT WILL BE SET AND IDLE BIT CLEARED.
  6955. *
  6956. * ENTRY (RDRF) = FWA OF CURRENT DATA BASE *TDRF* ENTRY.
  6957. *
  6958. * EXIT TO CALLER.
  6959. *
  6960. * USES X - 1, 2, 3, 5, 7.
  6961. * A - 1, 2, 3, 5, 7.
  6962. * B - 3, 5, 6.
  6963. *
  6964. * MACROS GETFLD, PUTFLD.
  6965. *
  6966. * CALLS FLR, LBJ, NMS, RTF, SLF.
  6967.  
  6968.  
  6969. DDF SUBR ENTRY/EXIT
  6970. SA5 RDRF FWA OF CURRENT *TDRF*
  6971. SA1 X5+TDNLW FWA OF FIRST DATA BASE *TLNT* ENTRY
  6972. LX1 TDNLN-1-TDNLS RIGHT JUSTIFY ADDRESS
  6973.  
  6974. * CHECK ALL DATA BASE FILES FOR IDLE.
  6975.  
  6976. DDF1 SX7 X1 SAVE *TLNT* ENTRY FWA
  6977. SA7 RLNT FWA OF CURRENT *TLNT* ENTRY
  6978. SB3 X1 FWA OF DATA BASE *TLNT* ENTRY
  6979. ZR B3,DDFX IF ALL DATA BASE FILES CHECKED
  6980. SA1 B3+TLFIW FILE DOWN/IDLE FLAG WORD
  6981. SA2 B3+TLNOW OPEN FILE LINK
  6982. SA3 RDRT FWA OF FIRST *TDRF* ENTRY
  6983. NG X1,DDF8 IF FILE ALREADY DOWN - CHECK NEXT
  6984. LX1 59-TLFIS
  6985. SX2 X2 OPEN FILE LINK
  6986. PL X1,DDF6 IF FILE NOT IDLING DOWN
  6987. NG X3,DDF2 IF FORCE FILE DOWN
  6988. NZ X2,DDF6 IF FILE IS OPEN
  6989.  
  6990. * FILE IS IDLE AND NOT OPEN.
  6991. * IF FILE IS NOT DOWN FOR BATCH RECOVERY, OR
  6992. * IF THE FILE IS DOWN FOR BATCH RECOVERY AND
  6993. * THE DATA BASE IS DOWN, THEN CLEAR THE IDLE FLAG, SET
  6994. * FILE DOWN FLAG IN *TLNT* AND REPORT FILE NAME.
  6995.  
  6996. DDF2 LX1 TLFIS-TLBRS
  6997. SB6 B0 MESSAGE INDEX FOR NON-RECOVERABLE FILE
  6998. PL X1,DDF3 IF FILE NOT DOWN FOR BATCH RECOVERY
  6999. SA2 X5+TDSDW DATA BASE DOWN FLAG
  7000. PL X2,DDF9 IF DATA BASE NOT DOWN
  7001.  
  7002. * DATA BASE IS DOWN AND THE FILE IS DOWN
  7003. * FOR BATCH RECOVERY, REPORT FILE NAME.
  7004.  
  7005. SB6 MSGD-MSGC MESSAGE INDEX FOR RECOVERABLE FILE
  7006.  
  7007. * REPORT FILE NAME IN FILE DOWN MESSAGE.
  7008.  
  7009. DDF3 GETFLD 2,X5,TDIF COUNT OF IDLE DATA BASE FILES
  7010. ZR X2,DDF4 IF COUNT IS ZERO
  7011. SX1 B1
  7012. IX2 X2-X1 DECREMENT IDLE FILE COUNT
  7013. PUTFLD 2,X5,TDIF STORE NEW COUNT
  7014. DDF4 GETFLD 2,AMST,AMIF COUNT OF IDLE FILES FOR ALL DATA BASES
  7015. ZR X2,DDF5 IF COUNT IS ZERO
  7016. SX1 B1
  7017. IX2 X2-X1 DECREMENT COUNT OF ALL FILES IDLED
  7018. PUTFLD 2,AMST,AMIF STORE NEW COUNT
  7019. DDF5 SA1 B6+MSGC FIRST WORD OF FILE DOWN MESSAGE
  7020. SA2 B3+TLFNW FILE NAME
  7021. MX7 TLFNN FILE NAME MASK
  7022. RJ NMS REPORT FILE DOWN
  7023. EQ DDF7 SET DOWN, CLOSE AND RETURN DOWN FILE
  7024.  
  7025. * IF DATA BASE IS DOWN CLOSE ALL *FIT*S AND
  7026. * RETURN FILE.
  7027.  
  7028. DDF6 SA1 X5+TDSDW DATA BASE DOWN FLAG
  7029. PL X1,DDF8 IF DATA BASE NOT DOWN
  7030. DDF7 SA1 B3+TLFDW FILE DOWN/IDLE FLAG WORD
  7031. MX7 -TLFIN
  7032. LX7 TLFIS-TLFIN+1
  7033. BX1 X7*X1 CLEAR FILE IDLE
  7034. LX7 TLFDS-TLFIS
  7035. BX7 -X7+X1 SET FILE DOWN
  7036. SA7 A1 STORE FLAGS
  7037. SX7 B3+ FWA OF FILE *TLNT* ENTRY FOR FILE
  7038. RJ RTF CLOSE AND RETURN FILE
  7039. SA5 RDRF FWA OF CURRENT *TDRF* ENTRY
  7040. SA1 RLNT FWA OF CURRENT *TLNT* ENTRY
  7041. SB3 X1 FWA OF *TLNT* ENTRY
  7042. GETFLD 2,X5,TDLD FWA OF *TLNT* DOWN FOR RECOVERY
  7043. ZR X2,DDF8 IF NO *TLNT* DOWN FOR RECOVERY
  7044. GETFLD 1,X5,TDAL FWA OF *TARF* ENTRY
  7045. SB5 X1 FWA OF *TARF* ENTRY
  7046. SX2 B0
  7047. PUTFLD 2,B5,TACP CLEAR UNUSED PRU COUNT FOR *FLR*
  7048. RJ FLR RETURN *ARF*
  7049. RJ LBJ ISSUE BATCH JOB TO RECOVER DB FILE
  7050. RJ SLF SWITCH TO ALTERNATE *ARF*
  7051. SA5 RDRF FWA OF DATA BASE *TDRF* ENTRY
  7052. SX2 B0+
  7053. PUTFLD 2,X5,TDLD CLEAR FWA OF *TLNT* DOWN FOR RECOVERY
  7054. DDF8 GETFLD 1,X5,TDLL FWA OF LAST DATA BASE *TLNT* ENTRY
  7055. SX2 B3+ FWA OF CURRENT *TLNT* ENTRY
  7056. BX1 X1-X2
  7057. ZR X1,DDF1 IF ALL DATA BASE *TLNT*S CHECKED
  7058. SA1 B3+TLNTW FWA OF NEXT *TLNT* ENTRY
  7059. EQ DDF1 CHECK NEXT DATA BASE FILE
  7060.  
  7061. * DATA BASE IS NOT DOWN AND FILE IS DOWN FOR
  7062. * AUTOMATIC BATCH RECOVERY.
  7063. * IF THE AFTER IMAGE RECOVERY FILE IS LOCAL AND A
  7064. * BEFORE IMAGE RECOVERY FILE IS NOT DOWN FOR BATCH
  7065. * RECOVERY, AND THE *ARF* IS NOT BUSY WITH EMPTY BUFFER,
  7066. * THEN STORE FWA OF *TLNT* FOR BATCH RECOVERY JOB.
  7067.  
  7068. DDF9 GETFLD 1,X5,TDQD FWA OF DOWN *TBRF* ENTRY
  7069. GETFLD 2,X5,TDLP LAST CHARACTER OF LOCAL *ARF* NAME
  7070. ZR X2,DDF8 IF *ARF* NOT LOCAL - WAIT FOR DB DOWN
  7071. NZ X1,DDF8 IF *BRF* DOWN - WAIT FOR DB DOWN
  7072. GETFLD 2,X5,TDAL FWA OF *TARF*
  7073. MX7 -TAINN
  7074. SA1 X2+TAFFW FIRST WORD OF FET
  7075. LX1 59-0 POSITION COMPLETION BIT
  7076. PL X1,DDF8 IF *ARF* BUSY
  7077. SA1 X2+TAINW *IN* FROM FET
  7078. SA2 X2+TAOTW *OUT* FROM FET
  7079. BX1 X1-X2 COMPARE *IN* AND *OUT*
  7080. BX1 -X7*X1
  7081. NZ X1,DDF8 IF *ARF* BUFFER NOT EMPTY
  7082. SX2 B3+ FWA OF *TLNT*
  7083. PUTFLD 2,X5,TDLD STORE FWA OF *TLNT* FOR BATCH RECOVERY
  7084. EQ DDF3 DOWN AND RETURN FILE
  7085. SPACE 4,10
  7086. ** FLR - PROCESS FULL AFTER IMAGE RECOVERY FILE.
  7087. *
  7088. * ENTRY (B5) = FWA OF *TARF* ENTRY FOR FULL *ARF*.
  7089. *
  7090. * EXIT TO CALLER.
  7091. *
  7092. * USES X - 1, 2, 3, 6, 7.
  7093. * A - 1, 2, 3, 6, 7.
  7094. *
  7095. * MACROS GETFLD, RECALL, RETURN, REWRITER.
  7096. *
  7097. * CALLS CAT.
  7098.  
  7099.  
  7100. FLR SUBR ENTRY/EXIT
  7101. SX2 B5+TAFFW FWA OF FET
  7102. RECALL X2
  7103. RJ CAT CHECK FET *AT* FIELD
  7104. NZ X1,FLR2 IF *ARF* ERROR
  7105. SA1 B5+TADNW *ARF* STATUS
  7106. NG X1,FLR2 IF *ARF* DOWN
  7107. SA1 B5+TAFNW HEADER+0
  7108. MX7 -TASTN
  7109. BX1 X7*X1 GET *ARF* NAME
  7110. SA2 A1+B1 HEADER+1
  7111. BX6 X2
  7112. GETFLD 3,B5,TACP UNUSED PRU COUNT
  7113. SX7 XHAC ACTIVE AVAILABLE *ARF* STATUS
  7114. NZ X3,FLR1 IF ACTIVE *ARF* NOT FULL
  7115. SX7 XHNA ELSE SET NOT AVAILABLE STATUS
  7116. FLR1 BX7 X1+X7 FORM NEW HEADER WORD
  7117. SA3 B5+TAFTW FWA OF *ARF* BUFFER
  7118. SA7 X3 STORE HEADER+0
  7119. SA6 A7+B1 STORE HEADER+1
  7120. SA1 A2+B1 HEADER+2
  7121. SA2 A1+B1 HEADER+3
  7122. BX7 X1
  7123. BX6 X2
  7124. SA7 A6+B1 STORE HEADER+2
  7125. SA6 A7+B1 STORE HEADER+3
  7126. SX7 X3+TAHDL
  7127. SA7 A3+B1 SET *TARF* FET *IN*
  7128. SX7 X3 (FIRST)
  7129. SA7 A7+B1 SET *OUT* .EQ. *FIRST*
  7130. SX7 B1 (RR)
  7131. SA7 B5+TARIW SET FET CRI FOR HEADER
  7132. SX2 B5+TAFFW FWA OF FET
  7133. REWRITER X2,R WAIT FOR HEADER REWRITE
  7134. RJ CAT CLEAR *AT* FIELD
  7135. FLR2 RETURN X2 RETURN *ARF*
  7136. SA1 B5+TAFTW FWA OF *ARF* BUFFER
  7137. SX7 X1 SET IN/OUT POINTERS FOR EMPTY BUFFER
  7138. SA7 A1+B1 STORE *IN*
  7139. SA7 A7+B1 STORE *OUT*
  7140. EQ FLRX RETURN
  7141. SPACE 4,10
  7142. ** NMS - STORE NAME IN MESSAGE AND ISSUE MESSAGE.
  7143. *
  7144. * ENTRY (X2) = NAME, LEFT JUSTIFIED.
  7145. * (X7) = MASK FOR NAME, LEFT JUSTIFIED.
  7146. * (A1) = FWA OF FIRST WORD OF MESSAGE,
  7147. *
  7148. * EXIT (B2) = ENTRY VALUE.
  7149. * (B3) = ENTRY VALUE.
  7150. * (B4) = ENTRY VALUE.
  7151. * (B5) = ENTRY VALUE.
  7152. *
  7153. * USES X - 1, 2, 7.
  7154. * A - 1, 2, 7.
  7155. * B - 2, 3, 4, 5.
  7156. *
  7157. * MACROS MESSAGE.
  7158. *
  7159. * CALLS SNM.
  7160.  
  7161.  
  7162. NMS SUBR ENTRY/EXIT
  7163. BX1 X7*X2 NAME LEFT JUSTIFIED ZERO FILLED
  7164. SX7 B2
  7165. SA7 NMSA SAVE (B2)
  7166. SB2 1R+ SEARCH CHARACTER
  7167. SX7 B3
  7168. SA7 A7+B1 SAVE (B3)
  7169. SB3 NMSB FWA OF MESSAGE ASSEMBLY AREA
  7170. SX7 B4
  7171. SA7 A7+B1 SAVE (B4)
  7172. SX7 B5
  7173. SB5 A1 FWA OF MESSAGE
  7174. SB5 -B5 USE (B3) AS FWA OF ASSEMBLY AREA
  7175. SA7 A7+B1 SAVE (B5)
  7176.  
  7177. * *SNM* USES X - 1, 2, 3, 4, 6, 7.
  7178. * A - 4, 7.
  7179. * B - 3, 4.
  7180.  
  7181. RJ SNM SET NAME IN MESSAGE
  7182. MESSAGE NMSB
  7183. SA1 NMSA
  7184. SA2 A1+B1
  7185. SB2 X1 RESTORE (B2)
  7186. SB3 X2 RESTORE (B3)
  7187. SA1 A2+B1
  7188. SA2 A1+B1
  7189. SB4 X1 RESTORE (B4)
  7190. SB5 X2+ RESTORE (B5)
  7191. EQ NMSX RETURN
  7192.  
  7193. NMSA BSS 4 SAVE B2, B3, B4, B5
  7194. NMSB BSSZ 5 50 CHARACTER MESSAGE ASSEMBLY AREA
  7195. SPACE 4,10
  7196. ** RBI - READ BEFORE IMAGE RECORD FROM *BRF*.
  7197. *
  7198. * ENTRY (B5) = FWA OF *TBRF*.
  7199. * (X7) = RANDOM SECTOR ADDRESS FOR *RR* FET FIELD.
  7200. *
  7201. * EXIT TO CALLER.
  7202. *
  7203. * USES X - 1, 2, 7.
  7204. * A - 1, 7.
  7205. *
  7206. * MACROS READ.
  7207.  
  7208.  
  7209. RBI SUBR ENTRY/EXIT
  7210. MX1 -TQRRN
  7211. BX7 -X1*X7
  7212. SA7 B5+TQRRW SET *RR* FIELD OF FET
  7213. SA1 B5+TQFTW *FIRST* FROM *TBRF* FET
  7214. SX7 X1+ FWA OF BUFFER
  7215. SA7 A1+B1 SET *IN* .EQ. *FIRST*
  7216. SA7 A7+B1 SET *OUT* .EQ. *FIRST*
  7217. SX2 B5+TQFFW FWA OF *BRF* FET
  7218. READ X2 READ BEFORE IMAGE RECORD
  7219. EQ RBIX RETURN TO CALLER
  7220.  
  7221. SPACE 4,10
  7222. ** RDH - READ *ARF* / *BRF* FILE HEADER.
  7223. *
  7224. * ENTRY (A0) = FWA OF FET.
  7225. *
  7226. * EXIT (A0) = FWA OF FET.
  7227. * (X1) = ZERO IF NO ERROR.
  7228. * BITS 0 - 18 OF FET+0 = 0.
  7229. * (X1) = NON-ZERO IF ERROR.
  7230. * FET+0 = AS SET BY *CIO*.
  7231. *
  7232. * USES X - 1, 2, 6, 7.
  7233. * A - 1, 2, 6, 7.
  7234. * B - NONE.
  7235. *
  7236. * MACROS READ.
  7237. *
  7238. * CALLS CAT.
  7239.  
  7240.  
  7241. RDH SUBR ENTRY/EXIT
  7242. SA1 A0 GET FET+0
  7243. MX7 42
  7244. BX1 X7*X1
  7245. SX6 B1
  7246. BX6 X1+X6 SET COMPLETION BIT
  7247. SA6 A0
  7248. SA1 A0+B1 *FIRST* FROM FET+1
  7249. BX6 -X7*X1
  7250. SA6 A1+B1 SET *IN* .EQ. *FIRST*
  7251. SA6 A6+B1 SET *OUT* .EQ. *FIRST*
  7252. SX6 B1+ (RR)
  7253. SA6 A0+6 SET CRI IN FET
  7254. READ A0,R READ HEADER
  7255. SX2 A0+ FWA OF FET
  7256. RJ CAT CHECK/CLEAR *AT* FIELD
  7257. NZ X1,RDHX IF ERROR ON READ - RETURN
  7258. SA1 A0+2 *IN*
  7259. SA2 A1+B1 *OUT*
  7260. IX2 X1-X2
  7261. ZR X2,RDHX IF EMPTY BUFFER - RETURN X1 NON-ZERO
  7262. SX1 B0 (X1) = ZERO IF NO ERROR
  7263. EQ RDHX RETURN
  7264.  
  7265. SPACE 4,10
  7266. ** RTF - RETURN DATA BASE FILE.
  7267. *
  7268. * ENTRY (X7) = FWA OF FILE *TLNT* ENTRY.
  7269. *
  7270. * EXIT RETURN TO CALLER.
  7271. *
  7272. * USES X - 0, 1, 4, 5, 7.
  7273. * A - 1, 4, 7.
  7274. * B - NONE.
  7275. *
  7276. * MACROS FETCH, RECALL, UNLOAD.
  7277. *
  7278. * CALLS CLF, RFN.
  7279.  
  7280.  
  7281. RTF SUBR ENTRY/EXIT
  7282. SA7 RTFA SAVE FWA OF *TLNT*
  7283. SA4 X7+TLNOW FILE OPEN LINK
  7284. RJ CLF CLOSE FITS FOR OPEN ENTRIES
  7285. SA4 RTFA FWA OF *TLNT* ENTRY
  7286. SA4 X4+TLNFW FILE FREE LINK
  7287. RJ RFN CLEAR *FNF* FOR FREE ENTRIES
  7288. SA4 RTFA FWA OF *TLNT* ENTRY
  7289. SA4 X4+TLNFW FILE FREE *TFCB* LINK
  7290. RJ CLF CLOSE *FIT* FOR FREE ENTRIES
  7291. RECALL AFET
  7292. SA4 RTFA FWA OF *TLNT* ENTRY
  7293. SA1 X4 FILE NAME FROM *TLNT*
  7294. MX7 42
  7295. BX1 X7*X1 CLEAR LOWER 18 BITS
  7296. SX7 B1+
  7297. BX7 X1+X7 SET COMPLETE BIT
  7298. SA7 AFET STORE FILE NAME IN FET+0
  7299. UNLOAD A7 RETURN FILE
  7300. SA1 X4+TLNAW NUMBER OF ALTERNATE KEYS FROM *TLNT* ENTRY
  7301. SX1 X1+
  7302. ZR X1,RTFX IF NOT MIP TYPE FILE - RETURN
  7303. RECALL AFET
  7304. SA1 X4+TLNFW LINK TO FREE *TFCB* ENTRY
  7305. NZ X1,RTF1 IF FREE *TFCB* FOUND
  7306. SA1 X4+TLNOW LINK TO OPEN *TFCB* ENTRY
  7307. RTF1 SX0 X1+TFFTW-TFNFW FWA OF *FIT*
  7308. FETCH X0,XN,X5 GET INDEX FILE NAME FROM *FIT*
  7309. SX7 B1+
  7310. BX7 X7+X5 FORM FIRST WORD OF FET
  7311. SA7 AFET STORE INDEX FILE NAME IN FET+0
  7312. UNLOAD AFET RETURN INDEX FILE FOR MIP FILE
  7313. EQ RTFX RETURN
  7314.  
  7315. RTFA CON 0 FWA OF FILE *TLNT* ENTRY
  7316. SPACE 4,25
  7317. ** SBJ - SUBMIT BATCH JOB.
  7318. *
  7319. * THIS SUBROUTINE WRITES CONTROL CARDS ON THE LOCAL FILE
  7320. * *SBJN* AND SUBMITS IT AS A BATCH JOB. ONE OF THREE JOBS
  7321. * IS SUBMITTED, DEPENDING ON THE OPTION...
  7322. *
  7323. * OPT = 0, DUMP *ARF* AND RECOVER DATA FILE.
  7324. * = 1, DUMP *ARF*.
  7325. * = 2, DUMP *ARF* AND REALLOCATE *BRF*.
  7326. *
  7327. * ENTRY (B5) = FWA OF *TARF* ENTRY FOR *ARF*.
  7328. * (X6) = OPTION.
  7329. * (X5) = FWA OF *TLNT* ENTRY, IF OPTION = 0.
  7330. * = FWA OF *TBRF* ENTRY, IF OPTION = 2.
  7331. * (RDRF) = FWA OF CURRENT DATA BASE *TDRF* ENTRY.
  7332. *
  7333. * EXIT REGISTERS X0, B2, B3, B4, AND B5
  7334. * RESTORED ON EXIT.
  7335. * (X6) = ZERO IF NO ERROR.
  7336. * = *TERAK*, IF DATA BASE *EDT* ENTRY NOT FOUND.
  7337. *
  7338. * USES X - ALL.
  7339. * A - 1, 2, 3, 4, 5, 6, 7.
  7340. * B - 2, 3, 4, 5, 7.
  7341. *
  7342. * MACROS PUTFLD, REWIND, ROUTE, WRITEF, WRITEH.
  7343. *
  7344. * CALLS CDD, CDT, NMS, PPS, SBN, SED.
  7345.  
  7346.  
  7347. SBJ SUBR ENTRY/EXIT
  7348. SA6 SBJM SAVE OPTION
  7349. SX6 X0 SAVE REGISTERS
  7350. SX7 B2
  7351. SA6 SBJK X0
  7352. SA7 A6+B1 B2
  7353. SX6 B3
  7354. SX7 B4
  7355. SA6 A7+B1 B3
  7356. SA7 A6+B1 B4
  7357. SX7 B5
  7358. SA7 A7+1 B5
  7359. SX6 X5+ FWA OF *TLNT* OR *TBRF* (OPTION 0 OR 2)
  7360. SA6 SBJJ SAVE ADDRESS
  7361. SA2 B5+TAFFW *TARF* FET+0
  7362. MX0 TAFFN
  7363. BX6 X0*X2 *ARF* FILE NAME
  7364. SA6 SBJI STORE *ARF* FILE NAME
  7365. REWIND SBJN,R
  7366. SA1 RDRF FWA OF CURRENT DATA BASE *TDRF* ENTRY
  7367. SA1 X1+TDIDW DATA BASE ID LEFT JUSTIFIED
  7368. MX0 TDIDN
  7369. BX1 X0*X1 ISOLATE D.B. NAME
  7370. RJ SED FIND EDT FOR D.B.
  7371. ZR B7,SBJ6 IF *EDT* ENTRY NOT FOUND
  7372. SA1 B7+2 USER NUMBER
  7373. MX0 42
  7374. SA2 A1+B1 PASSWORD
  7375. BX6 X0*X1
  7376. BX7 X0*X2
  7377. SA6 SBJD
  7378. SA1 B7+6 FAMILY
  7379. SA7 A6+B1
  7380. BX6 X0*X1
  7381. SA6 A7+1
  7382. WRITEH SBJN,SBJA,2 WRITE *JOB* CARD
  7383. SA1 SBJC
  7384. SX6 SBJB
  7385. SX2 1R.
  7386. SX3 1R, DELIMITER
  7387. SA6 PPSA
  7388. SB5 4
  7389. RJ PPS CONSTRUCT *USER* CARD
  7390. WRITEH SBJN,SBJB,8 WRITE *USER* CARD
  7391. MX0 -18
  7392. SA2 SBJM PICK UP OPTION
  7393. BX6 X6-X6
  7394. SB5 2
  7395. NZ X2,SBJ2 IF NOT A FILE RECOVERY
  7396. SA5 SBJJ FWA OF DB FILE *TLNT* ENTRY
  7397. SA1 X5+TLFNW GET FILE NAME
  7398. MX7 TLFNN
  7399. BX7 X7*X1
  7400. SA7 SBJJ STORE FILE NAME
  7401. SB7 B1 *NO MULTI-UNIT* FLAG
  7402. SA1 X5+TLDVW PICK UP FILE DEVICE TYPE
  7403. BX1 -X0*X1
  7404. MX0 -TLUNN
  7405. ZR X1,SBJ2 IF NO DEVICE TYPE SPECIFIED
  7406. BX6 -X0*X1
  7407. ZR X6,SBJ1 IF NO MULTI-UNIT DEVICE
  7408. SB7 B0 *MULTI-UNIT* FLAG
  7409. SX1 X1+1R0
  7410. LX1 6
  7411. SBJ1 LX1 6
  7412. SX2 2R=1
  7413. BX6 X2+X1
  7414. SB5 B5+B1
  7415. ZR B7,SBJ2 IF A MULTI-UNIT DEVICE
  7416. LX6 6
  7417. SBJ2 LX6 30 LEFT-JUSTIFY IN A WORD
  7418. SA6 SBJF SET *DX=1* AS PARAMETER
  7419. SA1 SBJE
  7420. SX2 1R.
  7421. SX3 1R, DELIMITER
  7422. RJ PPS CONSTRUCT *RESOURC* CARD
  7423. WRITEH SBJN,SBJB,3
  7424. RJ SBN SET BATCH JOB SEQUENCE NUMBER
  7425. RJ CDD CONVERT BATCH ID NO.
  7426. MX0 1
  7427. SX7 1R.
  7428. SB2 B2-B1
  7429. AX0 X0,B2 MASK FOR SIGNIFICANT DIGITS
  7430. BX6 X0*X4
  7431. SB5 59-6
  7432. SB2 B5-B2
  7433. LX7 B2,X7 POSITION PERIOD
  7434. BX6 X6+X7 ADD PERIOD TO SEQUENCE NUMBER
  7435. SX3 B0 NO DELIMITER FOR *DMREC* CARD
  7436. SA6 SBJH BATCH ID PARAMETER
  7437. SA4 SBJM PICK UP OPTION
  7438. SX2 1R
  7439. SB5 SBJOP0L-SBJDMRC OPTION 0 *DMREC* CARD LENGTH
  7440. ZR X4,SBJ4 IF OPTION = 0 , DATA FILE DOWN
  7441. SB5 SBJOP1L-SBJDMRC OPTION 1 *DMREC* CARD LENGTH
  7442. AX4 1
  7443. NZ X4,SBJ5 IF OPTION .EQ. 2, *BRF* RECOVERY
  7444. SBJ4 SA1 SBJG BUILD *DMREC* CARD
  7445. RJ PPS
  7446. WRITEH SBJN,SBJB,8
  7447. WRITEF SBJN,R
  7448. REWIND SBJN,R
  7449. ROUTE SBJO,R
  7450. SA1 ZZZZZG9 FILE NAME FROM FET
  7451. MX7 42
  7452. BX7 X7*X1
  7453. SA1 SBJO PARAMETER BLOCK WORD 0
  7454. MX6 11
  7455. LX6 12
  7456. BX6 X6*X1 GET FORCED ORIGIN FLAG AND CODE
  7457. BX7 X7+X6 ADD FILE NAME FROM FET
  7458. SA7 A1+ RESTORE ROUTE PARAMETER BLOCK
  7459. SA2 SBJH BATCH JOB SEQUENCE NUMBER
  7460. SA5 RDRF FWA OF *TDRF* ENTRY
  7461. BX6 X2 JOB NUMBER
  7462. MX7 TDIDN DATA BASE ID MASK
  7463. SX1 MSGJ FWA OF BATCH JOB MESSAGE
  7464. SA6 MSGJA STORE NUMBER IN MESSAGE
  7465. SA2 X5+TDIDW DATA BASE ID
  7466. SA1 MSGJ FIRST WORD OF SUBMITTED MESSAGE
  7467. RJ NMS REPORT BATCH JOB SUBMITTED
  7468. SX6 B0 NO ERROR
  7469. EQ SBJ7 RESTORE REGISTERS
  7470.  
  7471. * OPTION 2 - *BRF* DOWN.
  7472.  
  7473. SBJ5 SA5 SBJJ FWA OF *TBRF* ENTRY
  7474. SA2 X5+TQFNW *BRF* NAME
  7475. SA5 X5+TQDDW PACKED DATA AND TIME
  7476. MX0 TQFNN FILE NAME MASK
  7477. BX6 X0*X2 ISOLATE FILE NAME
  7478. SA6 SBJJ STORE FILE NAME
  7479. BX1 -X0*X5 ISOLATE PACKED TIME
  7480. RJ CDT CONVERT TIME TO DISPLAY
  7481. SA6 SBJJ+2
  7482. SA1 A5
  7483. MX0 -18
  7484. AX1 18
  7485. BX1 -X0*X1 ISOLATE PACKED DATE
  7486. SX6 70D ADD BASE 70 TO YEAR
  7487. LX6 17-5
  7488. IX1 X1+X6
  7489. RJ CDT CONVERT DATE TO DISPLAY
  7490. SA6 SBJJ+4
  7491. SB5 SBJOP2L-SBJDMRC OPTION 2 *DMREC* CARD LENGTH
  7492. SX2 1R
  7493. SX3 B0+ NO DELIMITER
  7494. EQ SBJ4 PREPARE *DMREC* CARD
  7495.  
  7496. SBJ6 RJ IDB IDLE DATA BASE
  7497. SBJ7 SA1 SBJK RESTORE X0, B2, B3, B4, B5
  7498. SA2 A1+B1
  7499. SA3 A2+B1
  7500. SA4 A3+B1
  7501. SA5 A4+B1
  7502. SX0 X1
  7503. SB2 X2
  7504. SB3 X3
  7505. SB4 X4
  7506. SB5 X5+
  7507. EQ SBJX RETURN
  7508.  
  7509. SBJA DATA C DMREC,T37777.
  7510. SBJB BSS 8 CONTROL CARDS ARE CONSTRUCTED HERE
  7511. CON 0
  7512.  
  7513. SBJC DATA C USER
  7514. SBJD BSS 3 UN, PW, FAMILY
  7515.  
  7516. .A IFC NE,$"CGNM"$$
  7517. DATA C*CHARGE,"CGNM","PJNM".*
  7518. .A ENDIF
  7519. SBJE DATA C RESOURC
  7520. .B IFEQ DTTP,0
  7521. .C IFEQ TDEN,1
  7522. DATA C HI=1
  7523. .C ENDIF
  7524. .D IFEQ TDEN,2
  7525. DATA C LO=1
  7526. .D ENDIF
  7527. .E IFEQ TDEN,3
  7528. DATA C HY=1
  7529. .E ENDIF
  7530. .B ELSE
  7531. .F IFEQ TDEN,3
  7532. DATA C HD=1
  7533. .F ENDIF
  7534. .G IFEQ TDEN,4
  7535. DATA C PE=1
  7536. .G ENDIF
  7537. .H IFEQ TDEN,5
  7538. DATA C GE=1
  7539. .H ENDIF
  7540. .B ENDIF
  7541. SBJF BSS 1 POSSIBLE DEVICE
  7542.  
  7543. SBJDMRC EQU * FWA OF *DMREC* CONTROL CARD
  7544. SBJG DATA C DMREC,I=0,Z,TT=
  7545. SBJH BSS 1 BATCH ID
  7546. DATA C /*DUMP,
  7547. SBJI BSS 1 *ARF* NAME
  7548. SBJOP1L EQU * LWA+1 OF *DMREC* CARD FOR OPTION 1
  7549. DATA C /*RECOVER,
  7550. SBJJ BSS 1 PF OR *BRF* NAME
  7551. SBJOP0L EQU * LWA+1 OF *DMREC* CARD FOR OPTION 0
  7552. DATA C ,TIME=
  7553. CON 0 TIME IN DISPLAY HERE
  7554. DATA C ,DATE=
  7555. CON 0 DATE IN DISPLAY HERE
  7556. CON 0
  7557. SBJOP2L EQU * LWA+1 OF *DMREC* CARD FOR OPTION 2
  7558.  
  7559.  
  7560. SBJK BSS 5 SAVE REGISTERS X0, B2, B3, B4, B5
  7561. SBJM BSS 1 OPTION SAVED HERE
  7562.  
  7563. SBJN EQU *
  7564. ZZZZZG9 FILEC BUF,BUFL
  7565.  
  7566. * ROUTE PARAMETER BLOCK.
  7567.  
  7568. SBJO VFD 42/0LZZZZZG9,6/0,1/1,4/0,6/SYOT,1/0
  7569. VFD 12/0,12/1200B,12/2HIN,6/0,18/402022B
  7570. BSSZ 5
  7571. SPACE 4,10
  7572. ** SBN - SET BATCH JOB SEQUENCE NUMBER.
  7573. *
  7574. * ENTRY (RDRF) = FWA OF CURRENT DATA BASE *TDRF* ENTRY.
  7575. *
  7576. * EXIT (X1) = BATCH JOB SEQUENCE NUMBER.
  7577. *
  7578. * USES X - 1, 2, 3, 7.
  7579. * A - 1, 2, 3, 7.
  7580. *
  7581. * MACROS GETFLD, PUTFLD.
  7582.  
  7583.  
  7584. SBN SUBR ENTRY/EXIT
  7585. GETFLD 2,AMST,AMBJ GLOBAL BATCH JOB SEQUENCE COUNTER
  7586. SX1 B1
  7587. IX2 X2+X1 INCREMENT GLOBAL COUNT
  7588. PUTFLD 2,AMST,AMBJ
  7589. SA3 RDRF FWA OF *TDRF* ENTRY
  7590. GETFLD 1,X3,TDBJ BATCH JOB SEQUENCE NUMBERS
  7591. MX7 -TDJBN
  7592. BX7 -X7*X1 GET *TDJB* FIELD
  7593. ZR X7,SBN1 IF *TDJB* FIELD EMPTY
  7594. LX1 TDJAS-TDJAN+1 MOVE *TDJB* TO *TDJA* FIELD
  7595. SBN1 MX7 -TDJBN SEQUENCE NUMBER MASK
  7596. BX1 X7*X1 CLEAR *TDJBN* FIELD
  7597. BX2 X1+X2 ADD NEW NUMBER TO *TDJB* FIELD
  7598. PUTFLD 2,X3,TDBJ STORE NUMBERS
  7599. SX1 X2 NEW BATCH JOB SEQUENCE NUMBER
  7600. EQ SBNX RETURN
  7601.  
  7602.  
  7603. SPACE 4,10
  7604. ** SFM - SET FAMILY AND USER INDEX.
  7605. *
  7606. * ENTRY (X1) = USER INDEX, RIGHT JUSTIFIED.
  7607. * (X7) = FAMILY NAME, LEFT JUSTIFIED, IF NEW FAMILY.
  7608. * = ZERO, IF PREVIOUS FAMILY TO BE USED.
  7609. *
  7610. * EXIT (X1) = POSITIVE IF NO ERROR.
  7611. * (SFMA) = PREVIOUS FAMILY NAME.
  7612. * (X1) = NEGATIVE IF ILLEGAL FAMILY ERROR.
  7613. * (SFMA) = ILLEGAL FAMILY NAME, ERROR CODE IN BYTE 4.
  7614. * USER INDEX SET TO *TAF*S UI ON ERROR.
  7615. *
  7616. * USES X - 1, 2, 6, 7.
  7617. * A - 1, 6, 7.
  7618. *
  7619. * MACROS SETPFP.
  7620.  
  7621.  
  7622. SFM SUBR ENTRY/EXIT
  7623. BX6 X1
  7624. SA6 SFMA+2
  7625. NZ X7,SFM1 IF FAMILY SPECIFIED
  7626. SX2 3B *SETPFP* FLAGS
  7627. SA1 SFMB OLD FAMILY NAME
  7628. ZR X1,SFM2 IF NO OLD FAMILY
  7629. BX7 X1
  7630. SFM1 SA1 SFMA
  7631. BX6 X1
  7632. SA6 SFMB SAVE OLD FAMILY
  7633. SX2 13B *SETPFP* FLAGS
  7634. SFM2 MX1 42
  7635. BX7 X1*X7
  7636. BX7 X2+X7
  7637. SA7 SFMA
  7638. SETPFP SFMA SET PERMANENT FILE PARAMETERS
  7639. SA1 SFMA
  7640. LX1 59-12
  7641. PL X1,SFMX IF NO ERRORS
  7642. SA1 VUSN
  7643. SX6 TRUI
  7644. BX6 X1+X6
  7645. SA6 SFMA+2
  7646. SX2 3B *SETPFP* FLAGS
  7647. EQ SFM2 SET TAF-S USER INDEX
  7648.  
  7649. SFMA CON 0 FAMILY NAME
  7650. CON 0
  7651. CON 0
  7652. SFMB CON 0 OLD FAMILY NAME
  7653.  
  7654. SPACE 4,10
  7655. ** SLF - SWITCH TO ALTERNATE AFTER IMAGE RECOVERY FILE.
  7656. *
  7657. * ENTRY (B5) = FWA OF *TARF*.
  7658. * (RDRF) = FWA OF *TDRF*.
  7659. *
  7660. * USES X - 1, 2, 3, 5, 6, 7.
  7661. * A - 0, 1, 2, 3, 6, 7.
  7662. * B - 6, 7.
  7663. *
  7664. * MACROS GETFLD, PUTFLD, RETURN, REWIND,
  7665. * REWRITER, SKIPFF.
  7666. *
  7667. * CALLS ADF, CAT, FLR, FUI, LDN, RDH, SFM.
  7668.  
  7669.  
  7670. SLF SUBR ENTRY/EXIT
  7671. SA1 RDRF FWA OF CURRENT *TDRF*
  7672. SB6 X1+ FWA OF DATA BASE *TDRF* ENTRY
  7673. SA1 B6+TDIDW DATA BASE ID
  7674. RJ FUI SET DATA BASE USER NUMBER AND FAMILY
  7675. NZ X6,SLF1 IF NO *EDT* ENTRY OR ILLEGAL FAMILY
  7676. GETFLD 2,B6,TDLB LAST BIT OF ACTIVE *ARF* NAME
  7677. SX7 B1
  7678. BX2 X2-X7 TOGGLE LAST BIT TO CHANGE *ARF* NAME
  7679. PUTFLD 2,B6,TDLB CHANGE LAST BIT OF ACTIVE *ARF* NAME
  7680. PUTFLD 2,B5,TALB CHANGE *ARF* NAME IN FET
  7681. SB7 2 SPECIFY ATTACH RECOVERY FILE
  7682. SA1 B5+TAFFW FILE NAME FROM FET+0
  7683. RJ ADF ATTACH ALTERNATE *ARF*
  7684. SX6 X1 (ERROR FLAG)
  7685. SX7 B0 FOR PREVIOUS FAMILY
  7686. SA6 RNFE
  7687. SX1 TRUI *TAF* USER NUMBER
  7688. SA2 VUSN
  7689. BX1 X1+X2
  7690. RJ SFM RESTORE *TAF* USERNUMBER AND FAMILY
  7691. SA1 RNFE (ERROR FLAG FROM *ADF*)
  7692. NZ X1,SLF1 IF ATTACH ERROR
  7693. SA0 AFET SET FWA OF FET
  7694. RJ RDH READ *ARF* HEADER
  7695. NZ X1,SLF1 IF ERROR ON READ HEADER
  7696. SA1 BUF HEADER WORD 0 - *ARF* NAME / STATUS
  7697. SA2 B5+TAFFW *ARF* NAME FROM *TARF*
  7698. BX2 X1-X2
  7699. AX2 18
  7700. NZ X2,SLF1 IF NAME IN HEADER NOT SAME AS FILE NAME
  7701. MX7 -TASTN
  7702. BX2 -X7*X1 GET *ARF* STATUS FROM HEADER
  7703. SX7 X2-XHNA CHECK BATCH RECOVERY ACTIVE
  7704. ZR X7,SLF1 IF BATCH RECOVERY ACTIVE STATUS
  7705. SX7 X2-XHER CHECK *ARF* ERROR STATUS
  7706. ZR X7,SLF1 IF *ARF* ERROR STATUS
  7707. SX7 XHER *ARF* ERROR STATUS
  7708. BX7 X1+X7 SET *ARF* STATUS TO ERROR
  7709. SA7 A1 STORE *ARF* HEADER WORD 0
  7710. SA7 B5+TAFNW COPY HEADER WORD 0 TO *TARF* HEADER
  7711. SA1 A1+B1 FILE HEADER WORD 1
  7712. BX6 X1
  7713. SA6 A7+1 COPY HEADER WORD 1 TO *TARF* HEADER
  7714. SA1 BUF+3 HEADER WORD 3 - *ARF* LENGTH / BLOCK SIZE
  7715. SA2 B5+TAFLW COMPARE NEW *ARF* HEADER TO PREVIOUS
  7716. BX6 X1
  7717. SA6 A2 STORE NEW HEADER WORD 3
  7718. BX1 X1-X2
  7719. MX7 -TABLN
  7720. BX1 -X7*X1 COMPARE ONLY BLOCK LENGTH
  7721. SX6 B1 (RR)
  7722. NZ X1,SLF1 IF NEW *ARF* LENGTH/BLOCK-SIZE NOT VALID
  7723. SA6 A0+6 STORE CRI IN *AFET* FET+6
  7724. REWRITER A0,R REWRITE *ARF* HEADER AS ACTIVE
  7725. SX2 A0+ FWA OF FET
  7726. RJ CAT CHECK/CLEAR *AT* FIELD
  7727. NZ X1,SLF1 IF ERROR ON REWRITE HEADER
  7728. SA1 B5+TAFBW
  7729. MX7 -TAFBN
  7730. LX7 TAFBS-TAFBN+1
  7731. BX7 X7*X1 CLEAR *ARF* BUFFER FLUSHED FLAG
  7732. SA7 A1
  7733. SX5 B5+TAFFW FWA OF FET IN *TARF*
  7734. REWIND X5
  7735. SKIPFF X5,,R SKIP TO END OF FILE
  7736. SX2 X5+ FWA OF FET
  7737. RJ CAT CHECK/CLEAR *AT* FIELD
  7738. NZ X1,SLF1 IF ERROR ON SKIP
  7739. GETFLD 1,B5,TAFL *ARF* LENGTH FROM HEADER
  7740. SX6 B1+B1
  7741. GETFLD 2,B5,TARI CURRENT RANDOM INDEX FROM FET
  7742. SX7 B1
  7743. IX7 X2-X7 *RR* FOR BEFORE *EOF* POSSITION
  7744. SA7 A2 STORE *RR* IN FET+6
  7745. IX2 X7-X6 SUBTRACT 1 FOR HEADER AND 1 FOR EOR
  7746. IX6 X1-X2 GET UNUSED PRU COUNT
  7747. PUTFLD 6,B5,TACP STORE UNUSED PRU COUNT
  7748. ZR X6,SLF1 IF *ARF* FULL
  7749. SX6 B0+ NO ERROR
  7750. EQ SLFX RETURN
  7751.  
  7752. SLF1 RJ LDN DOWN *ARF*
  7753. RJ FLR RETURN *ARF*
  7754. SX6 B0
  7755. SA5 RDRF FWA OF *TDRF* ENTRY
  7756. PUTFLD 6,X5,TDLP CLEAR *ARF* LOCAL FLAG
  7757. EQ SLFX RETURN
  7758. SPACE 4,10
  7759. ** UDB - UP DATA BASE.
  7760. *
  7761. * ENTRY (RDRF) = FWA OF DATA BASE *TDRF* ENTRY.
  7762. *
  7763. * EXIT DATA BASE IS UP IF -
  7764. * (X6) = ZERO IF DATA BASE IS UP, NO ERRORS.
  7765. * = *TERAL*, IF NOT ALL DATA BASE FILES UP.
  7766. *
  7767. * DATA BASE REMAINS DOWN OR IDLE IF -
  7768. * = *TERB*, IF ERROR IN *EDT* ENTRY.
  7769. * = *TERAG*, IF DATA BASE IS IDLING DOWN.
  7770. * = *TERAK*, IF RECOVERY LOG FILES ARE DOWN.
  7771. * = *TERAM*, IF NO DATA BASE FILES UP.
  7772. *
  7773. * USES X - 1, 2, 5, 6, 7.
  7774. * A - 1, 2, 5, 6, 7.
  7775. * B - 3, 4, 5.
  7776. *
  7777. * MACROS PUTFLD, RETURN.
  7778. *
  7779. * CALLS FLR, NMS, UDF, ULF, UQF.
  7780.  
  7781.  
  7782. UDB SUBR ENTRY/EXIT
  7783. SA5 RDRF FWA OF DATA BASE *TDRF* ENTRY
  7784. SA1 X5+TDSDW
  7785. BX2 X1
  7786. LX2 59-TDSIS
  7787. SX6 TERAG DATA BASE IDLING DOWN ERROR CODE
  7788. NG X2,UDBX IF DATA BASE IS IDLING DOWN
  7789. SX6 B0+ NO ERROR IF DATA BASE ALREADY UP
  7790. PL X1,UDBX IF DATA BASE ALREADY UP
  7791.  
  7792. * DATA BASE IS DOWN - ATTEMPT TO UP DATA BASE.
  7793.  
  7794. MX7 -TDSIN
  7795. LX7 TDSIS-TDSIN+1
  7796. BX1 -X7+X1 SET DATA BASE IDLE FLAG
  7797. LX7 TDSDS-TDSIS
  7798. BX7 X7*X1 CLEAR DATA BASE DOWN FLAG
  7799. SA7 A1 STORE FLAGS
  7800. RJ ULF UP AFTER IMAGE RECOVERY FILE
  7801. SA6 RERR SAVE ERROR
  7802. NZ X6,UDB4 IF *ARF* NOT UP
  7803. RJ UQF UP BEFORE IMAGE RECOVERY FILES
  7804. SA6 RERR SAVE ERROR
  7805. NZ X6,UDB4 IF *BRF-S* NOT UP
  7806. SA5 RDRF FWA OF DATA BASE *TDRF* ENTRY
  7807. SA1 X5+TDNLW LINK TO FIRST DATA BASE *TLNT* ENTRY
  7808. SA2 X5+TDLLW LINK TO LAST DATA BASE *TLNT* ENTRY
  7809. LX1 TDNLN-1-TDNLS RIGHT JUSTIFY ADDRESS
  7810. LX2 TDLLN-1-TDLLS RIGHT JUSTIFY ADDRESS
  7811. SB3 X1 FWA OF FIRST DATA BASE *TLNT* ENTRY
  7812. SB4 X2 FWA OF LAST DATA BASE *TLNT* ENTRY
  7813. RJ UDF UP DATA BASE FILES
  7814. NZ X6,UDB2 IF ERROR IN *EDT* ENTRY
  7815. SX6 TERAM NO FILES ATTACHED ERROR CODE
  7816. ZR X2,UDB2 IF NO DATA BASE FILES UP
  7817. SX6 TERAL NOT ALL FILES UP ERROR CODE
  7818. NZ X1,UDB1 IF NOT ALL DATA BASE FILES UP
  7819. SX6 B0+ NO ERROR ALL FILES ATTACHED
  7820.  
  7821. * SET DATA BASE UP.
  7822.  
  7823. UDB1 SA6 RERR SAVE POSSIBLE NON FATAL ERROR
  7824. SA5 RDRF FWA OF DATA BASE *TDRF* ENTRY
  7825. MX7 TDSDN+TDSIN
  7826. SX6 B0
  7827. SA1 X5+TDSDW DOWN AND IDLE STATUS WORD
  7828. BX7 -X7*X1 CLEAR DOWN AND IDLE STATUS BITS
  7829. SA7 A1 STORE UP STATUS
  7830. SA1 X5+TDRQW CLEAR IDLE DOWN FLAGS
  7831. MX7 60-TDRQN-TDRLN-TDODN
  7832. ERRNZ TDRQS-TDRLS-1 *ARF* AND *BRF* NOT ADJACENT
  7833. ERRNZ TDRLS-TDODS-1 *BRF* AND *OP* NOT ADJACENT
  7834. LX7 TDODS-TDODN+1
  7835. BX7 X7*X1
  7836. SA7 A1 UPDATE *TDRQW* WORD
  7837. SA6 X5+TDBGW CLEAR NUMBER OF BEGINS
  7838. SA6 X5+TDCMW CLEAR NUMBER OF COMMITS
  7839. SA6 X5+TDFRW CLEAR NUMBER OF FREES
  7840. SA6 TDRQW CLEAR IDLE/DOWN COUNTS AND FLAGS
  7841. SA2 RERR ERROR FLAG
  7842. SX6 X2+
  7843. SA1 MSGE DATA BASE UP MESSAGE
  7844. EQ UDB5 REPORT DATA BASE UP
  7845.  
  7846. * NO DATA BASE FILES ATTACHED.
  7847.  
  7848. UDB2 SA6 RERR SAVE ERROR CODE
  7849. SA5 RDRF FWA OF DATA BASE *TDRF* ENTRY
  7850. SA1 X5+TDALW FWA OF DATA BASE *TARF* ENTRY
  7851. SB5 X1 FWA OF *TARF* ENTRY
  7852. ZR B5,UDB4 IF DATA BASE NOT RECOVERABLE
  7853. RJ FLR RETURN LOCAL *ARF*
  7854. SA5 RDRF FWA OF DATA BASE *TDRF* ENTRY
  7855. SA1 X5+TDQLW LINK TO FIRST DATA BASE *TBRF* ENTRY
  7856. LX1 TDQLN-1-TDQLS RIGHT JUSTIFY ADDRESS
  7857. UDB3 SB5 X1+ FWA OF *TBRF* ENTRY
  7858. ZR B5,UDB4 IF ALL *BRF-S* RETURNED
  7859. SX1 B5+TQFFW FWA OF FET IN *TBRF* ENTRY
  7860. RETURN X1 RETURN *BRF*
  7861. SA1 B5+TQNLW LINK TO NEXT DATA BASE *TBRF* ENTRY
  7862. EQ UDB3 PROCESS NEXT *BRF*
  7863.  
  7864. * SET DATA BASE DOWN CONDITIONS.
  7865.  
  7866. UDB4 MX7 -TDSIN
  7867. LX7 TDSIS-TDSIN+1
  7868. SA1 X5+TDSDW DATA BASE DOWN AND IDLE FLAG WORD
  7869. BX1 X7*X1 CLEAR IDLE FLAG
  7870. LX7 TDSDS-TDSIS
  7871. BX7 -X7+X1 SET DOWN FLAG
  7872. SA7 A1 STORE DOWN STATUS
  7873. SX2 B0+
  7874. PUTFLD 2,X5,TDLP CLEAR LOCAL *ARF* FLAG
  7875. SA1 MSGA DATA BASE DOWN MESSAGE
  7876.  
  7877. * REPORT DATA BASE STATUS.
  7878.  
  7879. UDB5 MX7 TDIDN DATA BASE ID MASK
  7880. SA2 X5+TDIDW DATA BASE ID
  7881. RJ NMS REPORT DATA BASE STATUS
  7882. SA1 RERR ERROR CODE IF ANY
  7883. SX6 X1+
  7884. EQ UDBX RETURN
  7885.  
  7886. SPACE 4,10
  7887. ** UDF - UP DATA BASE FILE.
  7888. *
  7889. * ENTRY (B3) = FWA OF *TLNT* ENTRY OF FIRST FILE.
  7890. * (B4) = FWA OF *TLNT* ENTRY OF LAST FILE.
  7891. *
  7892. * EXIT (X1) = *TERAM*, IF FILE(S) NOT ATTACHED.
  7893. * (X2) = NUMBER OF FILES ATTACHED.
  7894. * (X6) = *TERB*, IF ERROR IN *EDT* ENTRY.
  7895. * = ZERO, IF NO ERROR.
  7896. *
  7897. * USES X - 0, 1, 2, 4, 6, 7.
  7898. * A - 1, 2, 4, 7.
  7899. * B - 3, 7.
  7900. *
  7901. * MACROS FETCH, RECALL, RETURN.
  7902. *
  7903. * CALLS ADF, FUI, NMS, RFN, SFM.
  7904.  
  7905.  
  7906. UDF SUBR ENTRY/EXIT
  7907. SX7 B0+
  7908. SA7 UDFA CLEAR ATTACHED FILE COUNT
  7909. SA1 B3+TLFNW DATA BASE ID IN FILE NAME
  7910. RJ FUI SET DATA BASE USER NUMBER AND FAMILY
  7911. NZ X6,UDFX IF ERROR IN *EDT* ENTRY
  7912.  
  7913. * ATTEMPT ATTACH OF DATA BASE DATA FILE.
  7914.  
  7915. UDF1 SA1 B3 FILE NAME FROM *TLNT* ENTRY
  7916. SX7 B3
  7917. SA7 RLNT
  7918. SB7 B0 SPECIFY ATTACH DATA FILE
  7919. RJ ADF ATTEMPT ATTACH DATA FILE
  7920. NZ X1,UDF2 IF FILE ATTACH ERROR
  7921. SA1 B3+TLNAW NUMBER OF ALTERNATE KEYS
  7922. SX1 X1+
  7923. ZR X1,UDF3 IF NOT MIP TYPE FILE
  7924.  
  7925. * ATTEMPT ATTACH OF INDEX FILE.
  7926.  
  7927. SA1 B3+TLNFW FREE LINK
  7928. SX0 X1+TFFTW-TFNFW FWA OF *FIT*
  7929. FETCH X0,XN,X1,1 INDEX FILE NAME
  7930. SB7 B0 SPECIFY ATTACH DATA FILE
  7931. RJ ADF ATTEMPT ATTACH INDEX FILE
  7932. ZR X1,UDF3 IF INDEX FILE ATTACHED
  7933. MX7 TLFNN FILE NAME MASK
  7934. SA1 B3 FILE NAME FROM *TLNT*
  7935. BX7 X7*X1
  7936. SX2 B1+ COMPLETE BIT
  7937. BX7 X7+X2
  7938. SA7 AFET STORE FIRST WORD OF FET
  7939. RETURN AFET RETURN DATA FILE
  7940.  
  7941. * FILE CANNOT BE ATTACHED.
  7942.  
  7943. UDF2 MX7 TLFNN
  7944. SA2 B3 FILE NAME FROM *TLNT*
  7945. SA1 MSGC FILE DOWN MESSAGE
  7946. RJ NMS REPORT FILE DOWN
  7947. SX7 TERAM FILE CANNOT BE ATTACHED/UP ERROR CODE
  7948. SA7 RNFE STORE NON FATAL ERROR
  7949. RECALL AFET WAIT FOR COMPLETION
  7950. EQ UDF4 CHECK IF MORE FILES TO ATTACH
  7951.  
  7952. * FILE ATTACHED, SET FILE UP STATUS.
  7953.  
  7954. UDF3 MX6 TLFDN+TLFIN
  7955. MX7 TLBRN+TLFEN
  7956. SA2 B3+TLFDW
  7957. BX6 -X6*X2 CLEAR *DOWN* AND *IDLE BITS
  7958. LX7 TLBRS-59
  7959. BX7 -X7*X6 CLEAR FILE DOWN FOR RECOVERY/*CRM*
  7960. SA7 A2
  7961. SA4 B3+TLNFW FWA OF NEXT FREE *TFCB* LINK
  7962. RJ RFN CLEAR *FIT* FNF/ES FIELDS
  7963. SX6 B1
  7964. SA1 UDFA COUNT OF ATTACHED FILES
  7965. IX7 X1+X6 INCREMENT COUNT
  7966. SA7 A1 STORE NEW COUNT OF ATTACHED FILES
  7967. MX7 TLFNN FILE NAME MASK
  7968. SA1 MSGF FILE UP MESSAGE
  7969. SA2 B3+TLFNW FILE NAME FROM *TLNT*
  7970. RJ NMS REPORT FILE UP
  7971.  
  7972. * CHECK IF MORE FILES TO ATTACH.
  7973.  
  7974. UDF4 GE B3,B4,UDF5 IF ALL FILES PROCESSED
  7975. SA1 B3 LINK TO NEXT *TLNT* ENTRY
  7976. SB3 X1 FWA OF NEXT *TLNT* ENTRY
  7977. EQ UDF1 PROCESS NEXT FILE
  7978.  
  7979. * RESTORE *TAF* USER NUMBER AND FAMILY.
  7980.  
  7981. UDF5 SX7 B0+ USE PREVIOUS FAMILY (*TAF*)
  7982. SX1 TRUI *TAF* USER NUMBER
  7983. SA2 VUSN
  7984. BX1 X1+X2
  7985. RJ SFM RESTORE *TAF* USER AND FAMILY
  7986. SX6 B0+
  7987. SA2 UDFA NUMBER OF ATTACHED FILES
  7988. SA1 RNFE ERROR CODE IF ANY FILE NOT ATTACHED
  7989. EQ UDFX RETURN
  7990.  
  7991. UDFA BSS 1 COUNT OF ATTACHED FILES
  7992. SPACE 4,10
  7993. ** UQF - UP BEFORE IMAGE RECOVERY FILES.
  7994. *
  7995. * ENTRY (RDRF) = FWA OF DATA BASE *TDRF* ENTRY.
  7996. *
  7997. * EXIT (X6) = *TERB*, IF ERROR IN *EDT* ENTRY.
  7998. * = *TERAG*, IF *BRF-S* DOWN.
  7999. * = ZERO, IF DATA BASE *BRF-S* UP.
  8000. *
  8001. * USES X - 1, 2, 5, 6, 7.
  8002. * A - 0, 1, 2, 5, 6, 7.
  8003. * B - 4, 5, 7.
  8004. *
  8005. * MACROS PUTFLD, RETURN.
  8006. *
  8007. * CALLS ADF, FLR, FUI, NMS, RDH, SFM, VQH.
  8008.  
  8009.  
  8010. UQF SUBR ENTRY/EXIT
  8011. SA5 RDRF FWA OF DATA BASE *TDRF* ENTRY
  8012. SA1 X5+TDIDW DATA BASE ID
  8013. RJ FUI SET DATA BASE USER AND FAMILY
  8014. NZ X6,UQFX IF ERROR IN *EDT* ENTRY
  8015. SA1 X5+TDQLW FWA OF FIRST DATA BASE *TBRF* ENTRY
  8016. LX1 TDQLN-1-TDQLS RIGHT JUSTIFY ADDRESS
  8017.  
  8018. * ATTEMPT TO ATTACH BEFORE IMAGE RECOVERY FILE.
  8019.  
  8020. UQF1 SB4 X1 FWA OF *TBRF* ENTRY
  8021. SX6 B0 NO ERROR
  8022. ZR B4,UQF5 IF ALL DATA BASE *TBRF-S* PROCESSED
  8023. SB7 2 (B7) = 2 FOR *BRF* ATTACH
  8024. SA1 B4+TQFFW FILE NAME FROM *TBRF* FET
  8025. RJ ADF ATTEMPT ATTACH OF *BRF*
  8026. NZ X1,UQF3 IF ATTACH ERROR
  8027. SA0 B4+TQFFW FWA OF *TBRF* FET
  8028. RJ RDH READ *BRF* HEADER
  8029. NZ X1,UQF3 IF READ ERROR
  8030. RJ VQH VALIDATE *BRF* HEADER
  8031. NZ X6,UQF3 IF INVALID HEADER
  8032.  
  8033. * CLEAN-UP *TBRF* ENTRY.
  8034.  
  8035. PUTFLD 6,B4,TQSQ CLEAR ANY OLD RESERVE
  8036. MX7 TQSTN+TQEAN+TQBIN+TQDIN
  8037. SA2 B4+TQSTW STATUS WORD
  8038. BX7 -X7*X2 CLEAR OLD STATUS BITS
  8039. SA7 A2
  8040. SA1 B4+TQNLW FWA OF NEXT *TBRF* ENTRY
  8041. SX7 .TQRFE-1 NUMBER OF BIT MAP WORDS LESS ONE
  8042. SX6 B0+
  8043. SA6 B4+TQBMW CLEAR FIRST BIT MAP WORD
  8044. UQF2 ZR X7,UQF1 IF ALL BIT MAP WORDS CLEARED
  8045. SX7 X7-1
  8046. SA6 A6+1 CLEAR NEXT BIT MAP WORD
  8047. EQ UQF2 CHECK IF ALL CLEARED
  8048.  
  8049. * RETURN ALL ATTACHED *BRF-S* IF ERROR ON ANY ONE.
  8050.  
  8051. UQF3 SA1 X5+TDQLW FWA OF FIRST *TBRF* ENTRY
  8052. LX1 TDQLN-1-TDQLS RIGHT JUSTIFY ADDRESS
  8053. UQF4 SB5 X1+ FWA OF *TBRF* ENTRY
  8054. SX2 B5+TQFFW FWA OF FET
  8055. RETURN X2 RETURN *BRF*
  8056. SA1 B5+TQNLW FWA OF NEXT *TBRF* ENTRY
  8057. NE B5,B4,UQF4 IF MORE *BRF-S* TO RETURN
  8058. SA1 MSGB *BRF* DOWN MESSAGE
  8059. SA2 B4+TQFFW *BRF* FILE NAME
  8060. MX7 TQFFN
  8061. RJ NMS REPORT NAME OF *BRF*
  8062. SA1 X5+TDALW FWA OF DATA BASE *TARF* ENTRY
  8063. SB5 X1+
  8064. RJ FLR RETURN *ARF*
  8065. SX6 TERAK *BRF* FILE DOWN ERROR CODE
  8066.  
  8067. * RESTORE *TAF* USER NUMBER AND FAMILY.
  8068.  
  8069. UQF5 SA6 RERR SAVE ERROR
  8070. SA1 VUSN
  8071. SX7 TRUI
  8072. BX1 X1+X7
  8073. SX7 B0+ USE PREVIOUS FAMILY (*TAF*)
  8074. RJ SFM RESTORE *TAF* USER AND FAMILY
  8075. BX3 X3-X3 CLEAR BRF DOWN FLAG
  8076. SA2 RDRF
  8077. PUTFLD 3,X2,TDQD
  8078. SA1 RERR ERROR CODE IF ANY
  8079. SX6 X1+
  8080. EQ UQFX RETURN
  8081. SPACE 4,10
  8082. ** VQH - VALIDATE BEFORE IMAGE RECOVERY FILE HEADER.
  8083. *
  8084. * ENTRY (A0) = FWA OF FET.
  8085. * (B4) = FWA OF *TBRF*.
  8086. *
  8087. * EXIT (X6) = ZERO, IF NO ERROR.
  8088. * = 5, IF BEFORE IMAGE RECOVERY FILE INCONSISTENT.
  8089. *
  8090. * USES X - 1, 2, 6, 7.
  8091. * A - 1, 2, 7.
  8092. * B - 6, 7.
  8093.  
  8094.  
  8095. VQH SUBR ENTRY/NO ERROR EXIT
  8096. SA1 B4+TQFTW
  8097. SB7 B4+TQFNW FWA OF HEADER IN *TBRF*
  8098. SB6 X1 FWA OF BUFFER (*FIRST*)
  8099. SA1 B7 GET HEADER WORD 1 FROM *TBRF*
  8100. SA2 B6 GET HEADER WORD 1 FROM BUFFER
  8101. IX1 X1-X2 COMPARE
  8102. MX7 -TQQNN
  8103. SX6 5 RECOVERY FILE INCONSISTENT ERROR CODE
  8104. NZ X1,VQHX IF HEADER WORD 1 NOT SAME
  8105. SA1 A1+B1 HEADER WORD 2 FROM *TBRF*
  8106. SA2 A2+B1 HEADER WORD 2 FROM BUFFER
  8107. BX1 X1-X2
  8108. BX1 -X7*X1
  8109. NZ X1,VQHX IF NUMBER OF *BRF-S* NOT SAME
  8110. BX7 X2 CREATION DATE/TIME + NUMBER OF *BRF-S*
  8111. SA7 A1 SET HEADER IN *TBRF*
  8112. SA1 A1+B1 HEADER WORD 3 FROM *TBRF*
  8113. SA2 A2+B1 HEADER WORD 3 FROM BUFFER
  8114. IX6 X1-X2 COMPARE
  8115. ZR X6,VQHX IF HEADER VALID
  8116. SX6 5 RECOVERY FILE INCONSISTENT ERROR CODE
  8117. EQ VQHX RETURN
  8118.  
  8119. SPACE 4,10
  8120. ** WAI - WRITE AFTER IMAGE BUFFER TO *ARF*.
  8121. *
  8122. * IF ENTRY CONDITION IS FORCE BUFFER FLUSH (B7 = 1) OR
  8123. * IF THE AFTER IMAGE BUFFER IS FULL, IT IS WRITTEN
  8124. * TO THE ACTIVE AFTER IMAGE RECOVERY FILE (*ARF*) VIA
  8125. * *REWRITEF* REQUEST.
  8126. * NOTE - THE *ARF* BUFFER IS NEVER ALLOWED TO BE FULL
  8127. * SO THAT A SHORT PRU WITH EOR IS ALWAYS WRITTEN.
  8128. * THE BUFFER LENGTH MUST BE AN EVEN MULTIPLE OF 64,
  8129. * AND *LIMIT*-2 IS USED AS LAST WORD.
  8130. *
  8131. * ENTRY (B5) = FWA OF *TARF*.
  8132. * (B7) = 1, IF FORCE BUFFER FLUSH.
  8133. * = 0, IF FLUSH IF BUFFER FULL.
  8134. *
  8135. * USES X - 1, 2, 3, 5, 6, 7.
  8136. * A - 1, 2, 3, 5, 6, 7.
  8137. *
  8138. * MACROS GETFLD, PUTFLD, REWRITEF, REWRITER.
  8139. *
  8140. * CALLS FLR, LBJ, SBJ, SLF.
  8141.  
  8142.  
  8143.  
  8144. WAI SUBR ENTRY/EXIT
  8145. GETFLD 1,B5,TAIN *ARF* FET *IN* POINTER
  8146. GETFLD 2,B5,TALM *ARF* FET *LIMIT* POINTER
  8147. SX2 X2-2 *LIMIT* - 2 SO ALWAYS UNUSED WORD
  8148. IX6 X2-X1 UNUSED WORD COUNT
  8149. GETFLD 3,B5,TAIS MAXIMUM AFTER IMAGE RECORD SIZE IN WORDS
  8150. IX6 X6-X3 LESS MAX AFTER IMAGE RECORD SIZE
  8151. GETFLD 3,B5,TAFT *ARF* FET *FIRST* POINTER
  8152. NZ B7,WAI1 IF FORCE FLUSH BUFFER REQUESTED
  8153.  
  8154. * NORMAL CALL TO LOG AFTER IMAGE
  8155.  
  8156. PL X6,WAIX IF ROOM FOR NEXT IMAGE
  8157.  
  8158. * FLUSH *ARF* BUFFER AND UPDATE UNUSED PRU COUNT.
  8159.  
  8160. WAI1 SX6 X3 *FIRST*
  8161. SA6 B5+TAOTW SET *OUT* .EQ. *FIRST*
  8162. IX2 X1-X3 NUMBER OF WORDS TO WRITE
  8163. ZR X2,WAI3 IF EMPTY BUFFER
  8164. AX2 6 NUMBER OF PRU_S BEFORE ROUND-UP
  8165. SX3 X2+B1 INCREMENT NUMBER OF PRU-S TO WRITE
  8166. WAI2 GETFLD 1,B5,TACP UNUSED PRU COUNT
  8167. IX5 X1-X3 LESS NUMBER OF PRU*S TO BE WRITTEN
  8168. SX2 B5+TAFFW SET FWA OF *ARF* FET
  8169. PUTFLD 5,B5,TACP STORE NEW *ARF* UNUSED PRU COUNT
  8170. REWRITEF X2 WRITE - DATA+EOR AND EOF
  8171. WAI3 MX7 -TAFBN
  8172. LX7 TAFBS-TAFBN+1
  8173. SA1 B5+TAFBW BUFFER FLUSHED FLAG WORD
  8174. BX7 -X7+X1 SET *ARF* BUFFER FLUSHED FLAG
  8175. SA7 A1
  8176. GETFLD 1,B5,TABL MAXIMUM BLOCK SIZE IN WORDS
  8177. AX1 6 CONVERT TO PRU*S
  8178. GETFLD 2,B5,TACP UNUSED *ARF* PRU COUNT
  8179. IX1 X2-X1
  8180. SA5 RDRF FWA OF CURRENT *TDRF* ENTRY
  8181. SA2 X5+TDSDW DATA BASE DOWN FLAG
  8182. NG X2,WAIX IF DATA BASE DOWN
  8183. PL X1,WAIX IF ROOM FOR NEXT BLOCK
  8184.  
  8185. * PREPARE A BATCH JOB TO DUMP *ARF*,
  8186. * SWITCH TO ALTERNATE *ARF* IF POSSIBLE.
  8187.  
  8188. SX2 B0+
  8189. PUTFLD 2,B5,TACP CLEAR UNUSED PRU COUNT FOR *FLR*
  8190. RJ FLR RETURN *ARF*
  8191. RJ LBJ BUILD AND SUBMIT BATCH JOB
  8192. RJ SLF SWITCH TO ALTERNATE *ARF* IF POSSIBLE
  8193. EQ WAIX RETURN
  8194.  
  8195. SPACE 4,10
  8196. ** WBI - WRITE BEFORE IMAGE RECORD TO *BRF*.
  8197. *
  8198. * THE BEFORE IMAGE RECORD, AS CONTAINED IN THE ASSIGNED
  8199. * *TBRF-S* BUFFER, IS WRITTEN TO THE *BRF* VIA
  8200. * *REWRITER* REQUEST WITHOUT RECALL. THE *TBRF* FET
  8201. * HAS BEEN PRESET.
  8202. *
  8203. * ENTRY (B2) = FWA OF *TSEQ*.
  8204. * (B5) = FWA OF *TBRF*.
  8205. *
  8206. * USES X - 1, 2, 7.
  8207. * A - 1, 2, 7.
  8208. * B - NONE.
  8209. *
  8210. * MACROS GETFLD, PUTFLD, REWRITER.
  8211.  
  8212.  
  8213. WBI SUBR ENTRY/EXIT
  8214. SA1 B5+TQFTW *FIRST* FROM *BRF* FET
  8215. SA2 B5+TQLMW *LIMIT* FROM *BRF* FET
  8216. SX7 X2-2 INSURE WORDS NOT MULTIPLE OF PRU*S
  8217. SA7 B5+TQINW SET *IN* .EQ. *LIMIT* - 2
  8218. SX7 X1
  8219. SA7 A7+B1 SET *OUT* .EQ. *FIRST*
  8220. GETFLD 1,B2,TSQR GET RELATIVE SECTOR ADRS. FROM *TSEQ*
  8221. BX7 X1
  8222. SA7 B5+TQRRW SET *RR* IN *BRF* FET
  8223. SX2 B5+TQFFW FWA OF *BRF* FET IN *TBRF*
  8224. REWRITER X2 WRITE BEFORE IMAGE TO BRF
  8225. SA1 B5+TQBIW
  8226. MX7 -TQBIN
  8227. LX7 TQBIS-TQBIN+1
  8228. BX7 X7*X1
  8229. SA7 A1 CLEAR BEFORE IMAGE WRITE PENDING FLAG
  8230. SX2 B2 SET TASK WRITING BEFORE IMAGE
  8231. PUTFLD 2,B5,TQSI STORE FWA *TSEQ* IN *TBRF*
  8232. GETFLD 2,B2,TSBI
  8233. SX1 B1
  8234. IX2 X2+X1 INCREMENT BEFORE IMAGE COUNT
  8235. PUTFLD 2,B2,TSBI STORE NUMBER OF BEFORE IMAGES ON *BRF*
  8236. ZR X2,WBIX IF BEFORE IMAGE COUNT ZERO
  8237. GETFLD 2,B2,TSQR
  8238. GETFLD 1,B5,TQPI NUMBER OF PRU*S PER BEFORE IMAGE RECORD
  8239. IX2 X2+X1 INCREMENT MS ADRS. OF NEXT BEFORE IMAGE
  8240. PUTFLD 2,B2,TSQR STORE NEXT *BRF* PRU MS ADRS.
  8241. EQ WBIX RETURN
  8242.  
  8243.  
  8244.  
  8245.  
  8246.  
  8247. TITLE INITIALIZATION CODE.
  8248. BUF BSS 65D SCRATCH BUFFER FOR *SBJ* AND *SLF*
  8249. BUFL EQU *-BUF SCRATCH BUFFER LENGTH
  8250. BUFF BSS 0 START OF BUFFERS FOR QUEUES
  8251.  
  8252. * ADVANCED ACCESS METHODS INITIALIZATION CODE.
  8253. * THIS CODE IS LATER USED FOR THE INPUT AND OUTPUT QUEUES.
  8254.  
  8255. TINT BSS 0 INITIALIZATION TABLE FOR *TJ* OPDEF
  8256. TINST HERE CODE FOR INITIALIZING OPDEFS
  8257. TINTL EQU *-TINT LENGTH OF INITIALIZATION *TJ* TABLE
  8258.  
  8259. * TABLE FOR EXTERNAL ROUTINES EXISTING IN THE
  8260. * TRANSACTION EXECUTIVE USED BY *AAMI*.
  8261.  
  8262. TTRT BSS 0 TABLE OF TRANSACTION ROUTINES
  8263. MVE= BSS 1 ENTRY POINT FOR *MVE=*
  8264. GRA BSS 1 ENTRY POINT FOR *GRA*
  8265. TCM BSS 1 ENTRY POINT FOR *TCM*
  8266.  
  8267. * *TFIT* CONTAINS THE INITIAL *FIT* FOR *CRM*. THIS *FIT*
  8268. * IS MODIFIED BY PARAMETERS FROM THE *CRM* CARD IN THE *XXJ*
  8269. * FILE.
  8270.  
  8271. TFIT FILE FWI=YES,ORG=NEW,FO=IS,EX=CEX
  8272. TFITL EQU *-TFIT
  8273. IAM SPACE 4,25
  8274. SPACE 4,10
  8275. ** INITIALIZATION MESSAGES.
  8276. *
  8277. * NOTE - ASSEMBLY AREA IN *NMS* SHOULD BE INCREASED IF
  8278. * MESSAGE LONGER THAN 50 CHARACTERS IS ADDED.
  8279. * ROUTINE *NMS* USES PLUS CHARACTER (+)
  8280. * AS SEARCH CHARACTER FOR *SNM*.
  8281.  
  8282. IMSA DATA C*$RECFILE HEADER ERROR.*
  8283. IMSB DATA C/ BEGIN *CRM* TASK RECOVERY./
  8284. IMSC DATA C* +++++++ - BRF RECOVERY FILE.*
  8285. IMSD DATA C* +++++++ - TASK RECOVERED.*
  8286. IMSE DATA C* +++++++ - TASK RECOVERY FAILED.*
  8287. IMSF DATA C* +++++++ - FILE TABLE ENTRY NOT FOUND.*
  8288. IMSG DATA C* +++++++ - FILE, ERROR ON OPEN FUNCTION.*
  8289. IMSH DATA C* +++++++ - FILE, ERROR ON LOCK FUNCTION.*
  8290. IMSI DATA C* ++ - INITIALIZE RECOVERY FILES.*
  8291. IMSJ DATA C* +++++++ - FILE ALLOCATION.*
  8292. IMSK DATA C* RECOVERY FILE INITIALIZATION ERROR.*
  8293. IMSL DATA C/ *CRM* TASK RECOVERY IMPOSSIBLE./
  8294. IMSM DATA C/ *CRM* TASK RECOVERY COMPLETE./
  8295. IMSN DATA C/ *CMM* ERROR./
  8296. IMSO DATA C* ++ - RECOVERABLE DATA BASE.*
  8297. IMSP DATA C* +++++++ - VALIDATION.*
  8298. IMSQ DATA C* +++++++ - ACTIVE ARF.*
  8299. SPACE 4,10
  8300. ** IAM - INITIALIZE ACCESS METHOD.
  8301. *
  8302. * ENTRY (B5) = 0, IF *CRM* CARD PROCESSING.
  8303. * 1, IF INITIALIZING EXTERNAL ROUTINES.
  8304. * 2, IF *IXN* CARD PROCESSING.
  8305. * 3, IF *AKY* CARD PROCESSING.
  8306. * 4, IF ALLOCATING FILE CONTROL ENTRIES.
  8307. * 5, IF ALLOCATING RECORD BUFFER.
  8308. * 6, IF INITIALIZING RECOVERY LOG FILES.
  8309. * 7, IF RECOVERY MODE PRESET CALL.
  8310. * 8, IF *BRF* CARD PROCESSING.
  8311. * (B2) = *TTIP* TABLE OF PARAMETERS.
  8312. * (B3) = FWA OF *CRM* STATUS WORD, IF (B5) = 1.
  8313. * (X6) = 24/0,18/CMMEFL,18/CMMBFL IF (B5) .EQ. 5.
  8314. * (X7) = BIT COUNT OF FILE ORGANIZATIONS, IF (B5) = 5.
  8315. *
  8316. * EXIT (X6) = 0, IF NO ERRORS.
  8317. * 1, IF NOT ENOUGH FIELD LENGTH FOR RECORD.
  8318. * 2, IF NOT ENOUGH FIELD LENGTH FOR USERS.
  8319. * 3, IF NOT ENOUGH FIELD LENGTH FOR LOCKS.
  8320. * 4, IF NOT ENOUGH FIELD LENGTH FOR *CMM*.
  8321. * 5, IF RECOVERY FILE INCONSISTENT.
  8322. * 6, IF RECOVERY ATTACH/DEFINE ERROR.
  8323. * 7, IF RECOVERY IMPOSSIBLE.
  8324. * 10, IF TWO ACTIVE AFTER IMAGE RECOVERY FILES.
  8325. * 11, IF AFTER IMAGE RECOVERY FILE FULL.
  8326. * 12, IF CIO ERROR ON RECOVERY FILE.
  8327. * 13, IF NOT ENOUGH FL FOR RECOVERY BUFFERS.
  8328. * 14, IF DATA BASE ENTRY NOT IN *EDT*.
  8329. * 15, IF ILLEGAL FAMILY NAME IN *EDT*.
  8330. * 16, IF BATCH RECOVERY ACTIVE ON DATA BASE.
  8331. * 17, IF *ARF* BLOCK SIZE .GT. BUFFER SIZE.
  8332. * 20, IF NOT ENOUGH FL FOR RECOVERY TABLES.
  8333. * 21, IF BFL NOT LARGE ENOUGH.
  8334. * IF ALLOCATING A RECORD RECORD BUFFER.
  8335. * (B2) = BFL-(FSTT+FIT+CMMCAP).
  8336. *
  8337. * USES X - ALL.
  8338. * A - 1, 2, 3, 4, 5, 6, 7.
  8339. * B - 2, 3, 4, 5, 6, 7.
  8340. *
  8341. * CALLS ARB, ART, CTW, IRF, LIN, RMP.
  8342. *
  8343. * MACROS GETFLD, MESSAGE, PUTFLD, STORE.
  8344.  
  8345.  
  8346. IAM11 SX6 B0+ NO ERRORS
  8347.  
  8348. IAM SUBR ENTRY/EXIT
  8349. SX0 B5 FUNCTION CODE
  8350. LX0 -1
  8351. SB6 X0
  8352. SX1 X0
  8353. SX1 X1-TIJTL
  8354. PL X1,IAMX IF NO FUNCTION
  8355. JP B6+TIJT THROUGH JUMP TABLE
  8356.  
  8357. * TABLE OF IAM FUNCTIONS.
  8358.  
  8359. TIJT PL X0,IAM4 IF 0 - *CRM* CARD PROCESSING
  8360. EQ IAM1 IF 1 - INITIALIZE EXTERNAL ROUTINES
  8361. PL X0,IAM12 IF 2 - *IXN* CARD PROCESSING
  8362. EQ IAM13 IF 3 - *AKY* CARD PROCESSING
  8363. PL X0,IAM5.2 IF 4 - ALLOCATE FILE CONTROL ENTRIES
  8364. EQ IAM0.1 IF 5 - ALLOCATE RECORD BUFFER
  8365. PL X0,IAM16 IF 6 - INITIALIZE RECOVERY FILES
  8366. EQ IAM17 IF 7 - RECOVERY TASK PROCESSING
  8367. PL X0,IAM15 IF 8 - *BRF* CARD PROCESSING
  8368. EQ IAMX RETURN TO CALLER
  8369. TIJTL EQU *-TIJT *IAM* FUNCTION TABLE LENGTH
  8370.  
  8371. * ALLOCATE RECORD BUFFER FOR *CRM*.
  8372.  
  8373. IAM0.1 SA3 IAMA MAXIMUM RECORD SIZE IN CHARACTERS
  8374. SA6 CMMC SAVE FIELD LENGTH FOR *CMM*
  8375. SA7 IAMG BIT COUNT FOR FILE ORGANIZATIONS
  8376. BX7 X3
  8377. RJ CTW CONVERT CHARACTERS TO WORDS
  8378. SA2 B2+TIAM FWA OF AVAILABLE MEMORY
  8379. SA3 B2+TILW LWA OF AVAILABLE MEMORY
  8380. IX4 X1+X2
  8381. IX7 X3-X4
  8382. SA5 VAMB FWA OF RECORD BUFFER
  8383. SX6 B1 NOT ENOUGH SPACE FOR RECORD ERROR
  8384. NG X7,IAMX IF NOT ENOUGH SPACE FOR RECORD BUFFER
  8385. SX6 X4+B1 UPDATE FWA OF AVAILABLE MEMORY
  8386. BX7 X5+X2
  8387. SA7 A5
  8388.  
  8389. * ALLOCATE RECOVERY BUFFERS.
  8390.  
  8391. RJ ARB ALLOCATE RECOVERY BUFFERS
  8392. NZ X1,IAMX IF RECOVERY BUFFERS NOT ALLOCATED
  8393.  
  8394. * ALLOCATE SPACE FOR *CMM*.
  8395.  
  8396. SA1 CMML SPACE FOR ALL *FSTT-S*
  8397. SA5 CMMM SPACE FOR ADDITIONAL *FIT-S*
  8398. IX1 X1+X5
  8399. BX5 X5-X5
  8400. SA4 IAMG BIT MAP FOR FILE ORGANIZATIONS
  8401. CX4 X4 COUNT OF FILE ORGANIZATIONS USED
  8402. SX4 X4-2 CMMCAP ASSUMES 2 FILE ORGANIZATIONS
  8403. NG X4,IAM0.11 IF NO ADDITIONAL FILE ORGANAZITIONS
  8404. SX5 CMMORG
  8405. IX5 X4*X5
  8406. IAM0.11 SX4 X5+CMMCAP
  8407. SA6 CMMB FWA FOR *CMM*
  8408. IX5 X1+X4
  8409. SA1 CMMC GET FL FOR CMM
  8410. SX7 X1
  8411. IX5 X7-X5
  8412. SB2 X5
  8413. PL B2,IAM0.2 IF *BFL* LARGE ENOUGH
  8414. SX6 21B
  8415. EQ IAMX EXIT WITH ERROR
  8416.  
  8417. IAM0.2 IX6 X6+X7 ADD BASE FL
  8418. AX1 18 GET EXPANDABLE FL FOR CMM
  8419. SA6 A1
  8420. SX6 X6+B1 FWA OF AVAILABLE MEMORY
  8421. SA6 A2+
  8422. IX5 X3-X6
  8423. MX0 -18
  8424. BX1 -X0*X1
  8425. IX7 X6+X1 MAXIMUM FL FOR CMM
  8426. SA7 CMMD
  8427. SA1 VCMM
  8428. AX1 36
  8429. SX6 X1
  8430. SA6 =YAAM$BL TARGET FL FOR CMM
  8431. PL X5,IAM0.3 IF ENOUGH FL
  8432. SX6 4
  8433. EQ IAMX RETURN
  8434.  
  8435. IAM0.3 SX6 0 REPORT BFL INFORMATION
  8436. EQ IAM11 RETURN WITH NO ERRORS
  8437.  
  8438. * INITIALIZE EXTERNAL ROUTINES.
  8439.  
  8440. IAM1 SA1 IAMD NUMBER OF UNUSED *TSEQ* TABLE ENTRIES
  8441. SX7 X1+
  8442. SA2 CMMB FWA FOR *CMM*
  8443. LX7 35-17
  8444. SA7 B3 INITIAL *CRM* STATUS
  8445. SB5 TTRT FWA OF TABLE OF TRANSACTION ROUTINES
  8446. MX0 42
  8447. BX6 X2
  8448. SA3 VLWP
  8449. BX7 X0*X3
  8450. BX7 X7+X2
  8451. SA7 A3+
  8452. SA6 VHHA
  8453. IAM2 SA1 B2 FIRST/NEXT EXTERNAL ROUTINE
  8454. BX6 X1
  8455. ZR X1,IAM3 IF END OF ROUTINES
  8456. LX6 24
  8457. SA6 B5
  8458. SB5 B5+B1
  8459. SB2 B2+B1
  8460. EQ IAM2 GET NEXT EXTERNAL ROUTINE
  8461.  
  8462. * THE TRANSACTION EXECUTIVE WILL MODIFY INSTRUCTIONS
  8463. * IN DECK *AAMI* USING TABLE *TINT*.
  8464.  
  8465. IAM3 SB4 TINT TABLE OF INSTRUCTIONS USING EXTERNALS
  8466. SB6 TINTL-1 LENGTH OF TABLE - 1
  8467. EQ IAMX RETURN
  8468.  
  8469. * INITIALIZE *FIT*.
  8470.  
  8471. IAM4 SA2 B2+TIFN FILE NAME
  8472. STORE TFIT,LFN=X2 STORE FILE NAME IN *FIT*
  8473. SA1 B2+TIFO FILE ORGANIZATION
  8474. STORE TFIT,FO=X1 STORE FILE ORGANIZATION IN *FIT*
  8475. SA1 B2+TIPD PROCESSING DIRECTION
  8476. STORE TFIT,PD=X1 STORE PROCESSING DIRECTION IN *FIT*
  8477. SA1 B2+TIHR FWA OF HASHING ROUTINE
  8478. STORE TFIT,HRL=X1 STORE HASHING ROUTINE IN *FIT*
  8479. SA1 B2+TIFW
  8480. STORE TFIT,FWI=X1 STORE FORCED WRITE INDICATOR IN *FIT*
  8481. SA1 B2+TIRF FILE RECOVERABLE FLAG
  8482. * * * * STORE TFIT,SFLG=X1 STORE LOGGING EXIT FLAG IN *FIT*
  8483. SX6 X1
  8484. LX6 33 *SFLG* FLAG POSITION IS BIT 33
  8485. SA3 TFIT+13 WORD 13 (0-N)
  8486. BX6 X3+X6 ADD *SFLG* TO *FIT* WORD 13
  8487. SA6 A3 STORE
  8488. STORE TFIT,DFLG=X1 STORE DEFERRED LOGGING EXIT FLAG IN *FIT*
  8489. ZR X1,IAM4.0 IF NO DEFERRED LOGGING EXIT
  8490. SX1 DLX FWA OF LOGGING EXIT ROUTINE
  8491. IAM4.0 STORE TFIT,LGX=X1 STORE LOGGING EXIT ROUTINE ADRS. IN *FIT*
  8492. BX1 X1-X1
  8493. STORE TFIT,XN=X1 CLEAR INDEX FILE NAME
  8494. SA5 CMML UPDATE SPACE FOR *FSTT-S*
  8495. SX7 X5+IAME
  8496. SA7 A5
  8497.  
  8498. * ALLOCATE LOGICAL NAME TABLE.
  8499.  
  8500. IAM4.1 SA5 B2+TIAM FWA OF AVAILABLE MEMORY
  8501. SA3 B2+TILW LWA OF MEMORY
  8502. SB6 X5
  8503. SA4 VAMB FWA OF LOGICAL NAME ENTRY
  8504. SB3 X3
  8505. AX4 24
  8506. NZ X4,IAM10 IF NOT FIRST ALLOCATION
  8507. BX6 X5
  8508. LX6 24
  8509. SA6 VAMB
  8510. IAM5 SA3 RDRF GET FWA OF CURRENT *TDRF*
  8511. BX6 X1 SAVE X1
  8512. PUTFLD 5,X3,TDLL STORE FWA OF LAST *TLNT* IN *TDRF*
  8513. GETFLD 4,X3,TDNL
  8514. NZ X4,IAM5.0 IF *TDRF* POINTS TO FIRST DATA BASE *TLNT*
  8515. PUTFLD 5,X3,TDNL STORE FWA OF FIRST *TLNT* IN *TDRF*
  8516. IAM5.0 BX1 X6 RESTORE X1
  8517. SB5 B6 FWA OF *TLNT*
  8518. SB6 B5+TLNTE-1 UPDATE CURRENT MEMORY FWA
  8519. SX6 B1+B1 NOT ENOUGH SPACE FOR USERS ERROR
  8520. SB6 X1+B6 ADD EXTRA WORDS
  8521. GE B6,B3,IAMX IF NOT ENOUGH SPACE FOR USERS
  8522. BX7 X2 PUT FILE NAME IN LOGICAL NAME ENTRY
  8523. SA7 B5+TLFNW
  8524. SA4 B2+TIMD
  8525. BX6 X1 SAVE X1
  8526. PUTFLD 4,B5,TLMD STORE ATTACH MODE IN *TLNT*
  8527. SA4 B2+TIAE
  8528. PUTFLD 4,B5,TLFD STORE FILE DOWN IN *TLNT*
  8529. SA4 B2+TIRF
  8530. PUTFLD 4,B5,TLRF STORE RECOVERABLE FILE FLAG IN *TLNT*
  8531. SA4 B2+TIPN GET LEFT JUSTIFIED PACK NAME
  8532. LX4 TLPNN RIGHT JUSTIFY
  8533. PUTFLD 4,B5,TLPN STORE PACKNAME
  8534. SA3 B2+TIDV GET LEFT JUSTIFIED DEVICE TYPE
  8535. SX4 X3 OCTAL UNIT NUMBER IN BITS 0 - 5
  8536. PUTFLD 4,B5,TLUN STORE OCTAL UNIT NUMBER
  8537. LX3 TLDVN RIGHT JUSTIFY
  8538. PUTFLD 3,B5,TLDV STORE DEVICE TYPE
  8539. BX1 X6 RESTORE X1
  8540. MX6 -TLKLN
  8541. SA2 B2+TIKL PRIMARY KEY LENGTH
  8542. BX6 -X6*X2
  8543. LX6 TLKLS-TLKLN+1
  8544. BX7 X1
  8545. ZR X1,IAM5.1 IF NO ALTERNATE KEYS
  8546. SX7 X7-1
  8547. IAM5.1 BX7 X6+X7 PRIMARY KEY SIZE AND NO. OF ALTERNATE KEYS
  8548. SA7 B5+TLNAW STORE PRIMARY KEY SIZE AND NUMBER OF ALT.
  8549. SX1 B6 CURRENT MEMORY FWA
  8550. SX7 B5 LOGICAL NAME ENTRY FWA
  8551. LX1 18
  8552. BX7 X1+X7
  8553. SA7 B2+TILN SAVE CURRENT VALUES
  8554. EQ IAM11 RETURN
  8555.  
  8556. * ALLOCATE FILE CONTROL ENTRIES.
  8557.  
  8558. IAM5.2 SA3 B2+TILN
  8559. SB5 X3+ RESTORE LOGICAL NAME ENTRY FWA
  8560. AX3 18
  8561. SB6 X3 RESTORE CURRENT MEMORY FWA
  8562. IAM5.3 SA2 B2+TIMK MAXIMUM KEY SIZE IN CHARACTERS
  8563. SA4 B2+TIRF
  8564. ZR X4,IAM5.5 IF FILE NOT RECOVERABLE
  8565. SA4 RDRF FWA OF CURRENT *TDRF*
  8566. GETFLD 1,X4,TDKS GET PREVIOUS LARGEST KEY SIZE
  8567. IX1 X1-X2
  8568. PL X1,IAM5.4 IF PREVIOUS KEY SIZE .GE. CURRENT
  8569. PUTFLD 2,X4,TDKS STORE NEW KEY SIZE IN *TDRF*
  8570. IAM5.4 GETFLD 3,X4,TDRS MAXIMUM FILE RECORD LENGTH FOR DATA BASE
  8571. BX6 X3
  8572. SA3 B2+TIRL MAXIMUM RECORD LENGTH FOR THE FILE
  8573. IX6 X6-X3
  8574. PL X6,IAM5.5 IF PREVIOUS RECORD SIZE .GE. CURRENT
  8575. PUTFLD 3,X4,TDRS STORE NEW LARGEST RECORD LENGTH IN *TDRF*
  8576. IAM5.5 SA3 B2+TIUS NUMBER OF USERS
  8577. BX7 X2 MAXIMUM KEY SIZE IN CHARACTERS
  8578. LX7 TLKSS-TLKSN+1
  8579. SA7 B5+TLKSW SAVE KEY LENGTH
  8580. LX7 TLKSN-1-TLKSS
  8581. RJ CTW CONVERT KEY SIZE TO WORDS
  8582. SX1 X1-1
  8583. IAM6 SB4 B6+B1 FWA OF FILE CONTROL ENTRY
  8584. IX2 X1+X1
  8585. SX7 X2+IAMF
  8586. SA4 CMMM UPDATE SPACE FOR ADDITIONAL *FIT-S*
  8587. IX7 X7+X4
  8588. SA7 A4
  8589. SA4 B2+TILW LWA OF AVAILABLE MEMORY
  8590. SB3 X4
  8591. SB6 B4+TFKYW ADD FIXED SIZE OF FILE CONTROL ENTRY
  8592. SB6 X1+B6 ADD KEY SIZE
  8593. SX6 B1+B1 NOT ENOUGH SPACE FOR USERS ERROR
  8594. SX6 B5 FWA OF *TLNT*
  8595. BX2 X1 SAVE KEY SIZE
  8596. PUTFLD 6,B4,TFLN STORE POINTER TO *TLNT* IN *TFCB*
  8597. BX1 X2 RESTORE KEY SIZE
  8598. GE B6,B3,IAMX IF NOT ENOUGH SPACE FOR USERS - RETURN
  8599.  
  8600. * MOVE *FIT* TO FILE CONTROL ENTRY.
  8601.  
  8602. SX7 B4 FWA OF FILE CONTROL ENTRY (*TFCB*)
  8603. SB7 TFIT+TFITL-1 LWA OF *FIT*
  8604. SB3 TFIT FWA OF *FIT*
  8605. IAM7 SA2 B3
  8606. BX6 X2
  8607. SA6 X7+TFFTW
  8608. GE B3,B7,IAM8 IF *FIT* HAS BEEN MOVED
  8609. SB3 B3+B1
  8610. SX7 X7+B1
  8611. EQ IAM7 CONTINUE MOVING *FIT*
  8612.  
  8613. IAM8 SA4 B5+TLNFW FWA OF FREE FILE CONTROL ENTRIES
  8614. SA5 B4+TFNFW FREE FILE CONTROL ENTRY
  8615. RJ LIN INSERT ENTRY INTO FREE LINK
  8616. SX3 X3-1
  8617. NZ X3,IAM6 IF MORE USERS
  8618.  
  8619. * ALLOCATE LOCK ENTRIES.
  8620.  
  8621. SA1 B2+TIKL PRIMARY KEY SIZE IN CHARACTERS
  8622. BX7 X1
  8623. RJ CTW CONVERT KEY SIZE TO WORDS
  8624. SX1 X1-1
  8625. SA3 B2+TILK NUMBER OF LOCKS
  8626. SA2 B2+TILW LWA OF TABLE SPACE
  8627. SB7 X3+
  8628. SB3 X2+
  8629. IAM9 SB4 B6+B1 FWA OF FIRST/NEXT LOCK ENTRY
  8630. SB6 B4+TKKYW FIXED PORTION OF LOCK ENTRY
  8631. SB6 X1+B6 ADD VARIABLE KEY PORTION
  8632. SX6 3 NOT ENOUGH ROOM FOR LOCKS ERROR
  8633. GE B6,B3,IAMX IF NOT ENOUGH MEMORY FOR LOCKS - RETURN
  8634. SA4 B5+TLNKW HEAD OF LINK FOR LOCKS FOR FILE
  8635. SX5 B5 FWA OF *TLNT*
  8636. LX5 TKLNS-TKLNN+1
  8637. MX7 -TKLNN
  8638. LX7 TKLNS-TKLNN+1
  8639. SA2 B4+TKLNW
  8640. BX2 X7*X2 CLEAR FIELD *TKLN*
  8641. BX7 X2+X5 PUT ADDRESS IN FIELD
  8642. SA7 A2+ STORE WORD WITH *TKLN* FIELD
  8643. SA5 B4+TKNFW LINK WORD OF NEW LOCK ENTRY
  8644. RJ LIN INSERT LOCK IN CHAIN
  8645. SB7 B7-B1
  8646. NZ B7,IAM9 IF MORE LOCK ENTRIES TO CREATE
  8647. SX7 B6+B1 UPDATE FWA OF ALLOCATABLE MEMORY
  8648. SA7 B2+TIAM
  8649.  
  8650. * SAVE LENGTH OF MAXIMUM LENGTH RECORD FOR ALL FILES.
  8651.  
  8652. SA1 B2+TIRL MAXIMUM RECORD LENGTH FOR FILE
  8653. SA2 IAMA MAXIMUM RECORD SIZE FOR ALL FILES
  8654. SA4 B5+TLRSW SAVE RECORD LENGTH
  8655. LX1 TLRSS-TLRSN+1
  8656. BX7 X1+X4
  8657. SA7 A4
  8658. LX1 TLRSN-1-TLRSS
  8659. IX3 X2-X1
  8660. BX6 X1
  8661. PL X3,IAM11 IF A PREVIOUS FILE HAS .GE. RECORD LENGTH
  8662. SA6 A2 STORE NEW SIZE IN *IAMA*
  8663. EQ IAM11 INIDICATE NO ERRORS ON RETURN
  8664.  
  8665. IAM10 SA4 X4 NEXT LOGICAL NAME ENTRY
  8666. SX7 X4
  8667. NZ X7,IAM10 IF NOT END OF ENTRIES
  8668. BX7 X4+X5 UPDATE POINTER TO NEXT ENTRY
  8669. SA7 A4
  8670. EQ IAM5 ALLOCATE NEXT ENTRY
  8671.  
  8672. * SET UP INDEX FILE IN *FIT*.
  8673.  
  8674. IAM12 SA2 B2+TIXN NAME OF INDEX FILE
  8675. STORE TFIT,XN=X2 SET INDEX FILE NAME IN FIT
  8676. SA1 B2+TINK
  8677. SA2 B2+TIFN GET DATA FILE NAME
  8678. SX1 X1+1 ADD EXTRA WORD TO LOGICAL NAME ENTRY
  8679. EQ IAM4.1 EXPAND TABLE ENTRY
  8680.  
  8681. * SET UP KEY DESCRIPTION.
  8682.  
  8683. IAM13 SA2 B2+TILN
  8684. SA5 B2+TIKO ALTERNATE KEY ORDINAL
  8685. SB5 X2 RESTORE LOGICAL NAME ENTRY FWA
  8686. AX2 18
  8687. SB6 X2 RESTORE CURRENT MEMORY FWA
  8688. MX7 60 DELETED KEY FLAG
  8689. SX5 X5+TLKWW ALTERNATE KEY DESCRIPTORS BIAS ADDRESS
  8690. SA2 B2+TIKW KEY RELATIVE POSITION
  8691. NG X2,IAM14 IF KEY DELETED
  8692. MX1 -18
  8693. BX7 -X1*X2
  8694. SA2 B2+TIKP KEY BEGINNING CHARACTER POSITION
  8695. LX7 36
  8696. BX2 -X1*X2
  8697. LX2 18
  8698. BX7 X7+X2
  8699. SA2 B2+TIAL ALTERNATE KEY LENGTH
  8700. BX2 -X1*X2
  8701. BX7 X7+X2
  8702. IAM14 SA7 X5+B5 SAVE KEY DESCRIPTION
  8703. SA5 B2+TINK DECREMENT ALTERNATE KEY COUNT
  8704. SX7 X5-1
  8705. SA7 A5
  8706. NZ X7,IAM11 IF NOT LAST ALTERNATE KEY
  8707. EQ IAM5.3 RETURN
  8708.  
  8709. EJECT
  8710.  
  8711. * ALLOCATE RECOVERY TABLES.
  8712.  
  8713. IAM15 RJ ART INITIALIZE RECOVERY TABLES
  8714. EQ IAMX RETURN
  8715.  
  8716. * ALLOCATE RECOVERY FILES.
  8717.  
  8718. IAM16 SX7 B5+ FUNCTION CODE
  8719. SA7 IAMC
  8720. SA1 RDRT FWA OF FIRST *TDRF* ENTRY
  8721. RJ IRF INITIALIZE RECOVERY FILES FOR DATA BASES
  8722. EQ IAMX RETURN
  8723.  
  8724. * RECOVERY MODE PRESET.
  8725.  
  8726. IAM17 SX7 B5+ SAVE *IAM* FUNCTION CODE
  8727. SA7 IAMC
  8728. SA1 RDRT FWA OF *TDRF* TABLE
  8729. RJ IRF INITIALIZE RECOVERY FILES
  8730. SA2 IMSK FILE INITIALIZATION ERROR MESSAGE
  8731. NZ X6,IAM18 IF ERROR ON RECOVERY FILE INITIALIZATION
  8732.  
  8733. * RETURN FROM FUNCTION 6 PROCESS -
  8734. * RECOVERY FILES ARE VALID AND LOCAL.
  8735. * THE ACTIVE AFTER IMAGE RECOVERY FILES (*ARF*) ARE
  8736. * POSITIONED AT EOF.
  8737.  
  8738. RJ RMP RECOVER TASKS FOR CURRENT DATA BASE
  8739. SA2 IMSM RECOVERY COMPLETE MESSAGE
  8740. ZR X6,IAM18 IF NO ERROR ON DATA BASE RECOVERY
  8741. SX6 7 RECOVERY IMPOSSIBLE ERROR
  8742. SA2 IMSL RECOVERY IMPOSSIBLE MESSAGE
  8743. IAM18 SA6 RNFE SAVE ERROR STATUS
  8744. MESSAGE A2 REPORT RECOVERY RESULT
  8745. SA1 RNFE ERROR STATUS
  8746. SX6 X1+
  8747. EQ IAMX RETURN
  8748.  
  8749. LIST X
  8750. *CALL COMKARF
  8751. LIST *
  8752. TITLE INITIALIZATION SUPPORTING ROUTINES.
  8753. ** ARB - ALLOCATE RECOVERY BUFFERS.
  8754. *
  8755. * ENTRY (X6) = FWA OF AVAILABLE MEMORY.
  8756. * (A2) = ADDRESS OF *TIAM*.
  8757. * (RDRT) = FWA OF FIRST *TDRF* ENTRY.
  8758. *
  8759. * EXIT (X1) = ZERO, IF BUFFERS ALLOCATED.
  8760. * (X6) = FWA OF AVAILABLE MEMORY.
  8761. * (X3) = LWA OF AVAILABLE MEMORY.
  8762. * (A2) = ADDRESS OF *TIAM*.
  8763. *
  8764. * (X1) = NON-ZERO, IF BUFFERS NOT ALLOCATED.
  8765. * (X6) = 13, IF NOT ENOUGH MEMORY FOR BUFFERS.
  8766. *
  8767. * USES X - 1, 2, 3, 4, 5, 6, 7.
  8768. * A - 1, 2, 3, 4, 6.
  8769. * B - 3, 4.
  8770. *
  8771. * MACROS GETFLD.
  8772. *
  8773. * CALLS CTW.
  8774.  
  8775.  
  8776. ARB SUBR ENTRY/NO ERROR EXIT
  8777. SA4 RDRT FWA OF FIRST *TDRF* TABLE
  8778. ARB1 SB3 X4 FWA OF *TDRF*
  8779. SA6 A2 UPDATE FWA OF AVAILABLE MEMORY AT *TIAM*
  8780. GETFLD 1,B3,TDAL GET FWA OF *TARF* FOR THIS DATA BASE
  8781. ZR X1,ARB3 IF NO RECOVERY FOR THIS DATA BASE
  8782. SB4 X1+ FWA OF *TARF*
  8783. GETFLD 1,B3,TDKS GET LARGEST KEY SIZE FOR THIS DATA BASE
  8784. BX7 X1
  8785. RJ CTW CONVERT TO WORDS
  8786. BX2 X1
  8787. GETFLD 1,B3,TDRS GET LARGEST RECORD SIZE FOR THIS DATA BASE
  8788. BX7 X1
  8789. RJ CTW CONVERT TO WORDS
  8790. IX1 X1+X2 TOTAL WORDS FOR KEY AND RECORD SIZES
  8791. BX5 X1 X5 = (KL/10) + (RL/10)
  8792.  
  8793. * ALLOCATE *ARF* BUFFER.
  8794.  
  8795. SX1 TARHL ADD *ARF* RECORD HEADER LENGTH
  8796. IX1 X1+X5 KEY AND RECORD LENGTH IN WORDS
  8797. BX6 X1 MAXIMUM AFTER IMAGE RECORD SIZE IN WORDS
  8798. LX6 TAISS-TAISN+1
  8799. SX4 CRMARB NUMBER OF AFTER IMAGES PER BUFFER
  8800. SA6 B4+TAISW STORE MAX IMAGE SIZE
  8801. SX6 63 FOR ROUND-UP TO PRU
  8802. IX4 X1*X4
  8803. IX4 X4+X6
  8804. AX4 6
  8805. LX4 6 DISALLOW FRACTIONAL PRU-S (*ARF*)
  8806. SA1 IAMB NUMBER OF PRU-S PER *ARF* (*CRMARFN*)
  8807. LX1 TAFLS-TAFLN+1
  8808. BX6 X1+X4
  8809. SA6 B4+TABLW
  8810. SA2 B2+TIAM FWA OF AVAILABLE MEMORY
  8811. SA3 B2+TILW LWA OF AVAILABLE MEMORY
  8812. IX4 X4+X2
  8813. IX1 X3-X4
  8814. SX6 13B NOT ENOUGH FL FOR RECOVERY BUFFERS ERROR
  8815. NG X1,ARBX IF NOT ENOUGH FL FOR RECOVERY BUFFERS
  8816. SX6 44B FET+1 *R* (BIT 47) AND *EP* (BIT 44)
  8817. SX7 3 FET+1 *L* (BITS 23-18) FOR 8 WORD FET
  8818. LX6 29-5 POSITION
  8819. BX6 X6+X7 MERGE
  8820. LX6 47-29 FINAL POSITION
  8821. BX6 X6+X2 ADD *FIRST* ADDRESS
  8822. SA6 B4+TAFTW STORE FET+1 WORD IN *TARF* FET
  8823. SX6 X2
  8824. SA6 A6+B1 STORE *IN*
  8825. SA6 A6+B1 STORE *OUT*
  8826. SX6 X4+B1 UPDATE FWA OF MEMORY AVAILABLE FOR ALLOC.
  8827. SA6 A6+B1 STORE *LIMIT* IN *TARF* FET
  8828. GETFLD 1,B3,TDQL GET FWA OF FIRST *TBRF*
  8829.  
  8830. * ALLOCATE *BRF* BUFFERS.
  8831.  
  8832. ARB2 SB4 X1 FWA OF *TBRF*
  8833. SX2 X6 FWA OF AVAILABLE MEMORY
  8834. SX4 TQRHL+63 ADD *BRF* RECORD HEADER LENGTH + ROUND UP
  8835. IX4 X4+X5 ADD KEY AND RECORD SIZE IN WORDS
  8836. AX4 6 ROUND-UP TO FULL PRU
  8837. SX6 X4+
  8838. SA6 B4+TQPIW STORE NUMBER OF PRU*S PER BEFORE IMAGE
  8839. SX6 CRMUPM NUMBER OF RECORDS PER *BRF* SEGMENT
  8840. IX6 X4*X6
  8841. SX7 CMDM NUMBER OF SEGMENTS PER *BRF*
  8842. LX7 TQNPN
  8843. BX6 X7+X6
  8844. SA6 B4+TQNPW
  8845. LX4 6 DISALLOW FRACTIONAL PRU-S (*BRF*)
  8846. IX4 X4+X2
  8847. IX1 X3-X4
  8848. SX6 13B NOT ENOUGH FL FOR RECOVERY BUFFERS ERROR
  8849. NG X1,ARBX IF NOT ENOUGH FL FOR RECOVERY BUFFERS
  8850. SX6 44B FET+1 RANDOM AND USER EP FIELDS
  8851. SX7 3 FET LENGTH
  8852. LX6 24D POSITION
  8853. BX6 X6+X7 MERGE
  8854. LX6 18 FINAL POSITION
  8855. BX6 X6+X2 ADD *FIRST* ADDRESS
  8856. SA6 B4+TQFTW STORE FET+1 WORD IN *TBRF* FET
  8857. SX6 X2 FWA OF AVAILABLE MEMORY
  8858. SA6 A6+B1 STORE *IN*
  8859. SA6 A6+B1 STORE *OUT*
  8860. SX6 X4+B1 UPDATE FWA OF MEMORY AVAILABLE FOR ALLOC.
  8861. SA6 A6+B1 STORE *LIMIT* IN *TBRF* FET
  8862. GETFLD 1,B4,TQNL GET FWA OF NEXT *TBRF*
  8863. NZ X1,ARB2 IF MORE *TBRF-S* FOR THIS DATA BASE
  8864. ARB3 GETFLD 4,B3,TDDL GET FWA OF NEXT *TDRF*
  8865. NZ X4,ARB1 IF MORE *TDRF*S
  8866. SX1 B0 NO ERROR, BUFFERS ALLOCATED
  8867. EQ ARBX RETURN
  8868.  
  8869. SPACE 4,10
  8870. ** ART - ALLOCATE RECOVERY TABLES.
  8871. *
  8872. * ENTRY (B2) = FWA OF *TTIP* TABLE OF PARAMETERS.
  8873. *
  8874. * EXIT (X6) = 20, IF NOT ENOUGH FL FOR RECOVERY TABLES.
  8875. *
  8876. * USES X - 1, 2, 3, 5, 6, 7.
  8877. * A - 1, 2, 3, 5, 6, 7.
  8878. * B - 5, 6, 7.
  8879. *
  8880. * MACROS GETFLD, PUTFLD.
  8881. *
  8882. * CALLS COD.
  8883.  
  8884.  
  8885. ART SUBR ENTRY/EXIT
  8886. SA1 B2+TIQN NUMBER OF *BRF-S*, ZERO IF NO RECOVERY
  8887. ZR X1,ART1 IF RECOVERY NOT ENABLED
  8888. SX2 TQRFE LENGTH OF *TBRF*
  8889. SX3 TARFE LENGTH OF *TARF*
  8890. IX1 X1*X2 NUMBER OF *BRF-S* TIMES LENGTH OF *TBRF*
  8891. IX1 X1+X3 PLUS LENGTH OF *TARF*
  8892. ART1 SX2 TDRFE LENGTH OF *TDRF*
  8893. SA5 B2+TIAM FWA OF MEMORY AVAILABLE FOR ALLOCATION
  8894. SA3 B2+TILW LWA OF MEMORY AVAILABLE FOR ALLOCATION
  8895. IX1 X1+X2 WORDS REQUIRED FOR RECOVERY TABLES
  8896. IX2 X3-X5 MEMORY AVAILABLE FOR ALLOCATION
  8897. IX2 X2-X1
  8898. SX6 20B INSUFFICIENT FL FOR RECOVERY TABLES ERROR
  8899. NG X2,ARTX IF INSUFFICIENT FL FOR RECOVERY TABLES
  8900.  
  8901. * ALLOCATE AND PRESET *TDRF* TABLE.
  8902.  
  8903. SA2 RDRT FWA OF FIRST *TDRF*
  8904. NZ X2,ART2 IF NOT FIRST *TDRF*
  8905. SX6 X5 FIRST WORD OF AVAIL. MEM. IS FWA OF *TDRF*
  8906. SA6 A2 SET FWA OF FIRST *TDRF* IN *RDRT*
  8907. ART2 SA2 RDRF FWA OF LAST CURRENT *TDRF*
  8908. ZR X2,ART3 IF FIRST ALLOCATION OF RECOVERY TABLES
  8909. PUTFLD 5,X2,TDDL SET LINK TO NEXT *TDRF*
  8910. ART3 SX6 X5 FWA OF CURRENT *TDRF*
  8911. SA6 A2 STORE FWA OF CURRENT *TDRF* IN *RDRF*
  8912. SX6 X5+TDRFE
  8913. SA6 A5 NEW FWA OF MEMORY AVAILABLE FOR ALLOCATION
  8914. SA2 B2+TIDB DATA BASE ID
  8915. BX7 X2
  8916. SA7 X5+TDIDW STORE DATA BASE ID IN *TDRF*
  8917. SA2 B2+TIQN NUMBER OF *BRF-S* FOR DATA BASE
  8918. PUTFLD 2,X5,TDQN
  8919. ZR X2,ART5 IF RECOVERY NOT SPECIFIED
  8920. PUTFLD 6,X5,TDAL SET *TDRF* FIELD TO POINT TO *TARF*
  8921.  
  8922. * ALLOCATE *TARF* TABLE.
  8923.  
  8924. SB5 X6 FWA OF *TARF*
  8925. SX6 X6+TARFE
  8926. GETFLD 1,X5,TDID DATA BASE ID FROM *TDRF*
  8927. SA6 A5 NEW FWA OF MEMORY AVAILABLE FOR ALLOCATION
  8928. SX2 2RZZ FIRST 2 CHARS. OF LOCAL FILE NAME
  8929. LX2 12D
  8930. BX1 X2+X1 (ZZID)
  8931. SX2 3RA01 LAST 3 CHARACTERS OF *ARF* 1 NAME
  8932. LX1 18D
  8933. BX7 X1+X2 FORM FILE NAME FOR *ARF* 1
  8934. LX7 TAFNS-TAFNN+1
  8935. SA7 B5+TAFNW STORE *ARF* NAME IN *TARF* HEADER
  8936. SX1 B1
  8937. BX7 X7+X1 SET COMPLETION BIT
  8938. SA7 B5+TAFFW STORE *ARF* NAME IN *TARF* FET+0
  8939. SB5 X6 FWA OF MEMORY IS FWA OF FIRST *TBRF*
  8940. PUTFLD 6,X5,TDQL SET *TDRF* FIELD TO POINT TO FIRST *TBRF*
  8941.  
  8942. * ALLOCATE / PRESET *TBRF* TABLES.
  8943.  
  8944. SB7 B2 MOVE PARAMETER TABLE FWA TO B7
  8945. SB6 B0 CLEAR *BRF* COUNTER
  8946. ART4 PUTFLD 5,B5,TQDL *TBRF* FIELD POINTS TO *TDRF*
  8947. SB6 B6+B1 COUNT *TBRF* ENTRIES
  8948. SX1 B6+100B
  8949. RJ COD CONVERT COUNT TO OCTAL DISPLAY CODE
  8950.  
  8951. * *COD* USES X1, X2, X3, X4, X6, AND X7,
  8952. * A4.
  8953. * B2, B3, AND B4.
  8954.  
  8955. MX7 -12
  8956. BX6 -X7*X6 GET LOWER TWO DISPLAY CHARACTERS
  8957. SX2 1RB
  8958. LX2 12D
  8959. BX6 X2+X6 (QNN)
  8960. GETFLD 2,X5,TDID DATA BASE ID FROM *TDRF*
  8961. LX2 18D
  8962. BX6 X2+X6 (IDQNN)
  8963. SX2 2RZZ FIRST 2 CHARS. OF LOCAL FILE NAME
  8964. LX2 30D
  8965. BX6 X2+X6 FORM *BRF* NAME (ZZIDQNN)
  8966. LX6 TQFFS-TQFFN+1
  8967. SX1 B1
  8968. BX7 X6+X1 SET COMPLETION BIT IN FET+0
  8969. SA7 B5+TQFFW STORE *BRF* NAME IN *TBRF* FET
  8970. SX2 CRMUPM NUMBER OF RECORDS PER SEGMENT
  8971. BX6 X6+X2
  8972. SA6 B5+TQFNW STORE NAME AND REC./SEG. IN *TBRF* HEADER
  8973. SA2 B7+TIQN NUMBER OF *BRF-S* REQUIRED
  8974. SX6 X2
  8975. SA6 A6+B1 STORE NUMBER OF *BRF-S* IN *TBRF* HEADER
  8976. SX3 B6 NUMBER OF *TBRF-S* ALLOCATED
  8977. IX2 X2-X3
  8978. SX6 B5+TQRFE
  8979. SA6 A5 NEW FWA OF MEMORY AVAILABLE FOR ALLOCATION
  8980. ZR X2,ART5 IF ALL *TBRF-S* ALLOCATED
  8981. PUTFLD 6,B5,TQNL LINK CURRENT *TBRF* TO NEXT *TBRF*
  8982. SB5 X6 FWA OF NEXT *TBRF*
  8983. EQ ART4 ALLOCATE ANOTHER *TBRF*
  8984.  
  8985. ART5 SX6 B0+ NO ERROR
  8986. EQ ARTX RETURN
  8987. SPACE 4,10
  8988. ** GFL - GET AFTER/BEFORE IMAGE RECOVERY FILE LOCAL.
  8989. *
  8990. * ENTRY (A0) = FWA OF FET CONTAINED IN *TARF* OR *TBRF*.
  8991. * (A5) = FWA OF HEADER CONTAINED IN *TARF* OR *TBRF*.
  8992. * (X5) = FIRST WORD OF HEADER.
  8993. * (B7) = ZERO IF *ARF* PROCESS.
  8994. * = ONE IF *BRF* PROCESS.
  8995. *
  8996. * EXIT (X6) = 6, IF ERROR ON ATTACH OR DEFINE.
  8997. * = 12, IF *CIO* ERROR ON RECOVERY FILE I/O.
  8998. *
  8999. * USES X - 0, 1, 2, 6, 7.
  9000. * A - 1, 2, 7.
  9001. * B - 7.
  9002. *
  9003. * MACROS STATUS.
  9004. *
  9005. * CALLS ADF, ARF, NMS.
  9006.  
  9007.  
  9008. GFL SUBR ENTRY/EXIT
  9009. SX0 B7+ SAVE B7+
  9010. SA1 A0 FILE NAME LEFT
  9011. BX7 X1
  9012. SA7 AFET FILE NAME TO *ADF*S FET+0
  9013. STATUS AFET
  9014. SA1 AFET
  9015. MX7 11
  9016. LX1 59-11
  9017. BX1 X7*X1
  9018. NZ X1,GFL3 IF *ARF* OR *BRF* ALREADY LOCAL
  9019. SB7 B1+B1 (B7) = 2 FOR *ADF* ATTACH
  9020. SA1 A0+ FILE NAME FROM FET
  9021. RJ ADF ATTEMPT ATTACH
  9022. ZR X1,GFL3 IF *ARF* OR *BRF* ATTACHED WITHOUT ERROR
  9023. SX6 6 ERROR ON ATTACH *ARF* OR *BRF* ERROR CODE
  9024. SA2 IAMC FUNCTION CODE 6 OR 7
  9025. SX2 X2-7
  9026. NZ X2,GFL1 IF NOT RECOVERY MODE PRESET (7)
  9027. NE B7,B1,GFL1 IF NOT *BRF* PROCESS
  9028. EQ GFLX RETURN
  9029.  
  9030. GFL1 SX1 X1-2 FILE NOT FOUND STATUS OK FOR FUNC 6
  9031. NZ X1,GFLX IF ERROR ON ATTACH
  9032. SB7 B1 (B7) = 1 FOR *ADF* DEFINE
  9033. SA1 A0
  9034. RJ ADF DEFINE *ARF* OR *BRF*
  9035. SX6 6 ERROR ON DEFINE *ARF* OR *BRF* ERROR CODE
  9036. NZ X1,GFLX IF ERROR ON DEFINE
  9037. GFL2 MX7 42 FILE NAME MASK
  9038. SA2 A0 FILE NAME
  9039. SA1 IMSJ ALLOCATION MESSAGE
  9040. RJ NMS REPORT ALLOCATION OF FILE
  9041. SB7 X0 ZERO FOR *ARF*, ONE FOR *BRF*
  9042. RJ AAF ALLOCATE *ARF* OR *BRF*
  9043. ZR X6,GFLX IF *ARF* OR *BRF* ALLOCATED
  9044. SX6 12B CIO ERROR ON RECOVERY FILE ERROR CODE
  9045. EQ GFLX RETURN
  9046.  
  9047. GFL3 SA1 IAMC FUNCTION CODE 6 OR 7
  9048. SX6 X1-7
  9049. ZR X6,GFLX IF FUNCTION 7 RECOVERY MODE
  9050. EQ GFL2 RE-ALLOCATE *BRF* FOR FUNCTION 6
  9051. SPACE 4,10
  9052. IFO SPACE 4,15
  9053. ** IFO - FILE OPEN.
  9054. *
  9055. * OPEN FILE FOR TRANSACTION IF NOT ALREADY OPEN
  9056. * AND VALIDATE BEFORE IMAGE KEY AND RECORD SIZE
  9057. * AGAINST MAXIMUM SIZE IN *TLNT* ENTRY.
  9058. *
  9059. * ENTRY (B2) = FWA OF TRANSACTION SEQUENCE ENTRY.
  9060. * (B3) = FWA OF LOGICAL NAME ENTRY.
  9061. * (B7) = FWA OF BEFORE IMAGE RECORD.
  9062. * (RDRF) = FWA OF DATA BASE *TDRF* ENTRY.
  9063. *
  9064. * EXIT (B4) = FWA OF FILE CONTROL ENTRY.
  9065. * (B3) = FWA OF LOGICAL NAME ENTRY.
  9066. * (B2) = FWA OF TRANSACTION SEQUENCE ENTRY.
  9067. * (B1) = 1.
  9068. * (X0) = FWA OF *FIT*.
  9069. * (X6) = ZERO IF NO ERROR.
  9070. * = *TERG*, IF NO TABLE SPACE FOR OPEN.
  9071. * = *TERT*, IF INVALID KEY LENGTH.
  9072. * = *TERU*, IF INVALID RECORD LENGTH.
  9073. * = ZERO AND *TSEQ* FIELD *TSRC* CLEARED IF
  9074. * *CRM* ERROR ON OPEN.
  9075. * (RLNT) = FWA OF *TLNT* ENTRY.
  9076. * (RSEQ) = FWA OF *TSEQ* ENTRY.
  9077. *
  9078. * USES X - ALL.
  9079. * A - 1, 2, 3, 4, 5, 6, 7.
  9080. * B - 1, 4.
  9081. *
  9082. * CALLS IOP, LIN, NMS.
  9083. *
  9084. * MACROS FETCH, GETFLD, PUTFLD.
  9085.  
  9086.  
  9087. IFO SUBR ENTRY/EXIT
  9088.  
  9089. * CHECK IF FILE ALREADY OPEN FOR TRANSACTION.
  9090.  
  9091. SA1 B3+TLNOW FWA OF NEXT OPEN FILE LINK
  9092. SX6 1
  9093. SA6 IFOA INITIALIZE FILE NOT OPEN FOR TASK FLAG
  9094. IFO1 SB4 X1+ FWA OF OPEN FILE LINK
  9095. ZR B4,IFO2 IF FILE NOT OPEN
  9096. SB4 X1-TFNFW FWA OF *TFCB* ENTRY
  9097. SA1 REQT CURRENT TRANSACTION SEQUENCE NUMBER
  9098. SA2 B4+TFRQW TRANSACTION SEQUENCE NUMBER FROM *TFCB*
  9099. BX6 X1-X2
  9100. SX7 B4 FWA OF *TFCB* ENTRY
  9101. SA1 B4+TFNFW FWA OF NEXT FILE CONTROL LINK
  9102. NZ X6,IFO1 IF FILE NOT OPEN FOR TRANSACTION
  9103. SA6 IFOA ZERO IF FILE ALREADY OPEN FOR TASK
  9104. SA7 RFCB STORE FWA OF FILE CONTROL ENTRY
  9105. EQ IFO3 VALIDATE KEY AND RECORD LENGTH
  9106.  
  9107.  
  9108. * CHECK FOR FREE FILE CONTROL TABLE ENTRY.
  9109.  
  9110. IFO2 SA1 B3+TLNFW LINK TO FREE FILE CONTROL ENTRIES
  9111. SX4 X1+ FWA OF FREE LINK
  9112. SX6 TERG NO TABLE SPACE FOR OPEN ERROR CODE
  9113. ZR X4,IFOX IF NO FREE ENTRIES
  9114. SA2 X1 NEXT FREE ENTRY
  9115. MX0 60-TLNFN
  9116. SX6 X2 UPDATE FREE ENTRY CHAIN
  9117. BX1 X0*X1 CLEAR OLD POINTER TO NEXT FREE ENTRY
  9118.  
  9119. * FORMAT NEW FILE CONTROL ENTRY.
  9120.  
  9121. SA3 REQT PUT TASK SEQUENCE NO. INTO *TFCB* ENTRY
  9122. SB4 X4-TFNFW FWA OF FILE CONTROL ENTRY
  9123. BX6 X1+X6
  9124. SA6 A1
  9125. BX6 X3
  9126. SX7 B4 FWA OF FILE CONTROL ENTRY
  9127. SA6 B4+TFRQW
  9128. SA7 RFCB
  9129.  
  9130. * LINK NEW FILE CONTROL ENTRY TO OTHER FILE CONTROL ENTRIES
  9131. * FOR TRANSACTIONS AND OTHER FILE CONTROL ENTRIES FOR FILE.
  9132.  
  9133. SA5 B4+TFNTW LINK FOR FILES FOR TRANSACTION
  9134. SA4 B2+TSNFW LINK FOR TRANSACTION-S FILES
  9135. SX3 B3+ FWA OF LOGICAL NAME ENTRY
  9136. LX3 TFLNS-17
  9137. BX5 X5+X3
  9138. RJ LIN INSERT FILE IN CHAIN FOR TRANSACTION
  9139. SA5 B4+TFNFW LINK WORD FOR *TFCB* FOR FILE
  9140. SA4 B3+TLNOW LINK FOR OPEN *TFCB* FOR FILE
  9141. BX5 X5-X5
  9142. RJ LIN INSERT FILE IN CHAIN FOR OPEN FILES
  9143. SA1 B3+TLOPW
  9144. SX0 B1 UPDATE OPEN COUNTS
  9145. IX7 X0+X1
  9146. SA7 A1+
  9147. SA5 RDRF FWA OF CURRENT *TDRF* ENTRY
  9148. GETFLD 2,X5,TDOP CURRENT OPEN FILE COUNT
  9149. IX2 X2+X0 INCREMENT OPEN FILE COUNT
  9150. PUTFLD 2,X5,TDOP
  9151.  
  9152. * CHECK KEY LENGTH AND RECORD LENGTH FROM BEFORE IMAGE
  9153. * AGAINST VALUES GIVEN ON *CRM* CARD. IF VALUES ON
  9154. * *CRM* CARD ARE LESS THAN VALUES FOR FILE BEFORE IMAGE
  9155. * REPORT ERROR.
  9156.  
  9157. IFO3 SX0 B4+TFFTW FWA OF *FIT*
  9158. GETFLD 5,B7,XQKS KEY LENGTH DEFINED IN FILE
  9159. MX1 TLKSN
  9160. SA3 B3+TLKSW KEY LENGTH FROM *CRM* CARD
  9161. BX2 X1*X3
  9162. LX2 TLKSN-1-TLKSS RIGHT JUSTIFY KEY LENGTH
  9163. IX7 X2-X5
  9164. SA3 B3+TLRSW RECORD LENGTH FROM *CRM* CARD
  9165. MX1 TLRSN
  9166. SX6 TERT INVALID KEY LENGTH ON INSTALLATION ERROR
  9167. NG X7,IFOX IF INVALID KEY LENGTH
  9168. SX6 TERU INVALID RECORD LENGTH ON INSTALLATION
  9169. BX4 X1*X3
  9170. LX4 TLRSN-1-TLRSS RIGHT JUSTIFY RECORD LENGTH
  9171. GETFLD 5,B7,XQRS MAXIMUM RECORD LENGTH FOR FILE
  9172. IX7 X4-X5
  9173. NG X7,IFOX IF INVALID RECORD LENGTH
  9174. SA1 IFOA ALREADY OPEN FOR TRANSACTION FLAG
  9175. SX6 X1+
  9176. ZR X6,IFOX IF FILE ALREADY OPEN FOR TRANSACTION
  9177. SA1 B3+TLFEW FATAL ERROR FLAG WORD
  9178. LX1 59-TLFES
  9179. NG X1,IFO5 IF PREVIOUS FATAL *CRM* ERROR
  9180. FETCH X0,OC,X5 *FIT* OPEN STATUS
  9181. SX6 X5-1
  9182. ZR X6,IFOX IF *FIT* OPEN
  9183.  
  9184. * OPEN *FIT* FOR FIRST TASK USAGE.
  9185.  
  9186. SX2 DMCC CEASE CODE TO AVOID *ABS* IN *CCS*
  9187. PUTFLD 2,B2,TSFC STORE CEASE CODE IN *TSEQ*
  9188. SX2 B1
  9189. PUTFLD 2,B4,TFBF FREE TO AVOID STATUS TO USER IN *CCS*
  9190.  
  9191. * FIRST TIME FILE IS OPENED.
  9192.  
  9193. RJ IOP INITIAL OPEN FILE
  9194. SA2 RSEQ FWA OF *TSEQ* ENTRY
  9195. SA3 RLNT FWA OF *TLNT* ENTRY
  9196. SA4 RFCB FWA OF *TFCB* ENTRY
  9197. SB2 X2
  9198. SB3 X3
  9199. SB4 X4+
  9200. SX0 B4+TFFTW FWA OF *FIT*
  9201. SB1 1 RESTORE (B1)
  9202. SX2 B0
  9203. PUTFLD 2,B2,TSFC CLEAR REQUEST CODE IN *TSEQ*
  9204. PUTFLD 2,B4,TFBF CLEAR FREE FLAG IN *TFCB*
  9205. ZR X6,IFOX IF NO ERROR
  9206. SX1 X6-TERI
  9207. NZ X1,IFOX IF NOT *CRM* ERROR
  9208.  
  9209. * REPORT FILE OPEN ERROR.
  9210.  
  9211. IFO5 SA2 B3+TLFNW FILE NAME
  9212. SA1 IMSG ERROR ON OPEN MESSAGE
  9213. MX7 TLFNN MASK
  9214. RJ NMS REPORT ERROR ON OPEN
  9215. MX7 -TSRCN
  9216. LX7 TSRCS-TSRCN+1
  9217. SA1 B2+TSRCW RECOVERED TASK FLAG WORD
  9218. BX7 X7*X1 CLEAR RECOVERED TASK FLAG
  9219. SA7 A1
  9220. SX6 0 NO ERROR TO CONTINUE
  9221. EQ IFOX RETURN
  9222.  
  9223. IFOA BSS 1 ZERO IF TRANSACTION ALREADY OPENED FILE
  9224. EJECT
  9225. ** IOC - BEFORE IMAGE RECOVERY FILE I/O COMPLETION CHECK.
  9226. * WAIT FOR I/O TO COMPLETE, CHECK FOR I/O ERROR.
  9227. *
  9228. * ENTRY (B5) = FWA OF *TBRF*.
  9229. *
  9230. * EXIT (X6) = ZERO IF COMPLETED WITHOUT ERROR.
  9231. * (X6) = 12B IF *CIO* ERROR ON RECOVERY FILE.
  9232. *
  9233. * USES X - 1, 2, 6.
  9234. * A - 1.
  9235. * B - NONE.
  9236.  
  9237.  
  9238. IOC SUBR ENTRY/EXIT
  9239. IOC1 SA1 B5+TQFCW *TBRF* FET*0 WORD
  9240. SX2 X1
  9241. LX1 59 COMPLETION BIT TO SIGN POS
  9242. PL X1,IOC1 IF I/O NOT COMPLETE
  9243. AX2 10
  9244. MX6 -4
  9245. BX6 -X6*X2 GET *AT* FIELD OF FET+0
  9246. ZR X6,IOCX IF NO I/O ERROR
  9247. SX6 12B *CIO* ERROR ON RECOVERY FILE ERROR CODE
  9248. EQ IOCX RETURN WITH ERROR
  9249.  
  9250. SPACE 4,10
  9251. ** IRF - INITIALIZE RECOVERY FILES.
  9252. *
  9253. * ENTRY (B2) = FWA OF *TTIP* TABLE OF PARAMETERS.
  9254. * (X1) = FWA OF FIRST *TDRF* ENTRY.
  9255. *
  9256. * EXIT (X6) = 12, IF *CIO* ERROR ON RECOVERY FILE.
  9257. * = 14, IF DATA BASE ENTRY NOT IN *EDT*.
  9258. * = 15, IF ILLEGAL FAMILY NAME IN *EDT* ENTRY.
  9259. * = 16, IF BATCH RECOVERY ACTIVE STATUS ON *ARF*.
  9260. *
  9261. * USES X - 1, 2, 3, 5, 6, 7.
  9262. * A - 0, 1, 2, 3, 5, 6, 7.
  9263. * B - 3, 4, 5, 7.
  9264. *
  9265. * MACROS BKSP, GETFLD, PUTFLD, RETURN, REWRITER,
  9266. * SKIPFF.
  9267. *
  9268. * CALLS ARF, CAT, GFL, NMS, RDH, SED, SFM
  9269. * VER, VLH, VQH.
  9270.  
  9271.  
  9272. IRF SUBR ENTRY/EXIT
  9273. IRF1 SB5 X1
  9274. GETFLD 1,B5,TDQN GET NUMBER OF *BRF-S* FROM *TDRF*
  9275. ZR X1,IRF11 IF NO *BRF-S* RECOVERY IS NOT ACTIVE
  9276. SA2 B5+TDIDW DATA BASE ID
  9277. SA1 IMSI INITIALIZE RECOVERY FILES MESSAGE
  9278. MX7 TDIDN DATA BASE ID MASK
  9279. RJ NMS REPORT RECOVERY FILE INITIALIZATION
  9280. SA1 B5+TDIDW GET DATA BASE ID FROM *TDRF*
  9281. RJ SED SEARCH *EDT* FOR DATA BASE UI AND FAMILY
  9282. SX6 14B DATA BASE ENTRY NOT IN *EDT* ERROR CODE
  9283. ZR B7,IRFX IF DATA BASE *EDT* ENTRY NOT FOUND
  9284. SA1 B7+6 GET FAMILY FROM *EDT*
  9285. BX7 X1
  9286. MX6 -18
  9287. SA1 B7+2 GET USER INDEX FROM *EDT*
  9288. RJ SFM SET DATA BASE UI AND FAMILY
  9289. SX6 15B ILLEGAL FAMILY NAME IN *EDT* ERROR CODE
  9290. NG X1,IRFX IF ERROR ON SET FAMILY
  9291. *
  9292. * THE CURRENT DATA BASE*S USER INDEX AND FAMILY IS NOW ACTIVE.
  9293. * THE PREVIOUS FAMILY NAME IS IN *SFMA* AND, WITH *TAF*S
  9294. * USER INDEX, WILL BE USED TO RESTORE INITIAL FAMILY AND
  9295. * UI AFTER PROCESSING EACH DATA BASE.
  9296. *
  9297. * ALLOCATE AFTER IMAGE RECOVERY FILES.
  9298. *
  9299. GETFLD 1,B5,TDAL GET FWA OF *TARF* FROM *TDRF*
  9300. SB4 X1
  9301. SA0 B4+TAFFW (A0) = FWA OF FET IN *TARF*
  9302. SA5 B4+TAFNW (A5) = FWA OF HEADER, (X5) = HEADER WORD 1
  9303. SB7 B0+ (B7) = ZERO FOR *ARF* PROCESSING
  9304. RJ GFL GET ARF01 LOCAL
  9305. NZ X6,IRFX IF ERROR ON GETTING FILE LOCAL
  9306. GETFLD 1,B4,TAFF GET INITIAL LRF NAME FROM *TARF* FET
  9307. SX7 B1
  9308. IX1 X1+X7 CHANGE ARF01 TO ARF02
  9309. LX1 TAFNS-TAFNN+1
  9310. BX6 X1
  9311. SA6 A5 STORE SECOND *ARF* NAME IN *TARF* HEADER
  9312. IX6 X1+X7 SET COMPLETION BIT FOR FET+0
  9313. SA6 A0 STORE SECOND *ARF* NAME IN FET
  9314. SA5 A5 (A5) = FWA OF HEADER,(X5) = HEADER WORD 1
  9315. SB7 B0 (B7) = ZERO FOR *ARF* PROCESSING
  9316. RJ GFL GET ARF02 LOCAL
  9317. NZ X6,IRFX IF ERROR ON GETTING FILE LOCAL
  9318. SA1 IMSP VALIDATION MESSAGE
  9319. MX7 TAFNN FILE NAE MASK
  9320. SA2 A0 FILE NAME
  9321. RJ NMS REPORT VALIDATION OF ARF 2
  9322. *
  9323. * BOTH ARF*S FOR CURRENT DATA BASE ARE NOW LOCAL.
  9324. * THE HEADERS WILL BE VALIDATED, AND THE INACTIVE
  9325. * *ARF* WILL BE RETURNED, THE ACTIVE *ARF* POSITIONED AT EOF.
  9326. *
  9327. IRF2 RJ RDH READ ARF02 HEADER
  9328. SX6 12B CIO ERROR ON RECOVERY FILE ERROR CODE
  9329. NZ X1,IRFX IF ERROR ON READ HEADER
  9330. RJ VLH VALIDATE ARF02 HEADER
  9331. ZR X6,IRF3 IF ARF02 VALIDATED
  9332. SX1 X6-5 CHECK FOR INCONSISTENT ERROR CODE
  9333. NZ X1,IRFX IF NOT HEADER ERROR
  9334. RJ VER REPORT HEADER ERROR TO OPERATOR
  9335. NZ X6,IRFX IF OPERATOR DROP OR FUNCTION 7
  9336. SA1 IMSJ ALLOCATION MESSAGE
  9337. SA2 B4+TAFNW FILE NAME
  9338. MX7 TAFNN
  9339. RJ NMS REPORT RE-ALLOCATION
  9340. SX6 B1
  9341. SB7 B0 (B7) = ZERO FOR *ARF* ALLOCATION
  9342. SA0 B4+TAFFW (A0) = FWA OF FET IN *TARF*
  9343. SA5 B4+TAFNW (A5) = FIRST WORD OF HEADER
  9344. SA6 B4+TARRW *RR* FOR FIRST PRU TO FET+6
  9345. RJ AAF RE-ALLOCATE ARF02
  9346. ZR X6,IRF2 IF RE-ALLOCATED WITHOUT ERROR
  9347. SX6 12B *CIO* ERROR ON ARF02
  9348. EQ IRFX EXIT
  9349.  
  9350. IRF3 GETFLD 1,B4,TAFF GET ARF02 NAME FROM FET
  9351. AX6 B1,X1 DROP LOW BIT TO CHANGE ARF02 TO ARF01
  9352. LX6 18+1
  9353. SA6 B4+TAFNW STORE ARF01 NAME IN HEADER
  9354. SX1 B1
  9355. IX6 X6+X1 SET COMPLETION BIT FOR FET+0
  9356. SA6 A0 STORE ARF01 NAME IN FET
  9357. SA1 IMSP VALIDATION MESSAGE
  9358. MX7 TAFNN FILE NAME MASK
  9359. SA2 A0 FILE NAME
  9360. RJ NMS REPORT VALIDATION OF ARF 1
  9361. IRF4 RJ RDH READ ARF01 HEADER
  9362. SX6 12B CIO ERROR ON RECOVERY FILE ERROR CODE
  9363. NZ X1,IRFX IF ERROR ON READ HEADER
  9364. RJ VLH VALIDATE ARF01 HEADER
  9365. ZR X6,IRF5 IF ARF01 VALIDATED
  9366. SX1 X6-5 CHECK FOR INCONSISTENT ERROR CODE
  9367. NZ X1,IRFX IF NOT HEADER ERROR
  9368. RJ VER REPORT HEADER ERROR TO OPERATOR
  9369. NZ X6,IRFX IF OPERATOR DROP OR FUNCTION 7
  9370. SA1 IMSJ ALLOCATION MESSAGE
  9371. SA2 B4+TAFNW FILE NAME
  9372. MX7 TAFNN
  9373. RJ NMS REPORT RE-ALLOCATION
  9374. SX6 B1
  9375. SB7 B0 (B7) = ZERO FOR *ARF* ALLOCATION
  9376. SA0 B4+TAFFW (A0) = FWA OF FET IN *TARF*
  9377. SA5 B4+TAFNW (A5) = FIRST WORD OF HEADER
  9378. SA6 B4+TARRW *RR* FOR FIRST PRU TO FET+6
  9379. RJ AAF RE-ALLOCATE ARF 1
  9380. ZR X6,IRF4 IF RE-ALLOCATED WITHOUT ERROR
  9381. SX6 12B *CIO* ERROR ON ARF02
  9382. EQ IRFX EXIT
  9383.  
  9384. * SET UP ACTIVE *ARF* HEADER.
  9385. * (B6) = FWA OF *ARF* BUFFER (SET AT *VLH*).
  9386.  
  9387. IRF5 GETFLD 2,B5,TDLP LAST CHARACTER OF ACTIVE *ARF*
  9388. ZR X2,IRF6 IF NO ACTIVE *ARF* FOUND
  9389. PUTFLD 2,B4,TALP CHANGE FET NAME TO ACTIVE *ARF*
  9390. IRF6 MX7 TAFNN NAME MASK
  9391. SA2 A0 FILE NAME FROM FET
  9392. SA1 IMSQ ACTIVE *ARF* MESSAGE
  9393. RJ NMS REPORT NAME OF ACTIVE *ARF*
  9394. RJ RDH READ HEADER OF ACTIVE OR LAST VALIDATED
  9395. SX6 12B CIO ERROR ON RECOVERY FILE ERROR CODE
  9396. NZ X1,IRFX IF ERROR ON READ ACTIVE HEADER
  9397. GETFLD 2,B4,TAFF *ARF* NAME FROM FET
  9398. BX6 X2
  9399. PUTFLD 2,B5,TDLP STORE LAST CHARACTER OF ARF 1 NAME
  9400. LX6 TAFNS-TAFNN+1
  9401. SX1 XHER *ARF* ERROR STATUS
  9402. BX6 X6+X1
  9403. SA6 B6 STORE IN ARF01 BUFFER HEADER
  9404. MX7 -TAD1N
  9405. LX7 TAD1S-TAD1N+1
  9406. SA1 B6+TAD1W-TAFNW HEADER WORD 3
  9407. BX7 -X7+X1 SET FIRST *ARF* DUMP FLAG
  9408. SA7 A1+ STORE FLAG
  9409. SX6 B1 *CRI* FOR HEADER
  9410. SA6 A0+6 STORE *RR* FIELD FOR HEADER
  9411. REWRITER A0,R RE-WRITE ARF01 HEADER WITH ACTIVE STATUS
  9412. SX2 A0 FWA OF FET
  9413. RJ CAT CHECK/CLEAR *AT* FIELD
  9414. SX6 12B CIO ERROR ON RECOVERY FILE ERROR CODE
  9415. NZ X1,IRFX IF ERROR ON REWRITE HEADER
  9416. GETFLD 2,B5,TDLB LAST BIT OF ACTIVE *ARF* NAME
  9417. MX7 -TDLBN
  9418. BX2 -X7-X2 TOGGLE LAST BIT OF *ARF* NAME
  9419. PUTFLD 2,B4,TALB CHANGE NAME IN FET TO INACTIVE *ARF*
  9420. RETURN A0,R RETURN INACTIVE *ARF*
  9421. GETFLD 2,B5,TDLB LAST BIT OF ACTIVE *ARF* NAME
  9422. PUTFLD 2,B4,TALB CHANGE NAME IN FET TO ACTIVE *ARF*
  9423. RJ RDH READ ACTIVE *ARF* HEADER
  9424. SX6 12B CIO ERROR ON RECOVERY FILE ERROR CODE
  9425. NZ X1,IRFX IF ERROR ON READ ACTIVE *ARF* HEADER
  9426. SB3 TAHDL NUMBER OF WORDS IN *ARF* HEADER
  9427. IRF7 SB3 B3-B1
  9428. SA1 B6+B3 MOVE ACTIVE *ARF* HEADER INTO *TARF*
  9429. BX7 X1
  9430. SA7 B7+B3
  9431. NZ B3,IRF7 IF MORE WORDS TO MOVE
  9432. SKIPFF A0,,R POSITION AT EOF
  9433. MX7 -4
  9434. SA1 A0
  9435. AX1 14
  9436. BX1 -X7*X1 GET *LN* FIELD OF FET+0
  9437. SX1 X1-17B
  9438. SX6 5 RECOVERY FILE INCONSISTENT ERROR CODE
  9439. NZ X1,IRFX IF NOT POSITIONED AT EOF
  9440. BKSP A0,R POSITION BEFORE EOF
  9441. GETFLD 1,B4,TAFL LENGTH OF *ARF* WITHOUT HEADER PRU
  9442. SX3 B1+B1
  9443. GETFLD 2,B4,TARI CURRENT MS RANDON INDEX
  9444. IX2 X2-X3 LESS ONE FOR EOF, AND ONE FOR HEADER PRU
  9445. GETFLD 3,B4,TAFT *FIRST* FROM *ARF* FET
  9446. IX6 X1-X2 GET UNUSED PRU COUNT
  9447. PUTFLD 6,B4,TACP STORE *ARF* UNUSED PRU COUNT
  9448. SX7 X3
  9449. SA7 B4+TAINW SET *IN* .EQ. *FIRST*
  9450. SA7 A7+1 SET *OUT* .EQ. *FIRST*
  9451. *
  9452. * ALLOCATE BEFORE IMAGE RECOVERY FILES.
  9453. *
  9454. GETFLD 1,B5,TDQL GET FWA OF FIRST *TBRF* FROM *TDRF*
  9455. IRF8 SB4 X1 FWA OF CURRENT *TBRF*
  9456. SB7 B1 (B7) = 1 FOR *BRF* PROCESSING
  9457. SA0 B4+TQFFW (A0) = FWA OF FET IN *TBRF*
  9458. SA5 B4+TQFNW (A5) = FWA OF HEADER, (X5) = HEADER WORD
  9459. RJ GFL GET *BRF* LOCAL
  9460. NZ X6,IRFX IF ERROR IN GETTING FILE LOCAL
  9461. SA1 IMSP VALIDATION MESSAGE
  9462. MX7 TQFNN FILE NAE MASK
  9463. SA2 A0 FILE NAME
  9464. RJ NMS REPORT *BRF* VALIDATION
  9465. IRF9 RJ RDH READ *BRF* HEADER
  9466. SX6 12B CIO ERROR ON RECOVERY FILE ERROR CODE
  9467. NZ X1,IRFX IF ERROR ON READ *BRF* HEADER
  9468. RJ VQH VALIDATE *BRF* HEADER
  9469. ZR X6,IRF10 IF *BRF* VALIDATED
  9470. SA1 IAMC FUNCTION CODE
  9471. SX1 X1-7 CHECK FOR FUNCTION 7 RECOVERY MODE
  9472. ZR X1,IRFX IF RECOVERY MODE NO *BRF* REALLOCATION
  9473. RJ VER REPORT HEADER ERROR TO OPERATOR
  9474. NZ X6,IRFX IF OPERATOR DROP OR *IAM* FUNCTION 7
  9475. SA1 IMSJ ALLOCATION MESSAGE
  9476. SA2 B4+TQFNW FILE NAME
  9477. MX7 TQFNN
  9478. RJ NMS REPORT RE-ALLOCATION
  9479. SX6 B1
  9480. SB7 B1 (B7) = ONE FOR *BRF* ALLOCATION
  9481. SA0 B4+TQFFW (A0) = FWA OF FET IN *TBRF*
  9482. SA5 B4+TQFNW (A5) = FIRST WORD OF HEADER
  9483. SA6 B4+TQRRW *RR* FOR FIRST PRU TO FET+6
  9484. RJ AAF RE-ALLOCATE *BRF*
  9485. ZR X6,IRF9 IF *BRF* RE-ALLOCATED WITHOUT ERROR
  9486. SX6 12B *CIO* ERROR ON *BRF*
  9487. EQ IRFX EXIT
  9488.  
  9489. IRF10 GETFLD 1,B4,TQFT *FIRST* FROM *BRF* FET
  9490. BX7 X1
  9491. SA7 B4+TQINW SET *IN* .EQ. *FIRST*
  9492. SA7 A7+1 SET *OUT* .EQ. *FIRST*
  9493. GETFLD 1,B4,TQNL GET FWA OF NEXT *TBRF* FOR THIS DATA BASE
  9494. NZ X1,IRF8 IF MORE *BRF-S* FOR THIS DATA BASE
  9495. SX1 TRUI *TAF* UI
  9496. SA2 VUSN
  9497. BX1 X1+X2
  9498. SX7 B0+ USE PREVIOUS FAMILY
  9499. RJ SFM RESET ORIGINAL UI AND FAMILY
  9500. IRF11 GETFLD 1,B5,TDDL GET FWA OF NEXT *TDRF*
  9501. NZ X1,IRF1 IF MORE *TDRF*S, PROCESS NEXT DATA BASE
  9502. SX6 B0 NO ERROR
  9503. EQ IRFX RETURN - RECOVERY FILES INITIALIZED
  9504. SPACE 4,10
  9505. ** MSG - MESSAGE TO DAYFILE / OPERATOR.
  9506. *
  9507. * ENTRY (A5) = FWA OF MESSAGE.
  9508. * (X5) = FIRST WORD OF MESSAGE.
  9509. * IF FIRST CHARACTER OF MESSAGE IS .EQ. *$* -
  9510. * MESSAGE IS ISSUED WITH OPTION .EQ. 3.
  9511. * RETURN TO CALLER WHEN RESPONSE
  9512. * *GO* OR *DR* (DROP) IS DETECTED.
  9513. *
  9514. * IF FIRST CHARACTER OF MESSAGE IS .NE. *$* -
  9515. * MESSAGE IS ISSUED WITH OPTION .EQ. 0.
  9516. * RETURN TO CALLER.
  9517. *
  9518. * EXIT (X5) = ZERO IF MESSAGE ISSUED WITH OPTION .EQ. 0, OR
  9519. * IF RESPONSE *GO* DETECTED FOR OPTION .EQ. 3.
  9520. * = NON-ZERO IF RESPONSE *DR* DETECTED FOR
  9521. * OPTION .EQ. 3.
  9522. *
  9523. * USES X - 1, 5, 6.
  9524. * A - 1, 6.
  9525. * B - NONE.
  9526. *
  9527. * MACROS MESSAGE, RECALL.
  9528.  
  9529.  
  9530. MSG SUBR ENTRY/EXIT
  9531. LX5 6
  9532. MX6 -6
  9533. BX6 -X6*X5
  9534. SX5 B0 SET OPTION .EQ. ZERO
  9535. SX6 X6-1R$
  9536. NZ X6,MSG2 IF FIRST CHARACTER OF MESSAGE .NE. *$*
  9537. MSG1 SA1 B0 GET RA+0
  9538. SX6 5
  9539. LX6 12 (POSITION BIT 12 AND 14 MASK)
  9540. BX6 X6+X1 SET CFO AND PAUSE BITS
  9541. SA6 A1+
  9542. SX5 3 SET OPTION .EQ. THREE
  9543. MSG2 MESSAGE A5,X5,R
  9544. ZR X5,MSGX IF OPTION .EQ. ZERO RETURN
  9545. MESSAGE MSGL,2
  9546. MESSAGE MSGM,3 REQUEST OPERATOR RESPONSE
  9547. MSG3 RECALL
  9548. SA1 B0 CHECK CFO BIT IN RA+0
  9549. LX1 59-14
  9550. NG X1,MSG3 IF NO RESPONSE
  9551. MESSAGE MSGZWD,2
  9552. SA1 70B GET RESPONSE FROM RA+70B
  9553. AX1 48 CHECK FIRST TWO CHARACTERS ONLY
  9554. SX6 X1-2RDR CHECK *DR*
  9555. ZR X6,MSGX IF RESPONSE .EQ. *DR*, RETURN (X5) .EQ. 3
  9556. SX5 X1-2RGO CHECK *GO*
  9557. ZR X5,MSGX IF RESPONSE .EQ. *GO*, RETURN (X5) .EQ. 0
  9558. EQ MSG1 RE-ISSUE MESSAGE ON INVALID RESPONSE
  9559.  
  9560. MSGZWD BSSZ 1 ZERO WORD
  9561. SPACE 4,10
  9562. ** RMP - RECOVERY MODE PROCESS.
  9563. *
  9564. * RECOVER ABNORMALLY TERMINATED RECOVERABLE TASKS
  9565. * FROM BEFORE IMAGE RECOVERY FILES.
  9566. * RESTORE TRANSACTION SEQUENCE ENTRIES,
  9567. * LOGICAL NAME TABLE ENTRIES, FILE CONTROL
  9568. * ENTRIES, ETC. IN PREPARATION FOR POST
  9569. * INITIALIZATION *TRMREC* REQUESTS.
  9570. *
  9571. * ENTRY (RDRT) = FWA OF FIRST *TDRF* ENTRY.
  9572. * DATA BASE BEFORE IMAGE RECOVERY FILES (*BRF*) LOCAL
  9573. * AND VALIDATED.
  9574. * TABLES ALLOCATED/INITIALIZED.
  9575. * DATA BASE AFTER IMAGE RECOVERY FILES (*ARF*) LOCAL,
  9576. * VALIDATED, AND POSSITIONED BEFORE EOF.
  9577. *
  9578. * EXIT (X6) = ZERO IF NO ERRORS.
  9579. * TRANSACTION SEQUENCE TABLE ENTRY
  9580. * ASSIGNED FOR TASKS RECOVERED.
  9581. * AFTER AND BEFORE IMAGE RECOVERY FILE TABLE ENTRY
  9582. * ASSIGNED FOR TASKS WITH BEGIN SEQUENCE ACTIVE.
  9583. * FILES IN USE BY TASKS WITH ACTIVE BEGIN
  9584. * SEQUENCE ARE *OPEN* AND *LOCKED*.
  9585. *
  9586. * (X6) = NON-ZERO, IF RECOVERY IMPOSSIBLE.
  9587. *
  9588. * USES X - 1, 2, 3, 4, 6, 7.
  9589. * A - 1, 2, 3, 4, 6, 7.
  9590. * B - 3, 5, 6, 7.
  9591. *
  9592. * MACROS GETFLD, IXN, MESSAGE, PUTFLD.
  9593. *
  9594. * CALLS ARR, CTW, FTS, IFO, IOC, LOK,
  9595. * MVD, NMS, RBI, SFF.
  9596.  
  9597.  
  9598. RMP SUBR ENTRY/EXIT
  9599. SX7 CMDM*RMDM MAX NUMBER OF UNUSED *TSEQ* TABLE ENTRIES
  9600. SA7 IAMD INITIALIZE UNUSED *TSEQ* ENTRY COUNT
  9601. SX6 TSEQXL LWA+1 OF MULTI-MAINFRAME *TSEQ* TABLE
  9602. SA6 TSEQLWA STORE LWA+1 *TSEQ* TABLE
  9603. SA2 IMSB RECOVERY MODE PRESET BEGIN MESSAGE
  9604. MESSAGE A2
  9605. SA1 RDRT FWA OF FIRST *TDRF* ENTRY
  9606. RMP1 SX6 X1+ FWA OF NEXT *TDRF* ENTRY
  9607. SA6 REQT CLEAR *REQT* IF NO ERROR
  9608. ZR X6,RMP14 IF ALL DATA BASES PROCESSED
  9609. SA6 RDRF STORE FWA OF CURRENT DATA BASE *TDRF*
  9610. SA1 X6+TDQLW FWA OF FIRST DATA BASE *TBRF* ENTRY
  9611. LX1 TDQLN-1-TDQLS RIGHT JUSTIFY
  9612. SB5 X1 FWA OF *TBRF* ENTRY
  9613. SA1 X6+TDDLW FWA OF NEXT *TDRF* ENTRY
  9614. ZR B5,RMP1 IF NO *TBRF-S*, NOT RECOVERABLE DATA BASE
  9615. SA2 X6+TDIDW DATA BASE ID
  9616. SA1 IMSO RECOVERABLE DATA BASE MESSAGE
  9617. MX7 TDIDN DATA BASE ID MASK
  9618. RJ NMS REPORT RECOVERABLE DATA BASE NAME
  9619.  
  9620. * PROCESS ALL BEFORE IMAGE RECOVERY FILES FOR DATA BASE.
  9621.  
  9622. RMP2 SA1 RDRF FWA OF CURRENT *TDRF* ENTRY
  9623. SA1 X1+TDDLW FWA OF NEXT *TDRF* ENTRY
  9624. ZR B5,RMP1 IF ALL DATA BASE *BRF-S* PROCESSED
  9625. SX6 B0
  9626. SX7 B5
  9627. SA7 RMPA SAVE FWA OF CURRENT *TBRF* ENTRY
  9628. SA6 RMPB INITIALIZE *BRF* SEGMENT COUNTER
  9629. SA1 IMSC *BRF* FILE NAME MESSAGE
  9630. SA2 B5+TQFFW *BRF* FILE NAME
  9631. MX7 TQFFN
  9632. RJ NMS REPORT *BRF* NAME
  9633.  
  9634. * PROCESS ALL SEGMENTS OF BEFORE IMAGE RECOVERY FILE.
  9635.  
  9636. RMP3 GETFLD 1,B5,TQNS NUMBER OF SEGMENTS PER *BRF*
  9637. SA2 RMPB NEXT SEGMENT TO PROCESS
  9638. IX3 X1-X2
  9639. PL X3,RMP4 IF MORE SEGMENTS TO PROCESS
  9640. SA1 B5+TQNLW FWA OF NEXT *TBRF* FOR DATA BASE
  9641. LX1 TQNLN-1-TQNLS RIGHT JUSTIFY
  9642. SB5 X1 FWA OF *TBRF*
  9643. EQ RMP2 PROCESS NEXT DATA BASE *BRF*
  9644.  
  9645. * PROCESS FIRST RECORD OF EACH SEGMENT.
  9646. * CALCULATE RANDOM INDEX (CRI) FOR FIRST PRU
  9647. * OF SEGMENT.
  9648.  
  9649. RMP4 GETFLD 1,B5,TQNP NUMBER OF PRU*S PER SEGMENT
  9650. IX7 X2*X1 SEGMENT * PRUS PER SEGMENT
  9651. SX1 B1+B1
  9652. IX7 X7+X1 PLUS TWO = CRI OF 1ST PRU OF SEGMENT
  9653. SA7 RMPE SAVE *RR* OF SEGMENT PRU
  9654. RJ RBI READ FIRST BI OF SEGMENT
  9655. RJ IOC WAIT FOR I/O COMPLETION
  9656. NZ X6,RMP13 IF *CIO* ERROR ON *BRF*
  9657. SA1 B5+TQFTW FWA OF *BRF* BUFFER FROM *TBRF* FET
  9658. SB3 X1 FWA OF BEFORE IMAGE
  9659. GETFLD 1,B3,XQTY TYPE CODE FROM BI HEADER
  9660. NZ X1,RMP6 IF BI TYPE IS NOT *CEASE* STAMP
  9661. RMP5 SX1 B1
  9662. SA2 RMPB SEGMENT COUNTER
  9663. IX7 X2+X1 INCREMENT SEGMENT COUNT
  9664. SA7 A2 STORE NEXT SEGMENT NUMBER
  9665. EQ RMP3 PROCESS NEXT SEGMENT OF *BRF*
  9666.  
  9667. * RECOVER TASKS FOR WHICH *CEASE* OR *TRMREC*
  9668. * WAS NOT PROCESSED.
  9669.  
  9670. RMP6 GETFLD 1,B3,XQSQ TRANSACTION SEQUENCE NUMBER FROM BI HEADER
  9671. LX1 TSSNS-TSSNN+1
  9672. SA2 B3+XQPDW PDATE FROM BI HEADER
  9673. BX6 X1
  9674. BX7 X2
  9675. SA6 REQT STORE REQUEST FOR *FTS*
  9676. SA7 RMPC SAVE BI PDATE
  9677. RJ FTS FIND TRANSACTION SEQUENCE TABLE ENTRY
  9678. NE B7,B2,RMP7 IF NOT NEW *TSEQ* ENTRY
  9679. SX7 B2+
  9680. SA7 RSEQ STORE FWA OF TRANSACTION SEQUENCE ENTRY
  9681.  
  9682. * COUNT NUMBER OF UNUSED *TSEQ* TABLE ENTRIES.
  9683.  
  9684. SA1 IAMD UNUSED *TSEQ* ENTRY COUNT
  9685. SX7 B1
  9686. IX7 X1-X7 DECREMENT UNUSED *TSEQ* TABLE ENTRY COUNT
  9687. SA7 A1+
  9688. SA2 B3+XQTNW TASK NAME FROM BI HEADER
  9689. SA1 B3+XQUNW GET USER NAME
  9690. BX7 X2
  9691. BX6 X1
  9692. SA7 B2+TSTNW STORE TASK NAME IN *TSEQ* ENTRY
  9693. SA6 B2+TSUNW PUT USER NAME IN *TSEQ* TABLE
  9694.  
  9695. * ASSIGN *TARF*, *TBRF*, AND *BRF* FILE SEGMENT
  9696. * FOR RECOVERED TASKS .
  9697.  
  9698. SA2 RDRF FWA OF DATA BASE *TDRF* ENTRY
  9699. GETFLD 3,X2,TDAL GET FWA OF *TARF* ENTRY
  9700. PUTFLD 3,B2,TSLF ASSIGN *TARF* TO *TSEQ*
  9701. SX2 B5+ FWA OF CURRENT *TBRF* ENTRY
  9702. PUTFLD 2,B2,TSQF ASSIGN *TBRF* TO *TSEQ*
  9703. SX2 60
  9704. SA1 RMPB CURRENT *BRF* SEGMENT NUMBER
  9705. IX2 X1/X2 CALCULATE BIT MAP WORD NUMBER
  9706. PUTFLD 2,B2,TSQW STORE ALLOCATION BIT MAP WORD NUMBER
  9707. SX6 5 NUMBER OF *BRF-S*/DATA BASE CHANGED ERROR
  9708. SX1 X2-.TQRFE
  9709. PL X1,RMPX IF BIT MAP WORD LARGER THAN ALLOCATED
  9710. SX6 60
  9711. SA1 RMPB CURRENT SEGMENT NUMBER
  9712. IX2 X2*X6 (WORD NO. * 60)
  9713. IX3 X1-X2 (BIT POSSITION FROM LEFT IN MAP WORD)
  9714. SX6 59
  9715. IX3 X6-X3 (BIT NUMBER FROM RIGHT IN MAP WORD)
  9716. PUTFLD 3,B2,TSQB STORE BIT MAP WORD BIT NUMBER
  9717. SB7 X3+
  9718. SX7 B1
  9719. SX1 B5+X2 (FWA OF *TBRF* + BIT MAP WORD INDEX)
  9720. SA1 X1+TQBMW GET BIT MAP WORD
  9721. LX7 B7,X7 POSSITION BIT TO ASSIGNED SEGMENT
  9722. BX6 X1
  9723. BX6 X7*X1
  9724. BX7 X7+X1 ASSIGN SEGMENT
  9725. NZ X6,RMPX IF SEGMENT ALREADY ASSIGNED
  9726. SA7 A1+ RESTORE BIT MAP WORD
  9727. RJ ARR ASSIGN *RR* OF FIRST PRU OF SEGMENT
  9728. GETFLD 1,B2,TSQR ASSIGNED *RR*
  9729. SA2 RMPE CURRENT *RR*
  9730. IX6 X1-X2
  9731. NZ X6,RMPX IF *RR* OF 1ST SEGMENT PRU ERROR
  9732. MX7 -TSRCN
  9733. LX7 TSRCS-TSRCN+1
  9734. SA1 B2+TSRCW TASK RECOVERED FROM *BRF* FLAG WORD
  9735. BX7 -X7+X1
  9736. SA7 A1 SET TASK RECOVERED IN *TSEQ*
  9737. SA2 RDRF CURRENT *TDRF* ADDRESS
  9738. GETFLD 3,X2,TDCT COUNT OF ACTIVE RECOVERY TRANSACTIONS
  9739. SX3 X3+B1 INCREASE COUNT
  9740. PUTFLD 3,X2,TDCT RESTORE COUNT
  9741. RMP7 SA1 B3+XQBPW PREVIOUS AND CURRENT BEGIN ID*S FROM BI
  9742. SA2 B3+XQBRW BEGIN ACTIVE FLAG FROM BI HEADER
  9743. LX2 59-XQBRS
  9744. BX6 X1
  9745. SA6 B2+TSBPW STORE BI BEGIN ID*S IN *TSEQ*
  9746. PL X2,RMP11 IF BI IS COMMIT OR FREE STAMP - NEXT SEG
  9747.  
  9748. * PROCESS FOR TASKS WITH *DBEGIN* ACTIVE.
  9749.  
  9750. SA1 B2+TSBRW BEGIN PROCESSED FLAG WORD IN *TSEQ*
  9751. MX7 -TSBRN
  9752. LX7 TSBRS-TSBRN+1
  9753. BX7 -X7+X1
  9754. SA7 A1 SET BEGIN PROCESSED FLAG IN *TSEQ*
  9755. SB7 B3 FWA OF BEFORE IMAGE RECORD
  9756. EQ RMP9 FIND *TLNT* ENTRY FOR 1ST BI LFN
  9757.  
  9758. * CHECK FOR END OF SEGMENT OR END OF
  9759. * VALID BEFORE IMAGE RECORDS IN SEGMENT.
  9760.  
  9761. RMP8 GETFLD 1,B2,TSBI NUMBER OF BEFORE IMAGES PROCESSED
  9762. GETFLD 2,B5,TQNP NUMBER OF BEFORE IMAGES PER SEGMENT
  9763. SA3 B2+TSQRW CRI FOR NEXT BI RECORD OF SEGMENT
  9764. BX1 X2-X1
  9765. BX7 X3 CRI FOR NEXT BI
  9766. ZR X1,RMP11 IF MAXIMUM BI*S PER SEGMENT PROCESSED
  9767. RJ RBI READ NEXT BEFORE IMAGE RECORD
  9768. RJ IOC WAIT FOR I/O COMPLETION
  9769. NZ X6,RMP13 IF *CIO* ERROR ON *BRF*
  9770. SA1 B5+TQFTW FWA OF *BRF* BUFFER FROM *TBRF* FET
  9771. SA2 X1+XQBPW PREVIOUS AND CURRENT BEGIN ID*S FROM BI
  9772. SA3 B2+TSBPW BEGIN ID*S FROM FIRST BI RECORD
  9773. SB7 X1 FWA OF BEFORE IMAGE RECORD
  9774. BX2 X2-X3
  9775. NZ X2,RMP11 IF BEGIN ID*S CHANGED - NEXT SEGMENT
  9776. GETFLD 1,B7,XQSQ TASK SEQUENCE NUMBER FORM BI HEADER
  9777. LX1 TSSNS-TSSNN+1
  9778. SA2 REQT TASK SEQUENCE NUMBER FROM FIRST BI RECORD
  9779. SA3 B7+XQPDW PDATE FROM BI HEADER
  9780. SA4 RMPC PDATE FROM PREVIOUS BI RECORD
  9781. BX1 X1-X2 COMPARE TRANSACTION SEQUENCE NUMBERS
  9782. NZ X1,RMP11 IF SEQUENCE NUMBERS CHANGED - NEXT SEGMENT
  9783. IX1 X3-X4 COMPARE PDATES
  9784. NG X1,RMP11 IF NEW PDATE .LT. PREVIOUS - NEXT SEGMENT
  9785. BX7 X3 NEW PDATE
  9786. SA7 A4 STORE NEW PDATE
  9787.  
  9788. * PROCESS ALL BEFORE IMAGE RECORDS FOR WHICH
  9789. * *DBEGIN* IS ACTIVE.
  9790. * THE CRI POINTER IN *TSEQ* AT *TSQR* SHOULD
  9791. * POINT TO NEXT AVAILABLE PRU OF SEGMENT,
  9792. * IT IS UPDATED HERE AFTER READING A BEFORE IMAGE.
  9793.  
  9794. RMP9 GETFLD 2,B2,TSQR CRI FOR CURRENT BI RECORD
  9795. GETFLD 1,B5,TQPI NUMBER OF PRU*S PER BEFORE IMAGE
  9796. IX6 X2+X1 INCREMENT CRI TO NEXT BI RECORD
  9797. PUTFLD 6,B2,TSQR STORE *RR* OF NEXT BI RECORD
  9798. GETFLD 2,B2,TSBI NUMBER OF BEFORE IMAGES PROCESSED
  9799. SX2 X2+B1 INCREMENT BI-S PROCESSED COUNT
  9800. PUTFLD 2,B2,TSBI STORE BI-S PROCESSED COUNT
  9801. SA1 B7+XQFNW LOGICAL FILE NAME FROM BI HEADER
  9802. SA5 RDRF FWA OF DATA BASE *TDRF* ENTRY
  9803. GETFLD 3,X5,TDNL FWA OF FIRST DB *TLNT* ENTRY
  9804. GETFLD 4,X5,TDLL FWA OF LAST DB *TLNT* ENTRY
  9805. RJ SFF SEARCH FOR FILE *TLNT* ENTRY
  9806. SX7 B3 FWA OF *TLNT* IF FOUND
  9807. BX2 X1 FILE NAME
  9808. SA1 IMSF FILE ENTRY NOT FOUND MESSAGE
  9809. ZR B3,RMP10 IF *TLNT* ENTRY NOT FOUND
  9810. SA7 RLNT STORE FWA OF LOGICAL NAME ENTRY
  9811.  
  9812. * INSURE FILE IS OPEN FOR RECOVERED TASK.
  9813.  
  9814. RJ IFO OPEN FILE
  9815. SA2 B3+TLFNW FILE NAME FROM *TLNT* ENTRY
  9816. SA1 IMSG FILE OPEN ERROR MESSAGE
  9817. NZ X6,RMP10 IF ERROR IN FILE OPEN PROCESS
  9818. SA2 RMPA FWA OF CURRENT *TBRF*
  9819. SA2 X2+TQFTW FWA OF *BRF* BUFFER FROM *TBRF* FET
  9820. SB6 X2+ FWA OF BEFORE IMAGE RECORD
  9821. GETFLD 1,B6,XQKS KEY SIZE IN CHARACTERS FROM BI HEADER
  9822. BX7 X1
  9823. RJ CTW CONVERT KEY SIZE TO WORDS
  9824. SB7 B6+ SAVE FWA OF BEFORE IMAGE RECORD
  9825. SX2 B7+XQKAW FWA OF KEY AREA IN BI RECORD (ORIGIN)
  9826. SX3 B4+TFKYW FWA OF KEY AREA IN *TFCB* (DESTINATION)
  9827. RJ MVD MOVE KEYS FROM BI RECORD TO *TFCB*
  9828. GETFLD 1,B7,XQFL FILE LOCK FLAG FROM BI HEADER
  9829. SB7 X1 (B7) = 1 IF FILE LOCK, = 0 IF RECORD LOCK
  9830.  
  9831. * RE-ESTABLISH LOCK FOR RECOVERED TASK.
  9832.  
  9833. RJ LOK LOCK FILE/RECORD
  9834. SA1 RMPA FWA OF CURRENT *TBRF*
  9835. SB5 X1+ FWA OF *TBRF*
  9836. ZR X6,RMP8 IF NO LOCK ERROR - NEXT BI RECORD
  9837. SX1 X6-TERE
  9838. ZR X1,RMP8 IF RECORD ALREADY LOCKED - NEXT BI RECORD
  9839. SX1 X6-TERF
  9840. ZR X1,RMP8 IF FILE ALREADY LOCKED - NEXT BI RECORD
  9841. SA2 B3+TLFNW FILE NAME FROM *TLNT* ENTRY
  9842. SA1 IMSH FILE LOCK ERROR MESSAGE
  9843.  
  9844. * REPORT FILE ERROR.
  9845.  
  9846. RMP10 MX7 TLFNN
  9847. RJ NMS REPORT FILE NAME AND ERROR
  9848. SA1 IMSE TASK FAILED MESSAGE
  9849. SA2 B2+TSTNW TASK NAME FROM *TSEQ* ENTRY
  9850. MX7 TSTNN TASK NAME MASK
  9851. RJ NMS REPORT TASK RECOVERY FAILED
  9852. SX6 7 RECOVERY IMPOSSIBLE ERROR CODE
  9853. EQ RMPX ERROR *TERC*, *TERD*, OR *TERH*
  9854.  
  9855. * REPORT TASK RECOVERED.
  9856.  
  9857. RMP11 SA1 IMSD TASK RECOVERED MESSAGE
  9858. SA2 B2+TSTNW TASK NAME FROM *TSEQ* ENTRY
  9859. MX7 TSTNN TASK NAME MASK
  9860. SA3 B2+TSRCW RECOVERED TASK FLAG WORD
  9861. LX3 59-TSRCS
  9862. PL X3,RMP12 IF TASK RECOVERY FAILED
  9863. RJ NMS REPORT TASK RECOVERED
  9864. EQ RMP5 PROCESS NEXT SEGMENT
  9865.  
  9866. RMP12 SA1 IMSE TASK RECOVERY FAILED MESSAGE
  9867. RJ NMS REPORT TASK RECOVERY FAILED
  9868. EQ RMP5 PROCESS NEXT SEGMENT
  9869.  
  9870. RMP13 SA1 MSGB RECOVERY FILE DOWN MESSAGE
  9871. SA2 B5+TQFFW *BRF* FILE NAME
  9872. MX7 TQFFN MASK
  9873. RJ NMS REPORT *BRF* DOWN
  9874. SA1 RMPF RECOVERY INITIALIZATION FAILED FLAG
  9875. SX6 X1+B1
  9876. SA6 A1 SET RECOVERY INITIALIZATION FAILED
  9877. SA1 B5+TQNLW LINK TO NEXT *BRF*
  9878. LX1 TQNLN-1-TQNLS RIGHT JUSTIFY ADDRESS
  9879. SB5 X1 FWA OF NEXT *TBRF*
  9880. EQ RMP2 PROCESS NEXT *BRF*
  9881.  
  9882. RMP14 SA1 RMPF RECOVERY INITIALIZATION FAILED FLAG
  9883. SX6 X1 (X6) .EQ. ZERO IF NO ERROR
  9884. EQ RMPX RETURN
  9885.  
  9886. RMPA CON 0 FWA OF CURRENT *TBRF* ENTRY
  9887. RMPB CON 0 CURRENT *BRF* SEGMENT ( 0 - N )
  9888. RMPC CON 0 LAST BEFORE IMAGE PDATE FROM HEADER
  9889. RMPD CON 0 NEW TRANSACTION SEQUENCE TABLE ENTRY COUNT
  9890. RMPE CON 0 *RR* OF 1ST PRU OF CURRENT SEGMENT
  9891. RMPF CON 0 RECOVERY FAILED IF NON ZERO
  9892. EJECT
  9893. ** VER - VALIDATION ERROR.
  9894. *
  9895. * ENTRY (X6) = VALIDATION ERROR CODE.
  9896. * (B7) = ADDRESS OF FILE NAME.
  9897. *
  9898. * EXIT (X6) = ENTRY VALUE, IF RE-ALLOCATION NOT POSSIBLE,
  9899. * OR IF OPERATOR SPECIFIED *DROP*.
  9900. * = ZERO, IF OPERATOR SPECIFIED RE-ALLOCATION.
  9901. *
  9902. * USES X - 1, 5, 6, 7.
  9903. * A - 1, 5, 6, 7.
  9904. * B - NONE.
  9905. *
  9906. * CALLS MSG.
  9907.  
  9908.  
  9909. VER SUBR ENTRY/EXIT
  9910. SA6 RNFE SAVE ERROR CODE
  9911. MX7 42
  9912. SA1 B7 GET *ARF* NAME FROM *TARF* HEADER
  9913. BX1 X7*X1
  9914. LX1 -6
  9915. SA5 IMSA GET FIRST WORD OF *VQH* MESSAGE
  9916. LX7 -6
  9917. BX5 -X7*X5 SAVE *$* AND * H*
  9918. BX5 X5+X1 ADD *ARF* NAME
  9919. BX7 X5
  9920. SA7 A5+ STORE NEW FIRST WORD OF MESSAGE
  9921. RJ MSG REPORT ERROR AND WAIT FOR RESPONSE
  9922. SA1 RNFE GET ERROR CODE
  9923. SX6 X1+ ERROR CODE
  9924. NZ X5,VERX IF RESPONSE IS *DROP*
  9925. SX6 B0+ INDICATE OPERATOR SPECIFIED RE-ALLOCATION
  9926. EQ VERX RETURN
  9927.  
  9928. SPACE 4,10
  9929. ** VLH - VALIDATE AFTER IMAGE RECOVERY FILE HEADER.
  9930. *
  9931. * ENTRY (A0) = FWA OF FET.
  9932. * (B4) = FWA OF *TARF*.
  9933. * (B5) = FWA OF *TARF* ENTRY.
  9934. *
  9935. * EXIT (X6) = 5, IF HEADER NAME OR FILE LENGTH ERROR.
  9936. * = 10, IF BOTH AFTER IMAGE RECOVERY FILES ACTIVE.
  9937. * = 11, IF AFTER IMAGE RECOVERY FILE FULL.
  9938. * = 12, IF CIO ERROR ON AFTER IMAGE RECOVERY FILE.
  9939. * = 16, IF BATCH RECOVERY ACTIVE STATUS IN HEADER.
  9940. * = 17, IF *ARF* BLOCK SIZE IN HEADER TOO LARGE.
  9941. *
  9942. * USES X - 1, 2, 5, 6, 7.
  9943. * A - 1, 2, 5, 7.
  9944. * B - 6, 7.
  9945. *
  9946. * MACROS GETFLD, PUTFLD, SKIPEI, SKIPFF.
  9947.  
  9948.  
  9949. VLH SUBR ENTRY/NO ERROR EXIT
  9950. SA1 B4+TAFTW GET FET+2 WORD FROM *TARF*
  9951. SB7 B4+TAFNW FWA OF HEADER FROM *TARF*
  9952. SB6 X1 FWA OF BUFFER (*FIRST*)
  9953. SA1 B6 GET FILE NAME FROM BUFFER HEADER
  9954. SA2 B7 GET FILE NAME FROM TABLE HEADER
  9955. MX7 -TASTN
  9956. BX7 -X7*X1 *ARF* STATUS
  9957. BX1 X1-X2
  9958. AX1 18D RIGHT JUSTIFY
  9959. SX6 5 RECOVERY FILE INCONSISTENT ERROR CODE
  9960. NZ X1,VLHX IF NAMES NOT SAME
  9961. SX6 16B BATCH RECOVERY ACTIVE ON DATA BASE ERROR
  9962. ZR X7,VLH1 IF INACTIVE STATUS
  9963. SX7 X7-XHAC
  9964. NZ X7,VLHX IF NOT ACTIVE STATUS
  9965. GETFLD 1,B5,TDLP LAST CHARACTER OF LOCAL *ARF* NAME
  9966. LX2 TAFNN-1-TAFNS RIGHT JUSTIFY *ARF* NAME
  9967. SX6 10B 2 ACTIVE AFTER IMAGE RECOVERY FILES ERROR
  9968. NZ X1,VLHX IF ACTIVE *ARF* SET IN *TDRF*
  9969. PUTFLD 2,B5,TDLP STORE LAST CHARACTER OF ACTIVE *ARF* NAME
  9970. VLH1 SA1 B6+3 GET MAX BLOCK SIZE FROM BUFFER HEADER
  9971. SA2 B7+3 GET MAX BLOCK SIZE FROM *TARF* HEADER
  9972. MX7 -TABLN
  9973. BX1 -X7*X1
  9974. BX2 -X7*X2
  9975. IX1 X2-X1 (ALLOCATED SIZE - FILE BLOCK SIZE)
  9976. SX6 17B *ARF* BLOCK SIZE .GT. BUFFER SIZE ERROR
  9977. NG X1,VLHX IF FILES MAX BLOCK SIZE .GT. THAN ALLOC.
  9978. SKIPFF A0,,R SKIP TO EOF
  9979. SA1 A0
  9980. AX1 9
  9981. MX7 -5
  9982. BX1 -X7*X1
  9983. SX6 12B CIO ERROR ON RECOVERY FILE ERROR CODE
  9984. NZ X1,VLHX IF NO EOF
  9985. GETFLD 5,B4,TARI GET EOF RANDOM INDEX FROM *TARF* FET
  9986. SKIPEI A0,R SKIP TO EOI
  9987. GETFLD 2,B4,TARI GET EOI RANDOM INDEX FROM *TARF* FET
  9988. IX1 X5-X2
  9989. SX6 11B AFTER IMAGE RECOVERY FILE FULL ERROR CODE
  9990. ZR X1,VLHX IF FILE FULL
  9991. SA1 B6+3 GET LENGTH IN PRU*S FROM BUFFER HEADER
  9992. MX7 -TAFLN
  9993. LX1 TAFLN-1-TAFLS RIGHT JUSTIFY FIELD
  9994. BX1 -X7*X1 GET FILE LENGTH
  9995. IX6 X1-X2 COMPARE ACTUAL FILE LENGTH WITH HEADER VAL
  9996. SX6 X6+2 ADD BIAS FOR HEADER AND EOI PRU-S
  9997. ZR X6,VLHX IF EOI *CRI* .EQ. BUFFER HEADER VALUE
  9998. SX6 5 RECOVERY FILE INCONSISTENT ERROR CODE
  9999. EQ VLHX RETURN
  10000.  
  10001. EJECT
  10002. IAMA CON 0 MAXIMUM RECORD LENGTH FOR ALL FILES
  10003. IAMB CON CRMARFN ARF LENGTH IN PRU-S LESS HEADER PRU
  10004. IAMC CON 0 *IAM* FUNCTION CODE 6 OR 7
  10005. IAMD CON CMDM NUMBER OF UNUSED *TSEQ* TABLE ENTRIES
  10006. IAME EQU 300B APPROXIMATE SIZE OF A *FSTT*
  10007. IAMF EQU 13B SPACE REQUIRED FOR ADDITIONAL *FIT-S*
  10008. IAMG CON 0 BIT MAP FOR FILE ORGANIZATIONS
  10009. SPACE 4,10
  10010. * BUFFERS FOR INPUT AND OUTPUT QUEUES.
  10011. * THESE BUFFERS ARE USED DURING INITIALIZATION FOR
  10012. * INITIALIZATION CODE.
  10013.  
  10014. AIBF EQU BUFF INPUT BUFFER
  10015. AOBF EQU AIBF+AIBFL OUTPUT BUFFER
  10016. AAMLL MAX AOBF+AOBFL,IAMD
  10017. ORG AAMLL+1
  10018.  
  10019. END