COBOL .

COBOL Current Date

Working Storage

000340 01  W01-CURRENT-DATE.
000370     05  W01-CC   PIC XX.
000370     05  W01-YY   PIC XX.
000380     05  W01-MM   PIC XX.  
000390     05  W01-DD   PIC XX.
000400     05  W01-HH   PIC XX.
000410     05  W01-MM   PIC XX. 
000410     05  W01-SS   PIC XX. 
000420     05  W01-SSHH PIC XX. 
000430     05  W01-GMTO PIC X(5).  
000435*****(NOTE:  W01-GMTO IS GREENWICH MEAN TIME OFFSET INFORMATION)
000440
000450 01  W02-DATE.
000460     05  W02-CCYYMMDD  PIC X(08).

Current-Date Example Number 1

004310
004320     MOVE FUNCTION CURRENT-DATE to W01-CURRENT-DATE.
004430     MOVE W01-CURRENT-DATE(1:8) TO W02-DATE.
004440

Current-Date Example Number 2

004310
004320     MOVE FUNCTION CURRENT-DATE(1:8) TO W02-DATE.
004440
Comments Comments are left by visitors to FluffyCat.com and may or may not be accurate.
Comment by Fumigator on 2011-01-13 Rate this Comment

Great example, just what I needed. Worked great!

 
Sign in to comment on COBOL Current Date.