*DECK READRI PROC READRI ( (FET),(RECID),(WSA), LENGTH , STATIS ); BEGIN # READRI # *IF DEF,IMS # ** * * 1. PROC NAME AUTHOR DATE * READRI M. D. PICKARD 77/01/10 * * 2. FUNCTIONAL DESCRIPTION * READRI WILL READ A RECORD BY RECORD IDENT FROM A SUPIO * RANDOM FILE. * * 3. METHOD USED * IF THE FILE IS A SUPIO RANDOM FILE THEN FINDRI IS CALLED TO * FIND THE INDEX POSITION ASSOCIATED TO RECID. IF THE RECID * IS VALID THE FIRST, IN, OUT, AND RANDOM ADDRESS ARE PUT IN * THE FET AND READ IS CALLED TO READ THE RECORD. THE ACTUAL * LENGTH OF THE RECORD AND THE RETURN STATUS ARE SET, AND * THE CURRENT INDEX IS SET AT THIS RECORD. * * 4. ENTRY PARAMETERS * FET ADDRESS OF FET * RECID RECORD IDENT * WSA ADDRESS OF READ BUFFER * LENGTH LENGTH OF READ BUFFER * MUST BE GREATER THAN MINSIOI * * 5. EXIT PARAMETERS * LENGTH LENGTH OF RECORD READ * STATIS RETURN STATUS * RDEOR - END-OF-RECORD, READ SUCCESSFUL * RDEOF - END-OF-FILE, NO RECORD READ * RDEOI - END-OF-INFO., NO RECORD READ * RDBFULL - BUFFER FULL, PART RECORD READ * CRDEOR - EOR CODED FILE, READ SUCCESSFUL * CRDEOF - EOF CODED FILE, NO RECORD READ * CRDEOI - EOI CODED FILE, NO RECORD READ * CRDBFULL - BUFFER FULL CODED FILE, * PART RECORD READ * BADRI - BAS RECORD IDENT * NOTSIOF - NOT A SUPIO FILE * RANRSEQ - RANDOM REQUEST ON SEQ. FILE * * 6. COMDECKS CALLED * SIODEFS SUPIO SYMPL DEFS * SIOBASE SUPIO BASED ARRAY DEFINITION * * 7. ROUTINES CALLED * FINDRI FINDS RECORD IDENT IN INDEX * READ MACREL READ SYMPL INTERFACE * RECALL MACREL CPU RECALL SYMPL INTERFACE * * 8. DAYFILE MESSAGES * NONE. * # *ENDIF CONTROL NOLIST; # STOPS LIST OF SIODEFS AND SIOBASE # *CALL SIODEFS *CALL SIOBASE CONTROL LIST; ITEM FET U, # GET ADDRESS # RECID U, # RECORD IDENT # WSA U, # WORK STORAGE AREA ADDRESS # LENGTH U, # WSA LENGTH - RECORD LENGTH # STATIS U; # RETURN STATUS # XREF BEGIN PROC READ; PROC RECALL; PROC FINDRI; END ITEM TEMP U, # TEMPORARY UNSIGNED INTEGER # TEMPB B; # TEMPORARY BOOLEAN # P = FET; # FORMAT FET # IF FETRAN[0] THEN # FET IS RANDOM FILE FET # BEGIN P = FETINDX[0]; # FORMAT INDEX # IF SIONAME[0] EQ "SUPIOINDEX" THEN # FILE IS SUPIO FILE # BEGIN FINDRI(LOC(SIOINDX),RECID,TEMP,TEMPB); # FIND RI IN INDX # IF TEMPB THEN # RI FOUND # BEGIN FETRR[0] = RANINDX[TEMP]; # SET RANDOM REQUEST PRU # FETFST[0] = WSA; # SET FIRST # FETIN[0] = WSA; # SET IN # FETOUT[0] = WSA; # SET OUT # FETLMT[0] = WSA + LENGTH + 1; # SET LIMIT # READ(SIOFET); # READ THE RECORD # RECALL(SIOFET); # WAIT TILL COMPLETE # STATIS = FETSTAT[0]; # SET RETURN STATUS # LENGTH = FETIN[0] - FETFST[0]; # SET LENGTH TO AMOUNT READ # CINDX[0] = TEMP; END ELSE # RI CAN NOT BE FOUND # BEGIN CINDX[0] = TEMP - 1; # FOR POSITIONING, SET CURRENT INDEX # STATIS = BADRI; # BAD RECORD IDENT # END END ELSE # NOT A SUPIO INDEX IN INDEX AREA # STATIS = NOTSIOF; # NOT A SUPIO FILE # END ELSE # RANDOM READ ON SEQ. FILE # STATIS = RANRSEQ; # RANDOM REQUEST ON SEQUENTIAL FILE # RETURN; END TERM # READRI #