User Tools

Site Tools


cdc:nos2.source:nam5871:writeri

WRITERI

Table Of Contents

  • [00002] PROC WRITERI ( (FET),(RECID),(WSA),(LENGTH), STATIS )
  • [00062] PROC WRITER
  • [00063] PROC RECALL
  • [00064] PROC FINDRI

Source Code

WRITERI.txt
  1. *DECK WRITERI
  2. PROC WRITERI ( (FET),(RECID),(WSA),(LENGTH), STATIS );
  3. BEGIN # WRITERI #
  4. *IF DEF,IMS
  5. #
  6. **
  7. *
  8. * 1. PROC NAME AUTHOR DATE
  9. * WRITERI M. D. PICKARD 77/01/13
  10. *
  11. * 2. FUNCTIONAL DESCRIPTION
  12. * WRITERI WILL WRITE A RECORD TO A SUPIO RANDOM FILE
  13. * AND ADD THE RECORD IDENT TO THE SUPIO RANDOM INDEX.
  14. *
  15. * 3. METHOD USED
  16. * IF THE FILE IS A SUPIO RANDOM FILE AND THERE IS ROOM IN
  17. * THE INDEX, FINDRI IS CALLED TO FIND THE PLACE IN THE INDEX
  18. * FOR THE RECORD IDENT. WRITER IS CALLED TO WRITE THE RECORD.
  19. * IF THE WRITE IS SUCCESSFULL, THE RI IS ADDED TO THE INDEX.
  20. *
  21. * 4. ENTRY PARAMETERS
  22. * FET ADDRESS OF THE FET
  23. * RECID RECORD IDENT
  24. * WSA ADDRESS OF WRITE BUFFER
  25. * LENGTH LENGTH OF RECORD TO REWRITE
  26. *
  27. * 5. EXIT PARAMETERS
  28. * STATIS RETURN STATUS
  29. * 0 - OPERATION COMPLETE
  30. * DECPEOC - PARITY ERROR, OPERATION COMP.
  31. * DECPE - PARITY ERROR
  32. * DECAEOC - ADDRESS ERROR, OPER. COMPLETE
  33. * DECAE - ADDRESS ERROR
  34. * DECDSOC - DETAILED STATUS ERROR, OP. CMP.
  35. * DECDS - DETAILED STATUS ERROR
  36. * DECTL - TRACK LIMIT
  37. * RANRSEQ - RANDOM REQUEST ON SEQ. FILE
  38. * BADRI - BAD RECORD IDENT, DUPLICATE
  39. * INDXSML - INDEX TOO SMALL TO ADD RECID
  40. * NOTSIOF - NOT A SUPIO FILE
  41. *
  42. * 6. COMDECKS CALLED
  43. * SIODEFS SUPIO SYMPL DEFS
  44. * SIOBASE SUPIO BASED ARRAY DEFINITIONS
  45. *
  46. * 7. ROUTINES CALLED
  47. * FINDRI FINDS PLACE FOR RECORD IDENT
  48. * RECALL MACREL CPU RECALL SYMPL INTERFACE
  49. * WRITER MACREL WRITER SYMPL INTERFACE
  50. *
  51. * 8. DAYFILE MESSAGES
  52. * NONE.
  53. *
  54.  #
  55. *ENDIF
  56. CONTROL NOLIST; # STOPS LIST OF SIODEFS AND SIOBASE #
  57. *CALL SIODEFS
  58. *CALL SIOBASE
  59. CONTROL LIST;
  60. XREF
  61. BEGIN
  62. PROC WRITER;
  63. PROC RECALL;
  64. PROC FINDRI;
  65. END
  66. ITEM
  67. FET U, # FET ADDRESS #
  68. RECID U, # RECORD IDENT #
  69. WSA U, # WORKING STORAGE AREA, WRITE FROM BUFFER #
  70. LENGTH U, # RECORD LENGTH #
  71. STATIS U; # RETURN STATUS #
  72. ITEM
  73. I U, # INDUCTION VARIABLE #
  74. REQWORD U, # REQUEST WORD FOR WRITER #
  75. TEMP U, # TEMPORARY UNSIGNED INTEGER #
  76. TEMPB B; # TEMPORARY BOOLEAN #
  77. P<SIOFET> = FET; # FORMAT FET #
  78. IF FETRAN[0]
  79. THEN # FET IS RANDOM FILE FET #
  80. BEGIN # SEE IF THE INDEX IS OK #
  81. P<SIOINDX> = FETINDX[0]; # FORMAT THE INDEX #
  82. IF SIONAME[0] EQ "SUPIOINDEX"
  83. THEN # FILE IS SUPIO RANDOM FILE #
  84. BEGIN
  85. IF ( LINDX[0] + 1 ) * SIOINDL LS FETINDL[0]
  86. THEN # THERE"S ROOM IN THE INDEX FOR WRITE #
  87. BEGIN
  88. FINDRI(LOC(SIOINDX),RECID,TEMP,TEMPB); # FIND RI IN INDX #
  89. IF NOT TEMPB
  90. THEN # NOT A DUPLICATE RECORD IDENT, #
  91. BEGIN # TEMP CONTAINS PLACE IT SHOULD GO #
  92. FETFST[0] = WSA; # SET FIRST #
  93. FETIN[0] = WSA + LENGTH; # SET IN FOR BUFFER FULL #
  94. FETOUT[0] = WSA; # SET OUT #
  95. FETLMT[0] = FETIN[0] + 1; # SET LIMIT #
  96. FETRR[0] = LOC(REQWORD); # RETURN RANDOM ADDR. TO REQWORD#
  97. WRITER(SIOFET,0); # WRITE THE RECORD #
  98. RECALL(SIOFET); # WAIT TIL COMPLETE BIT SET #
  99. IF FETABNT[0] EQ 0
  100. THEN # WRITE TOOK PLACE OK #
  101. BEGIN # MOVE HIGHER ORDINAL DOWN TO MAKE ROOM #
  102. FOR I = LINDX[0] STEP -1 UNTIL TEMP DO
  103. BEGIN # MOVE ALL HIGHER ENTRIES DOWN ONE #
  104. RI[I+1] = RI[I]; # MOVE RECORD IDENT DOWN ONE #
  105. RL[I+1] = RL[I]; # MOVE RECORD LENGTH DOWN ONE #
  106. RANINDX[I+1] = RANINDX[I]; # MOVE RANDOM INDEX DOWN #
  107. END
  108. RI[TEMP] = RECID; # SET THIS ENTRY RI FIELD #
  109. RL[TEMP] = LENGTH; # SET THIS ENTRY RECORD LENGTH #
  110. RANINDX[TEMP] = REQWORD;
  111. LINDX[0] = LINDX[0] + 1; # ADJUST LAST INDEX ORDINAL #
  112. CINDX[0] = TEMP; # SET CURRENT INDEX POSITION #
  113. STATIS = 0;
  114. END
  115. ELSE
  116. STATIS = FETDEC[0]; # USE DETAIL ERROR CODE FOR STATUS #
  117. END
  118. ELSE # DUPLICATE #
  119. STATIS = BADRI; # BAD RECORD IDENT #
  120. END
  121. ELSE # INDEX AREA TO SMALL #
  122. STATIS = INDXSML; # SET RETURN STATUS #
  123. END
  124. ELSE # NOT A SUPIO INDEX #
  125. STATIS = NOTSIOF; # SET RETURN STATUS #
  126. END
  127. ELSE # NOT A RANDOM FILE #
  128. STATIS = RANRSEQ; # SET RETURN STATUS #
  129. RETURN;
  130. END
  131. TERM # WRITERI #
cdc/nos2.source/nam5871/writeri.txt ยท Last modified: 2023/08/05 17:23 by Site Administrator