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



On 22 May 2013 16:16, CRPence wrote:
<<SNIP>>
Or an enhancement in RPG RLA that allows naming the fields which are
being assigned a value, so the RPG can tell the DM\DB such that the
DB can assign the default value for those fields not included in the
WRITE.

http://www.itjungle.com/fhg/fhg072110-story02.html
_i It's My (De)fault That You're a Zero i_
"Published: July 21, 2010
by Ted Holt
...
A field's default value is the value the system assigns to the field when an application does not specify a value. Default values come into play in several situations.
...
2. RPG O specs list the fields of an externally described file, but not all fields are listed.
..."

The following may just describe such an enhancement.?:
http://archive.midrange.com/rpg400-l/200905/msg00104.html
"...
If you want to use the default value in RPG you have to use an
externally described data structure with INZ(*EXTDFT)
http://publib.boulder.ibm.com/infocenter/iseries/v6r1m0/index.jsp?topic=/rzasd/sc092508548.htm
..."

Seems so obvious, after reading the below, that for the effect of a /current/ [special register] feature, the effect of /External Default/ initialization would not be helpful for DATE/TIME/TIMESTAMP columns:

http://www.mcpressonline.com/forum/showthread.php?12673-Timestamp-field-without-DFT
_i Timestamp field without DFT i_
"
On 11-16-2006 02:13 PM B.Morris wrote:

When you write a record using O specs, RPG uses RPG default values for the fields you don't specify on O specs. The system default of the current date/time would be in effect if RPG didn't even know about the field; that would be the case if the RPG program was using a logical file that didn't have the timestamp field. So using such a logical file would be the easiest way, assuming your RPG programs don't need those timestamp fields for anything else. You could get your program fields _initialized_ with the database default values by using an externally described DS with INZ(*EXTDFT), but your timestamp fields wouldn't get the current value on every record; they would all get the same initialization timestamp.

Fmyfile o e disk D e ds inz(*extdft) extname(myfile)

On 12-04-2006 03:30 PM Steve Zimmerman wrote:

We added a timestamp field to a file and did not specify a DFT value. According to the IBM documentation, it should default to the current date/time when you add a record to the file. It does so from DBU, SQL and CPYF, but when we write a record in an RPG program, it gets a value of 0001-01-01-00.00.00.000000. Is there any way to get this to work from RPG, or do we have to change all of our programs to overtly populate the new field with the system time? Thanks!
"


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