Field Specifications Screen [ HP ALLBASE/4GL Developer Reference Manual Vol. 1 ] MPE/iX 5.0 Documentation
HP ALLBASE/4GL Developer Reference Manual Vol. 1
Field Specifications Screen
This screen allows you to specify a field's attributes. A dictionary
field specification is a template defining the attributes of a field on a
record layout, screen, or report.
This screen also allows you to access the data manager specific field
attributes screen, where you can set extra attributes for this field that
are relevant to a particular data manager. Currently, you can only set
HP TurboIMAGE/iX-specific attributes on this screen.
Screen Image
Field Descriptions
Field Spec. Name Enter the name of the field specification (up to 16
characters).
Secured To protect this specification from unauthorized modification,
enter Y after you have completed the required fields on this screen. The
default is N.
If you enter Y, this specification can only be modified by a developer
who has signed on to the application under the correct development
security code.
Field Length Enter the length of the field in characters.
Repeated Times Enter a number between 1 and 255. The default
value in this field is 1. Enter a number other than 1 if the field
occurs more than once and all occurrences are to be referenced using the
same dictionary name and a subscript. (Refer to chapter 3 for an
explanation of subscript referencing.)
Minimum Entry Length Enter a number equal to the minimum number of
characters acceptable for data in this field. The entry in this field
defaults to 1.
Edit Code Enter a code defining the type of data in the field. The
following table lists the available edit codes and their meanings.
Code Meaning
X Any printable character.
A Alphabetic characters only (A to z, extended characters, or
space).
U Forced uppercase. Same as X edit code, but shifts all lowercase
alphabetic characters to uppercase.
K Alphanumeric characters only (A to z, 0 to 9, extended
characters, and underscore).
N Unsigned number (0 to 9, a period ".", or a comma ",").
S Signed number. Same as N edit code, but may include + or -.
Q Question. Y, y, N, or n only. Any characters beyond the first
character in the field are ignored.
D Date field. Must be eight characters long. The date may be
either MM/DD/YY or DD/MM/YY (depending on the system-wide date
format) where MM, DD, and YY represent the month, day, and year
respectively.
T Date field, defaulting to the current date.
Storage Type Enter a code defining the way in which the data manager
will physically store data in data set fields defined by this field
specification. You can only make an entry here if the field is numeric
(edit code N or S). The value in this field defaults to a character
storage type.
The following table lists the storage type codes and their meanings.
Storage Type Meaning
C Character (number stored in the same format as it appears on
a screen)
F Four byte, IEEE floating point
G Eight byte, IEEE floating point (double precision)
I Two byte 2's complement (integer)
L Four byte 2's complement (integer)
P Packed decimal (BCD, or binary coded decimal)
If you use the field specification in a data file or HP ALLBASE/SQL
table, and the storage type is not supported by the data manager, HP
ALLBASE/4GL will use the most appropriate storage type that is available.
For HP TurboIMAGE/iX, a default HP TurboIMAGE/iX type designator is
selected by HP ALLBASE/4GL for each field. You can examine the default
or change the type designator on the data manager specific attributes
screen.
Justification Code Enter a code defining the way in which the data is
justified within the field on entry or display. The following table
lists the justification codes and their meanings.
Code Meaning
L Data is aligned to the left boundary of the field. Trailing
blanks are replaced by the pad character.
R Data is aligned to the right boundary of the field. Leading
blanks are replaced by the pad character.
C Data is centered within the left and right boundaries of the
field.
N No justification is performed.
Decimal Places Enter a number defining the number of decimal places for
data in this field. You only need to make an entry here if the field is
numeric (edit code N or S), and has a non-integer storage type (storage
type codes C, F, G and P). For numeric fields, the value in this field
defaults to 0.
Blank When Zero This entry only applies to numeric fields (edit code N
or S). If you enter Y, the field is displayed as blank on screens if its
value is zero.
Pad Character Enter a single character to replace all spaces at the
beginning and/or end of the field depending on the justification.
Validation Range If you enter the name of a validation range in this
field, the system tests input data from a screen field against the values
in the validation range during data entry.
Validation Table If you enter the name of a validation table, the
system checks that input data from a screen field matches one of the
entries in the validation table during data entry.
NOTE If you enter the names of both a validation range and a validation
table on this screen, only data passing validation for both the
validation table and the validation range is acceptable as input
for this field.
Help Name Enter the name of a help screen. This help screen name is
automatically written to the screen fields details screen if you use the
dictionary field specification to define the characteristics for a screen
field. (Refer to chapter 6, Screen Development.) If the end-user
requests help while entering data for the field, HP ALLBASE/4GL displays
this help screen.
Description Documentation fields. Enter a description of the field
specification for documentation purposes. HP ALLBASE/4GL automatically
updates the date and time fields to show the date and time of the last
modification.
Function Keys
f1 Records Menu Cancels the current screen and displays the record
layout menu.
f2 Ranges Cancels the current screen and displays the validation
ranges screen.
f3 Tables Cancels the current screen and displays the validation
tables screen.
f4 Data Mgr Attribs. Cancels the current screen and displays the
data manager attributes screen. This is the only way to access
the data manager attributes screen.
Additional Information
Mapping to SQL Data Types.
The following table shows how the HP ALLBASE/4GL edit codes map onto HP
ALLBASE/SQL data types:
HP ALLBASE/4GL HP ALLBASE SQL Comments
Edit Code Data Type
N and S BCD(p,s) p is length, s is scale
(precision)
D and T CHAR(8)
Others CHAR(length)
Mapping to HP TurboIMAGE/iX Data Types.
For the default mapping of HP ALLBASE/4GL field specification details
onto HP TurboIMAGE/iX data item types, refer to Additional Information
under the Data Mgr Specific Field Attributes Screen.
To see or alter the default settings for a specific field specification
that you have defined, press the Data Mgr Attribs. function key from
the field specifications screen. This displays the data manager specific
field attributes screen.
Null Value Support.
Reading, detecting, and writing null values in HP ALLBASE/SQL tables are
actions supported in HP ALLBASE/4GL. HP ALLBASE/4GL associates an
indicator variable with each field in a select list or a record layout
used with an HP ALLBASE/SQL table. The status of this variable indicates
whether the field contains a null value.
The *NULL argument for the logic IF command allows you to test the status
of the indicator variable associated with a field.
The IF test has the format:
IF field_reference *NULL THEN command
Null status is transferred from one file record field to another if the
value of one field is transferred to the other with the MOVE command.
Moving a value from any field type other than a field on a select list or
a record layout associated with an HP ALLBASE/SQL table sets the
indicator variable to the non-null status. Null status is not preserved
if you use the MOVE command to move a file record buffer to another
buffer.
You can force the indicator variable for a field to the null status with
the command:
MOVE *NULL field_reference
The following table summarizes the way HP ALLBASE/4GL reads and writes
null values on input and output.
Field Type Action
Numeric fields
On output Null values are written if the indicator variable is set to null
status. Otherwise the actual value is written.
On input Null values are always converted to zero or blanks depending on
the Blank When Zero value for the destination field.
Date Fields
On output Null values are written if the indicator variable is set to the
null status. Otherwise the actual value of the field is
written.
On input A zero length string is returned to the date field.
Character fields
On output Null values are written if the indicator variable is set to null
status. Otherwise the actual value in the field is written.
This value includes any pad characters in the field, and is the
size specified by the length of the dictionary field
specification.
On input The field is filled with the pad character.
MPE/iX 5.0 Documentation