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.
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:
+-------------------------------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.
The conceptual data items DATE, DAY, DAY-OF-WEEK, and TIME implicitly have USAGE DISPLAY.
The sequence of data elements (from left to right) is:
2 digits for year of century 2 digits for month of year 2 digits for day of month
Thus, 16 November 1963 is expressed as:
631116
+-------------------------------IBM Extension--------------------------------+
The sequence of data elements (from left to right) is:
4 digits for year in the Gregorian calendar 2 digits for month of year 2 digits for day of month
Thus, 16 November 1963 is expressed as:
19631116
+----------------------------End of IBM Extension----------------------------+
The sequence of data elements (from left to right) is:
2 digits for year of century 3 digits for day of year
Thus 25 December 1988 is expressed as:
88360
+-------------------------------IBM Extension--------------------------------+
The sequence of data elements (from left to right) is:
4 digits for year in the Gregorian calendar 3 digits for day of year
Thus, 31 December 1995 is expressed as:
1995365
+----------------------------End of IBM Extension----------------------------+
The single data element represents the day of the week thus:
1 represents Monday 2 represents Tuesday 3 represents Wednesday 4 represents Thursday 5 represents Friday 6 represents Saturday 7 represents Sunday
Thus Thursday is expressed as: 4
The sequence of data elements (from left to right) is:
2 digits for hour of day 2 digits for minute of hour 2 digits for second of minute 2 digits for hundredths of second
Thus 12.25 seconds after 2:41 PM is expressed as:
14411225
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.