End Receive (ENDRCV)

Where allowed to run:
  • Batch program (*BPGM)
  • Interactive program (*IPGM)
Threadsafe: No
Parameters
Examples
Error messages

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:

Top

Parameters

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

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.
Top

Open file identifier (OPNID)

Specifies the open file identifier that was declared on a preceding Declare File (DCLF) command in the same 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 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 procedure.
Top

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.

Top

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.
Top