|
You need to put *USA or another date format code into Factor 1 of the MOVE opcode or it will use the default for the program. Factor 1 identifies the date format of the non-date value on a MOVE between date fields and non-date fields. Bob Cozzi www.rpgiv.com ----- Original Message ----- From: Rich Dotson <rich_dotson@hotmail.com> To: <RPG400-L@midrange.com> Sent: Friday, July 02, 1999 10:26 AM Subject: TEST (D) question > 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 * > * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * > * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 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 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
As an Amazon Associate we earn from qualifying purchases.
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.