|
Hi Vern,
How about this? I use this to properly initialize the on screen date fields...
A VFLTDTBEG L B 5 32DATFMT(*MDY)
A COLOR(WHT)
A MAPVAL(('01/01/40' *BLANK))
Hth,
-Eric DeLong
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Vernon Hamberg
Sent: Monday, September 16, 2013 11:27 AM
To: RPG programming on the IBM i / System i
Subject: Date, Time or Timestamp value is not valid. received in DSPF - need alternative
Oh it has been awhile! I am working on a change to a screen, to enter
dates. Database field is packed 8,0 - no, don't ask why I don't change
it to a date type!
I have the display field defined as a date type, formatted as *MDY -
here's the I-spec of the compile listing.
317 316=I *MDY/D 164 171 CBKDAT
The *MDY formatting is because I don't have enough real-estate horizontally.
The dump SPLF says the error occurred in statement 316 - that's the
I-spec you see above, so far as I know.
I get this error if I leave this field "blank" on the screen - it is not
required when creating a new item - a collections call note, in this case.
The dump also says the value for CBKDAT is '0001-01-01' - that's *LOVAL
for a date - also the default, IIRC. It shows nothing (blanks) in the
input or output buffer.
I suspected that the error comes because that default date is not in the
range for an MDY date. So I put in a date like that - no error.
So I need a way to leave that field empty without getting this error.
The date in storage will be a packed data type, anyhow.
***UPDATE*** OK - I just rearranged the screen vertically, to get space
- and set the date format to *USA. I want the user to have a familiar
way of entering dates - they are used to MDY without separators, but
seeing the separators is requested.
I still get the error on this CBKDAT field when I don't put anything
there - it is shown with the default in the dump I requested.
I just tried entering 1/1/0001 - that it took as valid. When I leave the
screen field empty, it still gets the error. So is it the lack of a
value in the input buffer that is the issue?
My shortest path to success is to use the old 6-digit number with a Y
edit code and maybe the EDTMSK to protect the slashes.
But I welcome a solution to actually using the DATE type field on-screen.
TIA
Vern
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.