BPX4RED (read) example
The following code reads 80 bytes from the specified
file (FILEDESC) and places them in the area provided
(BUFFERA). For the callable service, see read (BPX1RED, BPX4RED) — Read from a file or socket.
AMODE 31 callers use BPX1RED (read) example.
MVC FILEDESC,.. File descriptor
LA R15,BUFFERA Buffer
STG R15,BUFA Buffer address
MVC BUFLENA,=F'80' Read buffer length
SPACE ,
CALL BPX4RED, Read from a file +
(FILEDESC, Input: File descriptor +
BUFA, ->Buffer to read into +
PRIMARYALET, Input: Buffer ALET +
BUFLENA, Input: Number of bytes to read +
RETVAL, Return value: 0, -1, or char count+
RETCODE, Return code +
RSNCODE), Reason code +
MF=(E,PLIST) ----------------------------------