Skip to main content

[archive] Function Question

  • August 20, 2006
  • 4 replies
  • 0 views

[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

4 replies

[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
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!

[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
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!

[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
Thank you for the contribution to the forum.

[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
Thank you for the contribution to the forum.