× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: Re: Date fields and moving from yyyymmdd to mmddyy
  • From: "James W. Kilgore" <qappdsn@xxxxxxxxxxxxx>
  • Date: Mon, 07 Feb 2000 21:21:18 -0800
  • Organization: Progressive Data Systems, Inc.

Booth,

This does create a problem for Payroll applications where an employee has a 
birth
date prior to 1940.  Right now they are turning 60 and still have some time to 
go
before retirement.

Even then the Social Security Administration has these people on file for 
another
20+ years. Not to mention the AARP and insurance companies that need to know 
date
of birth.

IMO, this has hindered universal use of date data types, and without universal
usage, multiple techniques are necessary for date handling.  Dates within the
window, dates outside the window.

For creating shop standards, one may be better off standardizing all dates as
numeric fields and creating service programs to perform date functions.  This 
way
the service program can test the date contents and perform a different function
if it is outside of the window.  Like computing an employees age with a date of
birth in 1939.

By using a numeric field, the window is no longer an issue.

Back to your question about converting yyyymmdd to mmddyy, we use a data
structure and do a simple MOVE of the year portion, done deal.  Since we can not
print/display date data types, we found no point in converting formats via MOVE
date for print/display purposes.

    D        DS
    D                1    80 IsoDate
    D                1    20 IsoCC
    D                3    40 IsoYY
    D                5    60 IsoMM
    D                7    80 IsoDD
    D                5   100 MDYdate
    D                9   100 MDYyear
    C            MOVE IsoYY    MDYyear



"Martin, Booth" wrote:

> I am missing a step and don't know the "right" answer.  Here's the code:
>
>       * Set Registration date to mm/dd/yy
>      C                   MOVE      *Blanks       ENLTDT8           8
>      C     *ISO          TEST(D)                 ENLTDT                 98
>      C     *IN98         IFEQ      *OFF
>      C                   Move      EnLTDT        DateISO
>      C     *MDY/         MOVE      DATEISO       ENLTDT8
>      C                   END
>
> This works fine unless it is date outside the 1940-2039 window.  How do
> others test for the window?

+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.