Format 2 - System Information Transfer

System information contained in the specified conceptual data items DATE, DAY, DAY-OF-WEEK, or TIME can be transferred into the identifier. DATE, DAY, DAY-OF-WEEK, and TIME are conceptual data items and, therefore, are not described in the COBOL program. The transfer must follow the rules for the MOVE statement without the CORRESPONDING phrase. See MOVE Statement.

Read syntax diagramSkip visual syntax diagram
ACCEPT Statement - Format 2 - System Info Transfer

>>-ACCEPT--identifier-1--FROM--+-DATE--+--------------+-+------->
                               |       |          (1) | |   
                               |       '-YYYYMMDD-----' |   
                               +-DAY--+-------------+---+   
                               |      |         (1) |   |   
                               |      '-YYYYDDD-----'   |   
                               +-DAY-OF-WEEK------------+   
                               '-TIME-------------------'   

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

Notes:
  1. IBM Extension
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
Format 2 accesses the current date and time of day, as carried by the system. This can be useful in identifying when a particular run of an object program was executed. It can also be used to supply the date in headings and footings.
Note: The current date and time are also accessible using the CURRENT-DATE Intrinsic Function (see CURRENT-DATE).