The Data Type identifies the type of information that is stored in the data field. Data is stored in a field in the computer's internal representation. For example, integers are stored as two or four byte binary numbers on most computers instead of a character string containing a decimal equivalent to the number.
The following paragraphs describe the data types and the default formatting rules for input and output. See Chapter 13, Formatting Data Values for more information on formatting data values.
Valid data types: The formatting rules for the data types described here are for the default formatting set. Your system administrator can specify an alternate formatting set. See Chapter 13, Formatting Data Values for more information.
boolean Also referred to as true/false. This field type accepts the following entries and converts upper-case input to lower-case:
Response Acceptable Entries
yes y or yes
no n or no
character A field which accepts printable characters of any type. Character fields may be of any length. If the field is not completely filled when data is entered, blank characters (i.e., spaces) are inserted on the right to bring the field up to the specified length.
date A date field represents dates from January 1, 1800 to December 31, 2099. Dates are accepted in the following formats (for the default formatting set):
If only two digits are entered for the year, the current century (1900) is assumed. Years before 1800 may not be entered. MM is the months in digits, and MON is the three letter abbreviation for the month.
integer Integer fields cannot contain decimal points or decimal places, and, since internal storage of integer fields is machine-dependent, integer numbers are limited in value either from -32768 to 32767 (field length of 2) or from - 2147483648 to 2147483647 (field length of 4). Numbers entered in this type of field are automatically right-justified.
money Money fields always assume the presence of two decimal places unless the user enters a decimal point (for the default formatting set; other formatting sets may have a different implied decimal point position for money values). The user entered decimal point overrides the default number. For example, $50.00 may be entered as 5000 or 50.00. To enter $50.0025, however, you must type 50.0025. Money fields accept up to 15 digits in addition to commas and a decimal point. Values in this type of field are right-justified automatically.
real Values of this type may contain commas, decimal places and a decimal point. A real number may consist of a decimal point, up to 15 digits and 0-4 commas. Entries in this type of field are right-justified automatically.
string String fields are character-like fields of any length. Unlike a character field, however, they contain a termination character which marks the end of the string rather than inserting blanks into the unfilled portion of the field.
time A time field represents a time in seconds since midnight. Time values are accepted in the following formats (for the default formatting set):
HH HHam HHpm
HH:MM HH:MMam HH:MMpm
HH:MM:SS HH:MM:SSam HH:MM:SSpm
A value is assumed to be in 24 hour time, i.e., hours go from 0 to 23, unless it is followed by am or pm.
In addition to the preceding list of valid Data Types, the Field Description also recognizes a special Data Type of alias. As its name implies, an alias Data Type assigns an additional Field Name to a field which has already been defined under another Field Name. (Note: Entry of an alias does not create a new field, only a new Field Name. Thus, it is possible to give two (or more) Field Names to the same field, and thereafter to refer to the field by any of its given names.) This is a powerful feature that requires strict adherence to the conventions for Field Name definitions that are illustrated in the examples given in this chapter.
When you exit the Data Type field, its value must be an abbreviation of one of the data types. For example, t, ti, tim, and time all match the time Data Type, but rime does not match any Data Type. If the Data Type field is blank when you press RETURN, the field is assigned the default Data Type string.