× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



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





As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.