You can define a field for yesterday’s date as a result field, then reformat the creation date :-
YESTERDAY CHAR(CURRENT(DATE) – 1 DAYS)
CREATED SUBSTR(ODCDAT, 5, 2) || ‘/’ ||
SUBSTR(ODCDAT, 1, 2) || ‘/’ ||
SUBSTR(ODCDAT, 3, 2)
(Afraid this doesn’t show very well in the editor here, but the CHARxxx and the SUBSTRxxx all belong in the Expression columns)
I’ve reformatted the creation date (ODCDAT) to be in YYMMDD format using SUBSTR (substring) and || (concatenate) – you may have to change this slightly depending on the *DATFMT of your system.
Then just select the records where CREATED = YESTERDAY.
Not sure if this applies since I don’t have an AS/400 to test but I believe when you run DSPOBJD and save to a file, it will create a file with one field per record. If so, you will need to create another physical file via PDM or SQL in order to CPYF from your initial file into the one with fields – including a field for DATE of course. Then you use Query400 and do what Martin suggests to reformat the date field for querying. The output of this query can be copied to text in the IFS and emailed to you daily as an attachment which I think is the easiest way to keep track of this kind of thing.
Let me know if this helps at all.
DSPOBJD output is not one field per record – it is externally (DDS) described with separate fields.