User Tools

Site Tools


cdc:nos2.source:nam5871:readri

READRI

Table Of Contents

  • [00002] PROC READRI ( (FET),(RECID),(WSA), LENGTH , STATIS )
  • [00072] PROC READ
  • [00073] PROC RECALL
  • [00074] PROC FINDRI

Source Code

READRI.txt
  1. *DECK READRI
  2. PROC READRI ( (FET),(RECID),(WSA), LENGTH , STATIS );
  3. BEGIN # READRI #
  4. *IF DEF,IMS
  5. #
  6. **
  7. *
  8. * 1. PROC NAME AUTHOR DATE
  9. * READRI M. D. PICKARD 77/01/10
  10. *
  11. * 2. FUNCTIONAL DESCRIPTION
  12. * READRI WILL READ A RECORD BY RECORD IDENT FROM A SUPIO
  13. * RANDOM FILE.
  14. *
  15. * 3. METHOD USED
  16. * IF THE FILE IS A SUPIO RANDOM FILE THEN FINDRI IS CALLED TO
  17. * FIND THE INDEX POSITION ASSOCIATED TO RECID. IF THE RECID
  18. * IS VALID THE FIRST, IN, OUT, AND RANDOM ADDRESS ARE PUT IN
  19. * THE FET AND READ IS CALLED TO READ THE RECORD. THE ACTUAL
  20. * LENGTH OF THE RECORD AND THE RETURN STATUS ARE SET, AND
  21. * THE CURRENT INDEX IS SET AT THIS RECORD.
  22. *
  23. * 4. ENTRY PARAMETERS
  24. * FET ADDRESS OF FET
  25. * RECID RECORD IDENT
  26. * WSA ADDRESS OF READ BUFFER
  27. * LENGTH LENGTH OF READ BUFFER
  28. * MUST BE GREATER THAN MINSIOI
  29. *
  30. * 5. EXIT PARAMETERS
  31. * LENGTH LENGTH OF RECORD READ
  32. * STATIS RETURN STATUS
  33. * RDEOR - END-OF-RECORD, READ SUCCESSFUL
  34. * RDEOF - END-OF-FILE, NO RECORD READ
  35. * RDEOI - END-OF-INFO., NO RECORD READ
  36. * RDBFULL - BUFFER FULL, PART RECORD READ
  37. * CRDEOR - EOR CODED FILE, READ SUCCESSFUL
  38. * CRDEOF - EOF CODED FILE, NO RECORD READ
  39. * CRDEOI - EOI CODED FILE, NO RECORD READ
  40. * CRDBFULL - BUFFER FULL CODED FILE,
  41. * PART RECORD READ
  42. * BADRI - BAS RECORD IDENT
  43. * NOTSIOF - NOT A SUPIO FILE
  44. * RANRSEQ - RANDOM REQUEST ON SEQ. FILE
  45. *
  46. * 6. COMDECKS CALLED
  47. * SIODEFS SUPIO SYMPL DEFS
  48. * SIOBASE SUPIO BASED ARRAY DEFINITION
  49. *
  50. * 7. ROUTINES CALLED
  51. * FINDRI FINDS RECORD IDENT IN INDEX
  52. * READ MACREL READ SYMPL INTERFACE
  53. * RECALL MACREL CPU RECALL SYMPL INTERFACE
  54. *
  55. * 8. DAYFILE MESSAGES
  56. * NONE.
  57. *
  58.  #
  59. *ENDIF
  60. CONTROL NOLIST; # STOPS LIST OF SIODEFS AND SIOBASE #
  61. *CALL SIODEFS
  62. *CALL SIOBASE
  63. CONTROL LIST;
  64. ITEM
  65. FET U, # GET ADDRESS #
  66. RECID U, # RECORD IDENT #
  67. WSA U, # WORK STORAGE AREA ADDRESS #
  68. LENGTH U, # WSA LENGTH - RECORD LENGTH #
  69. STATIS U; # RETURN STATUS #
  70. XREF
  71. BEGIN
  72. PROC READ;
  73. PROC RECALL;
  74. PROC FINDRI;
  75. END
  76. ITEM
  77. TEMP U, # TEMPORARY UNSIGNED INTEGER #
  78. TEMPB B; # TEMPORARY BOOLEAN #
  79. P<SIOFET> = FET; # FORMAT FET #
  80. IF FETRAN[0]
  81. THEN # FET IS RANDOM FILE FET #
  82. BEGIN
  83. P<SIOINDX> = FETINDX[0]; # FORMAT INDEX #
  84. IF SIONAME[0] EQ "SUPIOINDEX"
  85. THEN # FILE IS SUPIO FILE #
  86. BEGIN
  87. FINDRI(LOC(SIOINDX),RECID,TEMP,TEMPB); # FIND RI IN INDX #
  88. IF TEMPB
  89. THEN # RI FOUND #
  90. BEGIN
  91. FETRR[0] = RANINDX[TEMP]; # SET RANDOM REQUEST PRU #
  92. FETFST[0] = WSA; # SET FIRST #
  93. FETIN[0] = WSA; # SET IN #
  94. FETOUT[0] = WSA; # SET OUT #
  95. FETLMT[0] = WSA + LENGTH + 1; # SET LIMIT #
  96. READ(SIOFET); # READ THE RECORD #
  97. RECALL(SIOFET); # WAIT TILL COMPLETE #
  98. STATIS = FETSTAT[0]; # SET RETURN STATUS #
  99. LENGTH = FETIN[0] - FETFST[0]; # SET LENGTH TO AMOUNT READ #
  100. CINDX[0] = TEMP;
  101. END
  102. ELSE # RI CAN NOT BE FOUND #
  103. BEGIN
  104. CINDX[0] = TEMP - 1; # FOR POSITIONING, SET CURRENT INDEX #
  105. STATIS = BADRI; # BAD RECORD IDENT #
  106. END
  107. END
  108. ELSE # NOT A SUPIO INDEX IN INDEX AREA #
  109. STATIS = NOTSIOF; # NOT A SUPIO FILE #
  110. END
  111. ELSE # RANDOM READ ON SEQ. FILE #
  112. STATIS = RANRSEQ; # RANDOM REQUEST ON SEQUENTIAL FILE #
  113. RETURN;
  114. END
  115. TERM # READRI #
cdc/nos2.source/nam5871/readri.txt ยท Last modified: 2023/08/05 17:23 by Site Administrator