F00365 repurposed for *ISO date data type fields in files

Eric Lehti

VIP Member
Here is a simple technique to repurpose the F00365 table to emulate *ISO date data type format in custom application tables compiled with *ISO type date fields. Repurpose field ONJOBN to store the character representation of *ISO, with this SQL:
SQL: update F00365
set onjobn = onctry || SUBSTR(ONDATE,7,2) || '-'
|| SUBSTR(ONDATE,1,2) || '-'
|| SUBSTR(ONDATE,4,2)
F00365 looks like this afterward:
select ondtej, ondate,onjobn from f00365
where ondtej between 111028 and 111033
SELECT statement run complete.

....+....1....+....2....+....3
Date System Work
Date Stn ID
------- -------- ----------
111,028 01/28/11 2011-01-28
111,029 01/29/11 2011-01-29
111,030 01/30/11 2011-01-30
111,031 01/31/11 2011-01-31
111,032 02/01/11 2011-02-01
111,033 02/02/11 2011-02-02
In your programs, join to table F00365 on ONDDTEJ (JDE Julian) just like you always have done in the past.
do this: MOVEL ONJOBN to your *ISO date field.
Your program will populate the *ISO date field appropriately and you will not get error messages like this shown below. With date fields you will love what you can do with date arithmetic and queries, reporting, and SQL.
enjoy. ericl

Message . . . . : The record format contains DATE/TIME/TIMESTAMP fields.
DATE/TIME/TIMESTAMP fields ignored.
Cause . . . . . : DATE, TIME and TIMESTAMP fields are ignored when *DATETIME
is not specified on compiler option CVTOPT.
Recovery . . . : Specify *DATETIME on CVTOPT if DATE, TIME or TIMESTAMP
fields are not to be ignored.
 
Back
Top