Year in Date or Timestamp value is not in the correct range (C G D F).

0 pts.
Tags:
Application development
AS/400
CLP
DB2 Universal Database
RPG
RPGLE
Hi All, I am getting the above error when trying to write the control format of a subfile. The DDS is coded as follows: A O_ESD L O 9 70DATFMT(*MDY) A MAPVAL(('01/01/40' *BLANK)) Not too sure what the MAPVAL will do as I dont think it can ever be blank. Basically in the compile listing of the RPGLE I get conflicting references, in the section for the display file I get: 000033=O O_ESD 313D DATE *MDY/ 8 In the Global Field References I see this: O_ESD D(10*ISO-) 085300M 088200M It seems to be defined differently. In the RPG this screen format is cleared using the clear opcode, when I eval the O_ESD date in the debugger it comes back as '0001-01-01' in the (10*ISO-) format (*loval I guess), and this is what is causing me the error. Why if the DDS makes it *MDY/8 does the RPG convert it to (10*ISO-). And if the clear loads it with an invalid value I guess I need to add code to check for this before throwing the screen format yes? Any insight would be greatly appreciated. Thanks, Rayden.
ASKED: May 26, 2006  3:20 PM
UPDATED: June 2, 2006  10:23 AM

Answer Wiki

Thanks. We'll let you know when a new response is added.

this is one area that the iSeries is not so foolproof. For example, Query/400 can put a *MDY field on a report. But, try to output the field to a data base file; it goes out as a L date field, but is 8 long. You get IO errors when reading.

This is almost the same problem. I suggest that you keep all date values in ISO format in data files. For displays, use a 8 or 10 character field and not type L.

Your problem is that the L type field is not consistent with the *MDY just like the Query/400 example above. Change to a character field.

Discuss This Question: 4  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • DaddyCOZ
    this is one area that the iSeries is not so foolproof. For example, Query/400 can put a *MDY field on a report. But, try to output the field to a data base file; it goes out as a L date field, but is 8 long. You get IO errors when reading. This is almost the same problem. I suggest that you keep all date values in ISO format in data files. For displays, use a 8 or 10 character field and not type L. Your problem is that the L type field is not consistent with the *MDY just like the Query/400 example above. Change to a character field.
    0 pointsBadges:
    report
  • Bradskk
    Although I might not have it right according to the infocenter information it looks as if you forgot something. It should look like this. 00010A 00020A R RECORD 00030A DATFLD1 L DATFMT(*MDY) DATSEP('/') 00040A MAPVAL(('01/01/40' *BLANK)) Good luck
    0 pointsBadges:
    report
  • JPLamontre
    date is returned by the dds in ... date format. ie *iso-. I've read this recently in the documentation. It's strange the mapval values. Why do you want spaces in a date field ????. First remove this then check again. cleared value (0001-01-01) is not invalid. Do you use SQL ? sql default limit for date is 1940-01-01. If yes, change this limit with a correct SET OPTION (don't remember exact syntax)
    0 pointsBadges:
    report
  • Rryburn
    First, the MAPVAL will show blanks on the screen if you set the date field on the screen to be 01/01/40. This is useful if you want that field to show as blank so the user can enter the date. Second, the value '0001-01-01' is probably a null date. In your program in the H specs try putting 'H ALWNULL(*USRCTL)'.
    0 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following