User's Guide

NEXTDAY

Determine the date which is a number of days from a reference date.

Function:

Determines the month, day, and year of a date which is a specified number of days from a reference date. The calculated date may be before or after the reference date. The calculated month, day, and year are returned to the calling procedure.

Parameters:

INDATE
Input date. The reference month, day, and year entered as integers (e.g., (3 14 91)). The year may be all four digits or the last two digits of the year (e.g., 1994 or 94).

NDAYS
Number of days. Number of days to increment the input date. A positive value indicates a day after the input date, while a negative value indicates a day before the input date.

OUTDATE
Output date. The month, day, and year returned as integers in character strings (e.g., ("03" "14" "91")). If the input year was four digits, the output year will be four digits also (e.g., ("03","14","1991")).

Examples:

  1. LAS> nextday indate=(01 16 92) ndays=-1 outdate=odate

    The month, day, and year of the previous day are determined and returned to the calling program as ("01" "15" "92"). The variable "odate" must have been previously declared as follows:

               local odate type=(string,2) count=3
    

  2. LAS> nextday indate=(02 17 1998) ndays=2 outdate=odate

    The month, day, and year of the previous day are determined and returned to the calling program as ("02" "19" "1998"). The variable "odate" must have been previously declared as follows:

               local odate type=(string,4) count=3
    

Description/Algorithm:

The program increments or decrements the input date by converting to a Julian date, adding NDAYS days, and converting back to month, day, and year. OUTDATE is returned in the specified TAE variable.

Nonfatal Error messages:

    None.

Fatal Error messages:

  1. [nextday-dtae] Error sending variables to TAE

    An error was encountered sending the variable block to TAE. Contact the system administrator.

  2. [nextday-fatal] Fatal error encountered

    A fatal error was encountered. The message displayed preceding this message is the error that was encountered. Processing terminates.

User Notes:

  1. The calculated month, day and year will be returned in a local variable that must be declared large enough to hold the returned date prior to calling NEXTDAY. For example, if OUTDATE=odate, the following declaration must have previously been made:

           local odate type=string count=3