COBOL Manual for TNS and TNS/R Programs
Procedure Division Verbs
HP COBOL Manual for TNS and TNS/R Programs—522555-006
9-2
ACCEPT With Mnemonic-Name
Usage Considerations:
•
Differences in the OSS and Guardian Environments
In the OSS environment but not in the Guardian environment:
°
No prompt is given for an ACCEPT statement.
°
If an ACCEPT statement includes mnemonic-name, it must be the OSS
pathname of a Guardian process or terminal. If mnemonic-name is an OSS
device, the compiler issues a warning and the default input device (#IN) is
used instead.
•
If mnemonic-name Is Not Specified
If you omit the phrase FROM mnemonic-name, the process accepts data from its
default input device or default input-output device. (See Specifying Default Input
and Output Devices or Specifying a Default Input-Output Device.) The default input
device or default input-output device is usually the home terminal, except in a
Pathway environment where the COBOL run unit is functioning as a server. In that
case, the server class command SET SERVER determines the default input device
or default input-output device (see the TS/MP System Management Manual).
•
Specifying the Default Input-Output Device as mnemonic-name
If you want the process to accept data from its default input-output device, omit the
FROM phrases from the ACCEPT statements and specify a default input-output
device before executing the program. (See Specifying Default Input and Output
Devices or Specifying a Default Input-Output Device.) 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.