Place key fields before other fields in the file. Place major keys (for example, keys fields which are also the keys of other files) before minor keys.
Place other fields on the file in the order in which they generally appear on input and output displays. This makes the use of software tools that create device file layouts directly from the database file (such as Query) easier.
Even if all the values for a code will be numeric, define the code field as being character rather than numeric. It will then be possible to introduce character codes at a later date if the numeric code values have all been employed. It will be also easier to program an enquiry function to display the allowed values for the field because a ‘?’ may be entered directly into the code field—OS/400 does not permit the entry of a ‘?’ into numeric fields.
Avoid the use of zoned numeric fields. The native storage format for numeric fields on iSeries is packed, so it is more efficient to pack numeric fields.
Packed fields should be defined with an odd number of digits, even if this makes the field a digit larger than is actually required. This is because:
Note: Blank or zero values should not generally be allowed for prime keys, since they represent a null value. If they are required, try to assign some other value to represent a null value. For instance ‘-99999’ for a numeric field, ‘*NONE’ for an alphanumeric field.
|
Copyright © 2014 CA.
All rights reserved.
|
|