× 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: *CYMD in ILE RPG
  • From: Glenn Ericson <Glenn-Ericson@xxxxxxx>
  • Date: Fri, 30 Jan 1998 11:33:58 -0500

Hey  what happens to  dates between 1900  and 1939 that are  valid?

I  know special case handling of some sort<??>
=================
At 12:56 AM 1/31/98 +1100, you wrote:
>For your situation *CYMD is only suitable for moving character or numeric
fields in the form CYYMMDD 
>into a real date field.  It will not help you with a character or numeric
field in the form YYMMDD.  
>Your best approach when dealing with six or seven digit dates in character
or numeric form is to use 
>the same rules as the system; that is:
>
>Years falling between 40 and 99 are treated as being in the 20th century
(a prefix of 19) and years 
>falling between 00 and 39 are treated as being in the 21st century (a
prefix of 20).
>
>You could move the character or numeric representation into a date field
and then EXTRACT the year 
>portion.  The advantage to this approach is that if IBM decide to change
the 40-39 window it will be 
>transparent to your code although it is likely to be a little slower than
simply testing the date 
>range.
>
>See following excerpt from the ILE RPG/400 Reference:
>
> 2.3.4.1  *CYMD Format
>
> | A 3-digit year representation is also supported for fields used by the
> | MOVE, MOVEL, and TEST operations only.  This support is provided for
> | compatibility with the system *CYMD format.  The 3-digit year format is:
>
>   ’‘‘‘‘‘‘˜‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘˜‘‘‘‘‘‘‘‘‘‘‘‘‘˜‘‘‘‘‘‘‘˜‘‘‘‘‘‘‘‘‘‘‘‘‘“
> |  *CYMD CenturyYear/Month/Day        cyy/mm/dd      9    001/01/15   
>   ”‘‘‘‘‘‘™‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘™‘‘‘‘‘‘‘‘‘‘‘‘‘™‘‘‘‘‘‘‘™‘‘‘‘‘‘‘‘‘‘‘‘‘•
>
> | where:
>
> |    Valid separators are / - . , & (the blank separator).
> |    Valid values for C are 0 (for the years 1940-1999) or 1 (for the years
> |     2000-2039).
> |    Valid values must fall between 040/01/01 to 139/12/31, where 040
> |     represents the year 1940 and 139 represents the year 2039.
>
> | Separators are optional for character fields in the *CYMD format.  To
> | indicate that there are no separators you can specify *CYMD0.
>
>And a bit more ....
>
> |    The format *CYMD is allowed in factor 1.  *CYMD0 can be specified in
> |     factor 1 if the source or target is a character field with no
> |     separators.  (For more information on *CYMD format see "*CYMD Format"
> |     in topic 2.3.4.1.)
>
> |    A two-digit year format (*MDY, *DMY, *YMD, and *JUL) or a three-digit
> |     year format (*CYMD or *CYMD0) can only represent dates in the range
> |     1940 through 2039.  An error will be issued if conversion to a two- or
> |     three-digit year format is requested for dates outside this range.
>
>Regards,
>Simon 


Glenn
___________________________________________________
Glenn Ericson,          Phoenix Consulting                      
P O Box 701164   East Elmhurst NY 11370-3164 USA                            
Phone 718 898 9805       Fax 718 446 1150
AS/400 & Year 2000- - Solutions Specialists
 © 1998 copyright,  all rights reserved
____________________________________________________


 
+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to "MIDRANGE-L@midrange.com".
| To unsubscribe from this list send email to MIDRANGE-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 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.