ACCEPT
COBOL |
Description
The ACCEPT command assigns a value, retrieved from a preallocated file, to the specified data item.
Input
The following are the parameter descriptions for the ACCEPT command:
identifier
A data name defined in the program.
FROM
Required keyword before entering a ddname.
ddname
The preallocated file from which the data item receives its value. The file must be sequential, a PDS member, or the terminal, and either fixed or variable blocked. The default is SYSIN.
Usage Notes
- Each time an ACCEPT command is issued, the next record within the file is retrieved and assigned to the data item. However, the last record is repeatedly assigned if ACCEPT commands are issued for the same ddname in excess of the records in the file.
- If FROM ddname is omitted, Code Debug TSO assumes the default ddname of SYSIN. If the ddname is allocated to the terminal, Code Debug prompts the user for input.
- The file allocated to the ddname identifier cannot be used by a READ or WRITE statement in the same program.
- If the length of the data assigned is less than that of the alphanumeric data item, the data is left-justified. If the length of the data assigned is less than that of the numeric data item, the data is right-justified and padded with zeros.
- The value of identifier can specify a relative displacement and length modifier; that is, it can be a substring of a data item.
- All files opened by Code Debug TSO when ACCEPT commands are issued are closed with either a RETEST or EXIT command.
Examples
- To assign a value to the data item WORK-REC from the file allocated to the ddname INITFILE, enter the following on the command line:
ACCEPT WORK-REC FROM INITFILE - To assign a value to the data item WORK-REC when the ddname defaults to SYSIN, enter the following on the command line:
ACCEPT WORK-REC
Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*