• Subject: Re: TEST (D) question
  • From: boothm@xxxxxxx
  • Date: Sat, 03 Jul 1999 11:17:19 -0400

Try something like this instead:  

>D DateIn          S              8  0 INZ(*Zeros)
>D DateISO         S               D   DATFMT(*ISO)
>D Days            S              5  0 INZ(*Zeros)
>...
>C    *MDY          Test (D)                DateIn                 99           
>        
>C    *In99         ifeq      *on
>C                  Except    ErrorDtl
>C                  else
  *
>C    *MDY          Move      DateIn        DateISO
>C                  AddDur    Days:*Days    DateISO
>C    *MDY          Move      DateISO       DateIn
>C                  EndIf

____________________________________
    or, on your line you could say:

>C    *MDY          Move      DateIn        DateMDY
      ======

(adding the *MDY should work too since DATEMDY has no idea what DateIn
looks like) 



In <19990702152646.71260.qmail@hotmail.com>, on 07/02/99 
   at 08:26 AM, Rich Dotson <rich_dotson@hotmail.com> said:

>Hi Everyone,   I am having problems with the following code:

>D DateIn          S              8  0 INZ(*Zeros)
>D DateMDY         S               D   DATFMT(*USA)
>D DateYMD         S               D   DATFMT(*ISO)
>D Days            S              5  0 INZ(*Zeros)
>D DateAlpha       S              8
>...
>C                  Move      DateIn        DateAlpha
>C    *MDY0         Test (D)                DateAlpha              99 C         
>        
>If        *In99
>C                  Except    ErrorDtl
>C                  Iter
>C                  EndIf
>C                  Move      DateIn        DateMDY
>C                  AddDur    Days:*Days    DateMDY
>C                  Move      DateMDY       DateIn

>Here is an exerpt from the dump that is produced:

>Procedure Name . . . . . . . . . . . . :   AGEDATA
>Program Name . . . . . . . . . . . . . :   AGEDATA
>    Library . . . . . . . . . . . . . . :   RDOTSON
>Module Name. . . . . . . . . . . . . . :   AGEDATA
>Program Status . . . . . . . . . . . . :   00112
>              Date, Time or Timestamp value is not valid (C G D F).
>Previous Status  . . . . . . . . . . . :   00112
>              Date, Time or Timestamp value is not valid (C G D F).
>Statement in Error . . . . . . . . . . : 00000245

>...

>DATEALPHA             CHAR(8)              '02292013'       ' DATEFORMAT       
>    
>CHAR(4)              '*MDY'           '
>DATEIN                PACKED(8,0)          02292013.        ' DATEMDY          
>    
>DATE(10)             '10/05/1999'     '
>DATEYMD               DATE(10)             '0001-01-01'     ' DAYS             
>    
>PACKED(5,0)          00357.           '

>I get an error when the program tries to move DATEIN to DATEMDY.

>My question is this:  Why wasn't *IN99 set on by the TEST(D) command
>since  02292013 is an invalid date?   This error also occurs if DATEIN is
>a  negative value (do ask).

>I also tried the following lines with the same result:

>C   *MDY0         Test (DE)               DateAlpha
>C                 If        %Error

>Can someone explain what I am missing?

>Thanks,
>Rich Dotson
>RT3 Consulting Services, Inc.
>216-556-1710




>_______________________________________________________________ Get Free
>Email and Do More On The Web. Visit http://www.msn.com * * * * * * * * *
>* * * * * * * * * * * * * * * * * * * * * * * * * * * * * This is the
>RPG/400 Discussion Mailing List!  To submit a new         * * message,
>send your mail to "RPG400-L@midrange.com".  To unsubscribe   * * from
>this list send email to MAJORDOMO@midrange.com and specify       * *
>'unsubscribe RPG400-L' in the body of your message.  Questions should * *
>be directed to the list owner / operator: david@midrange.com          * *
>* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


-- 
-----------------------------------------------------------
boothm@ibm.net
Booth Martin
-----------------------------------------------------------

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* This is the RPG/400 Discussion Mailing List!  To submit a new         *
* message, send your mail to "RPG400-L@midrange.com".  To unsubscribe   *
* from this list send email to MAJORDOMO@midrange.com and specify       *
* 'unsubscribe RPG400-L' in the body of your message.  Questions should *
* be directed to the list owner / operator: david@midrange.com          *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


This thread ...

Replies:

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

This mailing list archive is Copyright 1997-2019 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].