CURRENT-DATE is COBOL intrinsic function to get current date, time and difference between current location time and Greenwich Mean Time.
MOVE FUNCTION CURRENT-DATE TO WS-CURRENT-DATE-DATA
This function returns a 20-character alphanumeric field in the below format.
01 WS-CURRENT-DATE-DATA. 05 WS-CURRENT-DATE. 10 WS-CURRENT-YEAR PIC 9(04). 10 WS-CURRENT-MONTH PIC 9(02). 10 WS-CURRENT-DAY PIC 9(02). 05 WS-CURRENT-TIME. 10 WS-CURRENT-HOURS PIC 9(02). 10 WS-CURRENT-MINUTE PIC 9(02). 10 WS-CURRENT-SECOND PIC 9(02). 10 WS-CURRENT-MILLISECONDS PIC 9(02). 05 WS-DIFF-FROM-GMT PIC S9(04). WS-CURRENT-DATE-DATA contains : 2010111917542857+0800
Probably the most useful intrinsic function is CURRENT-DATE which is a replacement for ACCEPT DATE and ACCEPT TIME. CURRENT-DATE is Y2K-compliant, having a 4-digit year.
Ready to start your tutorial with us? That's great! Send us an email and we will get back to you as soon as possible!