× 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.



On 12/27/05, Scott Klement <rpg400-l@xxxxxxxxxxxxxxxx> wrote:
>
> V5R2:
>    numFld = %int(%char(dateFld:*YMD0));
>

Ok, reply #2:  This works when dateFld is a non-array variable, but not when
it is an array element.  Note the following two test snippets I've worked
with (the only difference between the two is that first uses a non-array
standalone date field and the second defines a date array):

Program TEST1:
  d DateUSA         s               d   DatFmt( *usa ) Inz
  d YYMMDD60        s              6  0
   /free
        DateUSA = d'2005-12-25' ;
        YYMMDD60 = %int(%char(DateUSA:*YMD0 ));
        *inLR = *On ;
        DUMP(a) ;
   /end-free

Program TEST2:
  d DateUSA         s               d   DatFmt(*usa) Inz Dim(32)
  d YYMMDD60        s              6  0
   /free
        DateUSA(1) = d'2005-12-25' ;
        YYMMDD60 = %int(%char(DateUSA(1):*YMD0 ));
        *inLR = *On ;
        DUMP(a) ;
   /end-free

Program TEST1 works, program TEST2 does not.  TEST2 issues RNQ0114 "The year
portion of a Date or Timestamp value is not in the correct range (C G D F)"
for the statement doing the %int(%char.  The dump shows DATEUSA(1) set to
'12/25/2005' and YYMMDD60 = *zeros.

I searched APARs and PTF cover letters but found nothing regarding this
issue.  This is v5r2.

TIA,
Dan

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.