When entering these details, keep in mind that you are setting a "corporate" definition of the field. This is particularly important when defining descriptions, column headings, labels, attributes or edit details. Try to forget the image of this field as it will appear on a screen or report for a specific application.
When adding a new field, some default values will be displayed on this screen. These default values are defined in the Field and File Defaults described in the LANSA for i User Guide.
Field Name, Type, Length
Ideally, field names should not be longer than 6 characters (due to RPG restrictions) and must have no embedded blanks. The first character must be an alpha character and the use of # (hash) or @ (at) symbols is not recommended. Refer to the notes on Optional Alias Name if you have names longer than 6 characters.
Alphanumeric fields should be used whenever possible. Fields can be Type A (alphanumeric), S (signed) or P (packed).
The length of alpha fields (Type A) must be in the range 1 to 256. The length of signed or packed fields (Types S or P) may be in the range 1 to 30, however, be aware that the length of numeric fields varies between platforms. If the field is used across platforms (e.g. Windows), fields with more than 15 digits may result in an error or an incorrect result.
Packed decimal fields should always be an odd length.
Enter the name of the field to which you wish to link this field. Using this reference field option saves you time when you are defining fields which have factors in common. Such fields could be dates, locations, product categories and so on. The field entered here must already exist.
Reference fields are described in more detail later in this chapter.
Descriptions should make use of both upper and lower case characters. Avoid making descriptions too long.
If the description is left blank, the field name will be inserted.
Labels can be used to display the field's name on screens and reports, so it should always be specified, preferably using upper and lower case characters.
If the label is left blank, the first 15 characters of the description will be used instead. If the description has less than 15 character, then the remaining positions of the label will be filled with the label fill character (usually dots) defined in the LANSA system data area [email protected]
Make your column headings precise and not significantly wider than the field itself. Use upper and lower case characters. Column headings can be underlined as indicated in data area [email protected]
Try to fit your column headings into only one or two lines to avoid wasting space on screens and reports.
If the column headings are left blank, the first 20 characters of the field name will be inserted in the first column heading line.
Output and Input Attributes
If output or input attributes are left blank, they will default to the input or output attributes as defined in the LANSA system data area [email protected] Separate definitions exist for numeric and alpha fields.
The system default attributes should be correct for most fields.
Edit code / Edit word
The edit code is used to re-format your data before it is returned to your application. Using LANSA/Server, you can also return the edit code itself, so that your client program can reformat the data based on the code. Some edit codes are:
Refer to the IBM manual Data Description Specifications, keyword EDTCDE, for a full list of Edit Codes.
The default value can be a system variable such as *DATE, an alphanumeric literal in single quotes, such as 'LIFE COVER' or a numeric literal such as 1.345. If you don't enter a default value, blanks are assumed for an alphanumeric field (Type A) and zeros if the field is defined as numeric (Type P or S).
Optional Alias Name
This name must be unique. This name is used primarily for COBOL and PL/1 applications when field names longer than 6 characters are required.
YES, prevents anyone from deleting this field from the Repository. System fields may be copied when creating a new partition.
NO, allows the field to be deleted from the Repository (provided it is not included in a file definition, of course.)
Refer to the LANSA for i User Guide for details of this option.
Initial Public Access
Initial public access specifies the access other users are to be given to the field.
NORMAL allows other users to add, change and delete records but not modify the file's definition.
ALL allows other users to add, change and delete records as well as modify or delete the file's definition.
NONE prevents other users any access to records in this file.
Refer to Detailed Display of a Field Definition in the LANSA for i User Guide for complete details on adding or amending the field details.