On all new files/tables I create, I've been using date or timestamp types - much easier to deal with when using SQL, and you don't have to convert the numerics when want to use date logic in RPGIV. IMHO
On all new files/tables I create, I've been using date or timestamp types - much easier to deal with when using SQL, and you don't have to convert the numerics when want to use date logic in RPGIV. IMHO
Thank you for your input. Using date type fields is what I would like to do but just wondered if anyone had run into any problems.
If using a date type field in a pf, and this field is populated by entering data through a display file, will the user have to enter the separators (for ISO) for the date?
Don't use native date fields on a display file. The user will be *forced* to enter valid dates even when they just want to simply exit out of the screen. It's better (in my opinon) to convert the date to a number for display file purposes. Chris
Code
I am not sure whether to define date fields as date type or numeric. Does anyone have any suggestions?
Using the DATFMT and MAPVAL key words in the display file will allow dates to be displayed as blank fields if they contain the default value. If the user does key in the date, the system will validate it for you for correctness. In my example, StuBdt contains 090605. The Eval statement allows it to be displayed as 09/05/2005. If this date is invalid, '01/01/0001' is moved to the field and it displays as blanks.
Code