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



Dave,

When you have a file that has a date, time, or timestamp field defined, you
must compile the RPG400 program with CVTOPT(*DATETIME) when you use
CRTRPGPGM.  RPG/400 will then treat the date/time/timestamp fields as
character fields.

Then, in the program, you can reference the date field as a 10-byte
character field.  Just move this field to a data structure or substring out
the month, day, or year values from the appropriate positions in the
character field.

Just remember that if you attempt to update the value in the field, you must
ensure that you have the date formatted properly.  Otherwise the UPDATE
operation will fail with a CPF5035 error (Data mapping error on member
xxxxx).  DB2/400 will ensure that the value that you use is valid before it
will let you update the date field in the database file.

HTH

And by the way, Rob:

I still use RPG400 because it is the shop standard in the shop where I am
working.  I am trying my best to learn ILE and RPGIV stuff on the side, but
I can't just start using it in production because it is the "best" way to
write code.  Sometimes you have to just work within the framework that you
are given.

Likewise, I would love to start working in CODE/400 (again--It has to be
better now than it was 8 years ago when I first tried it..).  However, my
workstation couldn't run it if I wanted to...my Pentium 200 desktop system
is vintage and has neither the speed, memory or disk space to run/load it...


----- Original Message -----
From: "Prowak, Dave" <DProwak@ci.syracuse.ny.us>
To: <rpg400-l@midrange.com>
Sent: Tuesday, October 15, 2002 11:07 AM
Subject: handling date data types


Hi,

Is it true that using RPG400 it is NOT possible to extract the month, day or
year from
a date data type?

Dave
_______________________________________________
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l
or email: RPG400-L-request@midrange.com
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 thread ...

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.