×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




1) what is the time format on your sql session attribute?  
2) Mine is set to *hms.  When I run sql, I get 09:05:05.

Now, here is the strange part:
3) If I do CPYF to another file, you get the same result.  Meaning the time 
stay as 09:05:05.
4) However, if you create a DDM file and use CPYF to copy it to another system, 
the time got change to 09:05:00 in sql.

Problem with RPG
5) When rpg read the field, even though the data is 09:05:05, it changes it to 
09:05:00.  If this time happen to be the key field and the program did a 
update, it actually change the time in the file to 09:05:00, which is bad.  Not 
that I care about the few seconds, the problem is if the program is doing the 
READPE, it will actually record the record twice.




-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of rob@xxxxxxxxx
Sent: Thursday, June 16, 2005 12:54 PM
To: RPG programming on the AS400 / iSeries
Subject: Re: Second is missing when read a time field from file


Working as designed.

Time        Format 
 
*ISO        hh.mm.ss 
 
*USA        hh:mm   (AM or PM)
 
*EUR        hh.mm.ss 
 
*JIS        hh:mm:ss 
 
*HMS        hh:mm:ss 


INSERT INTO ROB/LIM VALUES('12/31/2005', '09:05:05')


select mydate, mytime, second(mytime)
from rob/lim 
....+....1....+....2....+....3....+....
MYDATE      MYTIME    SECOND ( MYTIME )
12/31/2005  09:05 AM                5 
********  End of data  ******** 


Rob Berendt

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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

This mailing list archive is Copyright 1997-2026 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.