|
you can pull just the date using %date with no *ISO restrictions.
Using your timestamp field you almost had it already
NumericUsa = %int(%char(%date(MyTimeStamp):*USA0))
Depending on what version you are on the %char is not needed.
NumericUsa = %int(%date(MyTimeStamp):*USA)
Those should work, I'm not sure if %int and %dec both allow direct from
date field conversion, but I know one of them does. I'm sure someone else
will remember more specifically and what version you need.
"Andy Hautamaki" <ahautamaki@xxxxxxxxxxxxxxx>
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
08/31/2007 01:14 PM
Please respond to
RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx>
To
"RPG400-L@xxxxxxxxxxxx" <RPG400-L@xxxxxxxxxxxx>
cc
Subject
Getting a timestamp into a numeric 8,0 in *USA
Is there a way to extract from a time stamp field just the date and
putting
it into a numeric 8,0 field in *USA?
Now I know you can extract portions using %SUBDT.
I know if I was putting it into a *ISO date field I could use %date.
But is the only method to use is building a data structure over the
timestamp like this;
D DS
D MyTimeStamp Z
D HereIsTheDate D Overlay(MyTimeStamp:1)
D HereIsTheTime T Overlay(MyTimeStamp:12)
Then doing;
NumericUsa = %int(%char(HereIsTheDate:*usa0));
Thanks;
Andy
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.