Format 1 - Data Transfer

Read syntax diagramSkip visual syntax diagram
ACCEPT Statement - Format 1 - Data Transfer

>>-ACCEPT--identifier-1--+--------------------------------+----->
                         '-FROM--+-mnemonic-name--------+-'   
                                 |                  (1) |     
                                 '-environment-name-----'     

>--+----------------+------------------------------------------><
   |            (1) |   
   '-END-ACCEPT-----'   

Notes:
  1. IBM Extension

Format 1 transfers data from an input device into identifier-1. Incoming data is transferred as a character string aligned on the leftmost character position. No data conversion will occur. If the size of identifier-1 is greater than the record length of the input device, then additional data will be requested after the transfer of one record has been completed. The additional data will be transferred into identifier-1 starting at the position immediately to the right of the last character previously transferred from the device. This process will continue until identifier-1 has been filled. If on any transfer the device record holds more characters than are needed to fill identifer-1, then the excess data will be truncated.

Since all data is transferred as a character string, identifier-1 will normally be defined, explicitly or implicitly, with usage DISPLAY. The ACCEPT statement will, however, handle data in other formats, provided it is possible to enter the data on the input device in a format that corresponds to the internal representation of identifier-1.

Format 1 is useful for exception situations in a program when operator intervention (to supply a given message, code, or exception indicator) is required. The operator must, of course, be supplied with the appropriate messages with which to reply.

identifier-1
The receiving data item.
IBM Extension

If the description of identifier-1 contains a TYPE clause, the type-name referenced in that clause must be elementary.

End of IBM Extension
IBM Extension

Identifier-1 may be defined with usage DISPLAY-1, that is, it may be a DBCS or DBCS-edited item. The data on the input device must then be delimited by a shift-out and a shift-in character; these will be removed when the data is transferred.

End of IBM Extension
IBM Extension

Identifier-1 may also be defined as a NATIONAL item. The data accepted will be converted from the code set specified by the job's current CCSID.

End of IBM Extension
IBM Extension

Identifier-1 may not be a date, time, or timestamp item.

End of IBM Extension
mnemonic-name
Must be specified in the SPECIAL-NAMES paragraph, where it will be associated with an environment-name that refers to an input device. The input device can be the workstation used by an interactive job, the job input stream of a batch job, or the system operator’s console.
IBM Extension
environment-name
The environment-name CONSOLE or SYSIN may be specified in place of a mnemonic-name.
End of IBM Extension
Related Information: