Mark,
Yes, that helps a lot.
I still need the century concatenated when comparing LUD.
Paul
-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Mark S Waterbury
Sent: Wednesday, February 11, 2015 3:16 PM
To: Midrange Systems Technical Discussion
Subject: Re: Object Last Use Date MDY compare issue
Paul:
Commands with *OUTFILE support, like DSPOBJD, let you specify where to put the resulting data.
You could then do something like this -- (for example with an outfile in QTEMP created with the DSPOBJD command), -- using SQL:
update QTEMP/DSPOBJD
set ODCDAT = substr(ODCDAT,5,2) || substr(ODCDAT,1,2) || substr(ODCDAT,3,2),
set ODSDAT = substr(ODSDAT,5,2) || substr(ODSDAT,1,2) || substr(ODSDAT,3,2),
set ODRDAT = substr(ODRDAT,5,2) || substr(ODRDAT,1,2) || substr(ODRDAT,3,2),
set ODLDAT = substr(ODLDAT,5,2) || substr(ODLDAT,1,2) || substr(ODLDAT,3,2),
set ODUDAT = substr(ODUDAT,5,2) || substr(ODUDAT,1,2) || substr(ODUDAT,3,2),
set ODTDAT = substr(ODTDAT,5,2) || substr(ODTDAT,1,2) || substr(ODTDAT,3,2),
set ODADAT = substr(ODADAT,5,2) || substr(ODADAT,1,2) || substr(ODADAT,3,2),
set ODJDAT = substr(ODJDAT,5,2) || substr(ODJDAT,1,2) ||
substr(ODJDAT,3,2)
to change all of those fields with dates stored as "MMDDYY" to "YYMMDD" in one pass over the file ...
Then, you can query more easily, sorting those dates is much easier, etc.
Hope that helps,
Mark S. Waterbury
On 2/11/2015 11:01 AM, Steinmetz, Paul wrote:
I frequently need to compare object last use dates.
Some IBM output files QAEZDISK (use YMD while others (DSPOBJD, DSPFD) use MDY.
When MDY is used, I'm constantly breaking up the LUD into individual work fields, MM, DD, YY and then concatenating them back together with the century for the object date compare.
ODCDATCYMD ODCCEN || ODCDATY || ODCDATM || ODCDATD
Is there a better or easier way of accomplishing this?
Thank You
_____
Paul Steinmetz
IBM i Systems Administrator
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at
http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.