InterLinc Home Page lincoln.ne.gov  
City of Lincoln  
City of Lincoln
Systems Development

Year 2000 Project


COBOL for MVS Date Engine               Execute it! (with the web interface)

     Program Name:
          Batch:    DUTDATEB
          Online:   DUTDATEC

     Include Name
          for Both: DUTDATEI

     These programs will perform the following functions:
          Validate and Reformat Dates
          Get Current Date or Timestamp
          Add Years and/or Days
          Subtract Years and/or Days
          Subtract Dates
          Subtract Timestamps

     The default date format is MM/DD/YYYY.
     The default timestamp format is MM/DD/YYYY HH:MM:SS.

     These programs will use MVS/LE functions whenever possible.

Sending Parameters
     Function Code
     Date 1 Type
     Date 1
          Date 1 redefined for numerics
     Date 2 Type
     Date 2
          Date 2 redefined for numerics
     Date Window
     Date Out Type
Returning Parameters
     Date Out
          Out Date redefined for numerics
     Information about Out Date
          Day of Week Indicator
          Day of Week Literal
          Month Indicator
          Month Literal
          Leap Year Indicator
     Return Code


Valid Date Range  due to lilian date format
     Oct. 15, 1582  thru  Dec. 31, 9999
          For smaller dates:  add 4000 years

Function code:
     1  Validate/Reformat
     2  Get Current Date
     3  Add Days
     4  Subtract Days
     5  Subtract Dates
     6  Subtract Timestamps

Date Window
     0    Use Current Window.  If not set, uses default LE Window of
          80.
     1-99 Set New Window Value (which will stay set for the unit of
          work)

     A value of 80, the LE default, places all two-digit years within
     the 100-year window starting 80 years before the system date.
     In 1997, therefore, all two-digit years are assumed to represent
     dates between 1917 and 2016, inclusive.

Day of Week Indicator and Literal
     1    Sunday    thru
     7    Saturday

Month Indicator and Literal
     1    January   thru
     12   December

Leap Year Indicator
     0    No
     1    Yes

     A specific year is a leap year if it is evenly divisible by 400
     or evenly divisible by 4 and not evenly divisible by 100.  For
     example, the year 1900 was not a leap year but the year 2000 is
     a leap year.

Return Code
     0    Successful
     1    Invalid Function
     2    Invalid Date Type
     3    Invalid Date 1
     4    Invalid Date 2
     5    Invalid Window
     6    Date 2 too large

Limitations on Date Type:
     Function 1          (Validate/Reformat):
          DATE 1 & OUT TYPEs must equal zero thru 55, or 70
     Function 2          (Get Cuurent Date):
          DATE OUT TYPE must equal zero thru 55, 70, or 80 thru 83.
     Functions 3 & 4     (adding and subtracting days or years/days):
          DATE 1 & OUT TYPEs must equal zero thru 55, or 70
          DATE-2-TYPE must equal zero, 54 or 60*
     Function 5          (subtracting dates):
          DATE 1 & 2 TYPEs must equal zero thru 55, or 70
          DATE-OUT-TYPE must equal zero, 54 or 60*
     Function 6          (subtracting timestamps):
          DATE 1 & 2 TYPEs must equal zero, 80* thru 83
          DATE-OUT-TYPE must equal zero, 61* or 62.

*Will be used as the default, if left zero.


Systems Development