COBOL Manual for TNS and TNS/R Programs

Procedure Division Verbs
HP COBOL Manual for TNS and TNS/R Programs522555-006
9-3
ACCEPT With Mnemonic-Name
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 and Hexadecimal Numeric
Literals). A null response or a response containing only spaces is invalid for a
numeric or a numeric edited accept-name.
If the response to the read operation is not in numeric literal format, the ACCEPT
statement reprompts with:
** Improper numeric value. Resupply input **