Function current-date

Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Function current-date

Postby JorenWillems » Mon Feb 13, 2012 8:16 pm

Hi all

I need to rewrite a PL/1 programme into a new COBOL program.

If you use in PL/1 the function 'DATE', what is the returned result?
Same question in cobol for the function current-date.

I need to rewrite substr(date,1,6) and substr(time,1,10) into cobol.

Posts: 9
Joined: Thu Feb 24, 2011 3:13 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Function current-date


Re: Function current-date

Postby Akatsukami » Mon Feb 13, 2012 8:25 pm

DATE returns CHAR(6) in the format "YYMMDD". TIME returns CHAR(9) in the format "HHMMSS999". The COBOL CURRENT-DATE function returns "YYYYMMDDHHMISS99±HHMI (the last five characters being the offset of WULT from UTC).
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Global moderator
Posts: 999
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 48 times

Return to IBM Cobol


  • Related topics
    Last post