COBOL II date add function (330 Views)
Reply
Occasional Advisor
Tony Girgenti
Posts: 19
Registered: ‎06-04-2003
Message 1 of 4 (330 Views)

COBOL II date add function

Hello.

We are using COBOL II on an MPE/iX 6.0 HP3000 system.

IN COBOL, how do i add a number of days to a date and come up with a new date?

Any help would be gratefully appreciated.

Thanks,
Tony
Please use plain text.
Valued Contributor
Glenn A. Mitchell
Posts: 73
Registered: ‎10-20-1996
Message 2 of 4 (330 Views)

Re: COBOL II date add function

Tony -

I'd use the standard COBOL intrinsic functions to do this (works on any reasonably current COBOL platform):

COMPUTE New-Date = FUNCTION DATE-OF-INTEGER(INTEGER-OF-DATE(Date1)+ Number-Of-Days)

Regards,

Glenn
Please use plain text.
Occasional Advisor
Tony Girgenti
Posts: 19
Registered: ‎06-04-2003
Message 3 of 4 (330 Views)

Re: COBOL II date add function

Hello Glenn.

I'm sorry it took so long for me to get back to this problem.

Can you explain where this information is documented. I can't seem to find anything about it for the HP3000. All of my searches about it point to manuals from MicroFocus Object COBOL.

Not sure of how to get this line working in HP COBOL II.

Thanks,
Tony
Please use plain text.
Valued Contributor
Glenn A. Mitchell
Posts: 73
Registered: ‎10-20-1996
Message 4 of 4 (330 Views)

Re: COBOL II date add function

These are standard COBOL functions that almost any recent COBOL text should explain. For detailed information about the MPE implementation, see the manual(s) at: http://docs.hp.com/en/mpeixall.html#COBOL

Make sure the POST85 option is specified on your $CONTROL card (either the system one or the one you provide).

Glenn
Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation