COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
Default Input-Output Device (page 822).) Do not specify the default input-output device as the
mnemonic-name, because this causes the process to terminate abnormally.
• If mnemonic-name Is Not Open
If mnemonic-name specifies a process that has not been opened by an earlier ACCEPT or
DISPLAY statement, or specifies a terminal, then the accepting process opens the process or
terminal that mnemonic-name specifies as if it were a file.
• If Process Cannot Open or Accept Data From mnemonic-name
If the process cannot open or accept data from the terminal or process that mnemonic-name
specifies, the process tries to accept data from its home terminal. If the home terminal is also
unavailable, the process assigns the value 0 to each numeric or numeric edited receiving item
and fills any other category of receiving item with spaces.
• Cursor Placement When mnemonic-name Is a Terminal
If mnemonic-name specifies a terminal that was the object of a DISPLAY NO ADVANCING
statement, then the ACCEPT statement sets the cursor at the location following that where the
display operation ended; otherwise, the ACCEPT statement prompts with a question mark (?)
and awaits input.
• Whether Process Closes mnemonic-name or Leaves It Open
If mnemonic-name specifies a terminal that was not the object of a DISPLAY NO
ADVANCING statement, then the process closes the terminal after accepting data from it. If
mnemonic-name specifies another process or a terminal that was the object of a DISPLAY
NO ADVANCING statement, then the process leaves the other process or terminal open.
• Case Sensitivity
The ACCEPT statement does not change the letters in the accepted data from lowercase to
uppercase or from uppercase to lowercase when it stores them in accept-name. To perform
such a conversion, use the INSPECT CONVERTING statement.
• Alphabetic, Alphanumeric, and Alphanumeric Edited Data
If accept-name is an alphabetic, alphanumeric, or alphanumeric edited data item, the
process collects data in an intermediate data item using one or more read operations. Each
read operation collects zero or more characters from the process or terminal that
mnemonic-name specifies, up to the maximum physical record size for that process or
terminal (a typical maximum physical record size for a terminal is 80 characters).
If a read operation gets a null response (that is, if the user enters only a carriage return), the
ACCEPT statement appends space characters to the intermediate data item until its length is
that of accept-name.
If a response is not null but contains fewer characters than the maximum physical record size
of the process or terminal that mnemonic-name specifies, the ACCEPT statement appends
space characters to the response until its length is that of accept-name.
The ACCEPT statement constructs the intermediate item by appending responses in the order
in which it receives them, and continues to execute read operations until it has filled
accept-name or received a null response.
Finally, the ACCEPT statement moves the value of the intermediate item to accept-name,
following the rules for the MOVE statement.
• Numeric and Numeric Edited Data
If accept-name is a numeric or a numeric edited data item, the process collects data with
one read operation. The response to the read operation must be in numeric literal format (see
Decimal Numeric Literals (page 70) and Hexadecimal Numeric Literals (page 71)). A null
ACCEPT 279










