Highlighted
Absent Member.
Absent Member.
411 views

[archive] Function Question

[Migrated content. Thread originally posted on 04 August 2006]

I don't recall if I've asked this before, but is there a cobol function for finding a date in the future without muliple steps......I'm looking for something like a call function:

future-date "20060802" 365
that would return date + 365
0 Likes
2 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] Function Question

Here are a couple that we use to manipulate dates in the future. I'll add here the brief description of each.

NPDATCNV: Converts an integer value (the number of days since Dec 31, 1600) into a date in the form YYYYMMDD, or a date in the form YYYYMMDD to an integer value that is the number of days since Dec 31, 1600.
This routine does not account for the missing days in September 1752, so it may not give expected results for dates older than that.

Passed Parameters:
DATE-CONVERSION-DATE PIC 9(08)
In the format CCYYMMDD
DATE-CONVERSION-VALUE PIC S9(08)
DATE-CONVERSION-TYPE PIC X(01).
?V? or ?v? to compute an integer from a date
?D? or ?d? to compute a date from an integer

Returns DATE-CONVERSION-VALUE if ?V? or ?v? is passed, returns DATE-CONVERSION-DATE if ?D? or ?d? is passed.

NPDATEFWD: Computes the date that is (integer) number of days from the date passed.

Passed Parameters:
FIRST-DATE PIC 9(08)
In the format CCYYMMDD
NUMBER-OF-DAYS PIC S9(08)
RETURN-DATE PIC 9(08)

Returns RETURN-DATE

Hope this helps!
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Function Question

Thank you for the contribution to the forum.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.