*DECK READSR
PROC READSR ( (FET),(WSA), LENGTH , STATIS );
BEGIN # READSR #
*IF DEF,IMS
#
**
*
* 1. PROC NAME AUTHOR DATE
* READSR M. D. PICKARD 77/01/13
*
* 2. FUNCTIONAL DESCRIPTION
* READSR WILL READ ON RECORD FROM A FILE TO A WORKING STORAGE
* AREA.
*
* 3. METHOD USED
* IF THE FET IS A SEQUENTIAL FILE FET THEN FIRST, IN, OUT AND
* LIMIT ARE SET AND READ IS CALLED TO READ THE RECORD. THE
* RETURN STATUS IS SET.
*
* 4. ENTRY PARAMETERS
* FET ADDRESS OF FILE ENVIRONMENT TABLE
* WSA READ BUFFER ADDRESS
* LENGTH LENGTH OF READ BUFFER
*
* 5. EXIT PARAMETERS
* STATIS RETURN STATUS FIELD
* RDEOR - END-OF-RECORD, READ SUCESSFUL
* RDBFULL - BUFFER FULL, PART REC. READ
* RDEOF - END-OF-FILE, NO RECORD READ
* RDEOI - END-OF-INFORMATION, NO REC. 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
* SEQRRAN - SEQUENTIAL REQ. ON RANDOM FILE
*
* 6. COMDECKS CALLED
* SIODEFS SUPIO SYMPL DEFS
* SIOBASE SUPIO BASED ARRAY DEFINITIONS
*
* 7. ROUTINES CALLED
* READ READ MACRO SYMPL INTERFACE ROUTINE
* RECALL ISSUE CPU RECALL TIL IO IS COMPLETE
*
* 8. DAYFILE MESSAGES
* NONE.
*
#
*ENDIF
CONTROL NOLIST; # STOP LIST OF SIODEFS AND SIOBASE #
*CALL SIODEFS
*CALL SIOBASE
CONTROL LIST;
ITEM
FET U, # FET ADDRESS #
WSA U, # READ BUFFER #
LENGTH U, # LENGTH OF READ BUFFER #
STATIS U; # STATUS WORD #
XREF
BEGIN
PROC READ;
PROC RECALL;
END
P<SIOFET> = FET; # FORMAT FET #
IF NOT FETRAN[0]
THEN # THIS IS A SEQUENTIAL FILE #
BEGIN
FETFST[0] = WSA; # SET FIRST #
FETIN[0] = WSA; # SET IN FOR BUFFER EMPTY #
FETOUT[0] = WSA; # SET OUT #
FETLMT[0] = WSA + LENGTH + 1; # SET LIMIT #
READ(SIOFET); # READ THE RECORD #
RECALL(SIOFET); #WAIT TIL COMPLETE BIT IS SET #
STATIS = FETSTAT[0]; # SET RETURN STATUS #
LENGTH = FETIN[0] - FETFST[0]; # SET LENGTH OF RECORD READ #
END
ELSE # CAN NOT READSR ON A RANDOM FILE #
STATIS = SEQRRAN; # SEQUENTIAL REQUEST ON RANDOM FILE #
RETURN;
END
TERM # READSR #