I've a cursor to fetch date from DB2/400...When date is stored as
0001-01-01, I get error - Year portion of the Date not in correct range. This is the default date my update program stores when user doesnt enter anything for date field. How can I bypass this error while fetching SQL cursor in my SQL RPGLE program?
Thanks,
NG
Software/Hardware used:
AS400 - SQLRPGLE
ASKED:
September 27, 2009 4:57 PM
UPDATED:
September 28, 2009 10:48 PM
well…just realized that the error is generated by program when i try to execute
*mdy move date1 date2
my screen field for date is of data type ‘date’ i want to display blanks when the date is 01/01/0001
can i achieve this without changing the screen field type?
You have a couple of choices. One is to test the date1 field for D’0001-01-01″ and seton an indicator to make the field non-dosplay when this happens. Another option is to define the screen field as a char or numeric field. Then you could yo something like this.
If date1 = *loval
eval date 2= *blanks
else
eval date2 = %char(date1:*mdy)
endif