× 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.



No Booth - that is only on the database - we can never see them that way though - they are surfaced to the program as character fields.


On 2014-07-09, at 1:15 PM, Booth Martin <booth@xxxxxxxxxxxx> wrote:

D, T, and Z fields are not stored in any format useful to us. For instance, as I understand it, a date field is only 4 somethings in length. These fields know what they are and we don't care what they are. We only care how we see them. In other words, QTSTAMP is not a z field so you can't slip a z field in to it. If QTSTAMP is a new field in the file, why not change the field's definition to being a timestamp field?


On 7/9/2014 11:40 AM, Dale Janus wrote:
I have an old file that contains a date in yyyymmdd and time in hhmmss as decimals. I am trying to create a time stamp field from them.

d newdate s D inz(d'2012-10-10')
d newtime s T inz(t'23.30.59')
D myts s z

c eval newdate = %date(gqtdten:*iso)
c eval newtime = %time(gqttime:*hms)
c eval myts = newdate + newtime
c
c eval qtstamp = myts




My debug calcs looks like I created the time stamp correctly, but when I go to write the record, I get CPF5035, Data mapping error on member QUOTEHIST code 17, bad date, time, timestamp.
I dumped the program and the field looks like this:

QTSTAMP TIMESTAMP(26) '2013-11-25-07.58.12.000000'
VALUE IN HEX 'F2F0F1F360F1F160F2F560F0F74BF5F84BF1F24BF0F0F0F0F0F0'X
QTSTAT CHAR(2) 'OH' 'D6C8'X
QTTIME PACKED(6,0) 075812. '0075812F'X




I can step through the program with debug, but when I go to write, I get the error on the first record

C WRITE QThREC



I thought I was doing good moving this stuff around and creating a new time stamp. it looks good to me. but something is wrong.

There is only one timestamp field, all other fields are character or decimal. The only other field is a record id. The new file is defined by DDL and contains a unique record id that I am assuming the system will generate.

---Dale



--
Booth Martin
www.martinvt.com
(802)461-5349
Skype: booth.martin

Living on Earth may be expensive, but it includes an annual free trip around the Sun.
--
This is the RPG programming on the IBM i (AS/400 and 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.


Jon Paris

www.partner400.com
www.SystemiDeveloper.com





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.