CL Command Reference - ENDRCV
CL Command List > ENDRCV Reference
Description:
The End Receive (ENDRCV) command is used to end (cancel) a request for input made by a previously issued RCVF or SNDRCVF command that had WAIT(*NO) specified. The ENDRCV command ends an input request even if the user enters the requested data at the display station at the same time that the command is processed. If the requested data is entered and is being sent to the program when the end receive operation is performed, the entered data is lost. If there is no outstanding input request, the command is ignored.
Restrictions:
. This command is valid only for display files within CL procedures. It cannot be used for database files.
Examples:
Example 1: Ending Previous Receive
ENDRCV DEV(MYDISPLAY)
Assume that a RCVF command with WAIT(*NO) was issued earlier in the CL procedure to request input from the device file declared earlier in the DCLF command and from the display device MYDISPLAY. When this ENDRCV command is processed, that request for input from MYDISPLAY is ended.
Example 2: Using an Open File Identifier
DCLF FILE(MYLIB/MYDSPFILE) RCDFMT(FMT1) OPNID(DSPFILE1)
:
SNDRCVF DEV(DSP02) RCDFMT(FMT1) OPNID(DSPFILE1) WAIT(*YES)
:
ENDRCV DEV(DSP02) OPNID(DSPFILE1)
This command ends the previous SNDRCVF (Send/Receive File) command¡¯s request for input from a workstation display device DSP02.