End Receive (ENDRCV)

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:

Parameters

Keyword Description Choices Notes
DEV Display device Name, *FILE Optional, Positional 1
OPNID Open file identifier Simple name, *NONE Optional

Display device (DEV)

Specifies the name of the display device for which the request for input is to be ended.

*FILE
The name of the device whose response is to be ended. This device is in the device file that is declared in the File (FILE) parameter of the Declare File (DCLF) command. If the device file has more than one device name specified in it, *FILE cannot be specified.
name
Specify the name of the display device from which a response is to be ended.

Open file identifier (OPNID)

Specifies the open file identifier that was declared on a preceding Declare File (DCLF) command in the same CL program or ILE CL procedure. A CL variable cannot be specified for this parameter value.

*NONE
No open file identifier is provided. This command will use the file associated with the DCLF command that had *NONE specified for the OPNID parameter. Only one file can be declared in a CL program or ILE CL procedure with *NONE as the open file identifier.
simple-name
Specify a name that matches the OPNID parameter value on a preceding DCLF command in the same CL program or ILE CL procedure.

Examples

Example 1: Ending Previous Receive

ENDRCV   DEV(MYDISPLAY)

Assume that a RCVF command with WAIT(*NO) was issued earlier in the CL program or ILE 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.

Error messages

*ESCAPE Messages

CPF0883
*FILE not valid in DEV parameter for file &1.
CPF4101
File &2 in library &3 not found or inline data file missing.