Defining field attributes with FILEMGMT: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (minor cleanup)
Line 80: Line 80:


Data Type NON-PREALLOCATED  Average Length                        Security
Data Type NON-PREALLOCATED  Average Length                        Security
STRING      REPEATABLE     IN BYTES 20__                        LVL: 0__
STRING      REPEATABLE     in Bytes 20__                        LVL: 0__


UPD IN PLACE                           MIN. OCCURS 1__      NO. OF UNIQUE
UPD IN PLACE                         MIN. OCCURS 1__      NO. OF UNIQUE
                                      MAX. OCCURS 1__      VALUES: ________
                                      MAX. OCCURS 1__      VALUES: ________
NON-KEY      NON-ORDERED
NON-KEY      NON-ORDERED


                                <b></b>===== ACCESS/TARGET Descriptors <b></b>=====
                                      <b></b>===== ACCESS/TARGET Descriptors <b></b>=====
               NON-NUMERIC-RANGE       Picture      Format  FIXED
               NON-NUMERIC-RANGE       Picture      Format  FIXED
                                      X(20)_______  NO MIXED CASE
                                      X(20)_______  NO MIXED CASE





Revision as of 16:31, 3 April 2014

Field attributes

To display the Field Attributes screens, choose one of the following methods:

  • Press the F11 (ATTributes) key from the Field Name List screen.
  • Select the Define or Redefine function from the primary screen and specify a particular field name. For Rename and Delete, you must first use the Field Name List screen.

FILEMGMT displays the Field Attributes screen shown on Field Attribute screen: initial defaults.

Proceeding to this screen stages either:

  • The fields you specified on the Field Name List screen
  • The field you specified on the primary screen for the function you selected on the primary screen.

You use the Field Attributes screen to specify or view values for field attributes. When the field attributes are displayed for a field for the first time, FILEMGMT shows the Model 204 default values. For existing or staged fields, FILEMGMT shows the current values.

The following field attributes cannot be redefined through FILEMGMT, because they can be redefined only if the file is reorganized:

  • Data type (STRING, BINARY, FLOAT, and so on.)
  • INVISIBLE
  • PREALLOCATED
  • LENGTH, OCCURS (if preallocated)
  • FEW-VALUED/MANY-VALUED (unless NONCODED and being redefined from non-FRV to FRV)

FILEMGMT displays screens for each field you specified on the Field Name List screen or the Field Attribute screen. The fields are displayed in the same order as on the Field Name List screen. You can advance to the next field by pressing the F11 (NEXtfld) key, or return to the previous field by pressing the F10 (PREvfld) key.

FILEMGMT does not save any of the information you enter until you press one of the following function keys from the screen:

F4 RECords
F6 COMmands
F10 PREvfld
F11 NEXtfld
F12 END

Only these PF keys verify data on the screen (F7 and F8 do not).

If you are deleting or renaming a field, the items on the Field Attributes screens are entry-protected and cannot be changed.

Field Attribute screen: initial defaults

The following screen shows the default values for FILEMGMT field attributes. This screen is displayed when you define a new field.

To change an attribute, you can either type over a highlighted value or position the cursor on a value cycling field and use F7 and F8 to display new values. When you change a value, the screen can change to reflect a variety of logical dependencies. New attributes appear, and incompatible attributes are hidden. For example, if you change the default value REPEATABLE to AT-MOST-ONE, the minimum and maximum Occurs input fields disappear (see Field Attribute Screen: Example 1 (NONORDERED, PREALLOCATED)).

The attributes related to ORDERED fields appear on the same screen as other attributes, and the Access/Target Descriptors (formerly called: physical format) are on a separate part of the screen.

FILEMGMT Field Attributes FILENAME: VEHICLES FIELDNAME: MY DATE TIME STAMP FIELD NAME CONTAINING SPACES Data Type NON-PREALLOCATED Average Length Security STRING REPEATABLE in Bytes 20__ LVL: 0__ UPD IN PLACE MIN. OCCURS 1__ NO. OF UNIQUE MAX. OCCURS 1__ VALUES: ________ NON-KEY NON-ORDERED ===== ACCESS/TARGET Descriptors ===== NON-NUMERIC-RANGE Picture Format FIXED X(20)_______ NO MIXED CASE ===> 1=HELp 2= 3=QUIt 4=RECords 5=COPy 6=COMmands 7=PREv value 8=NEXt value 9=SIZe 10=PRVfield 11=NXTfield 12=END

The date/time stamp field:

  • Must be STRING. Rocket Software recommends ORDERED CHARACTER.
  • Cannot be defined as INVISIBLE.
  • Cannot be a multiply occurring field
  • Can be preallocated

Field Attribute Screen: Example 1 (NONORDERED, PREALLOCATED)

The following example shows what happens when you change the attributes to NONORDERED, PREALLOCATED, and KEY.

Notice that Average Length becomes Fixed length; the Pad Char input field appears; an occurrence count input field follows REPEATABLE; and the MIN. OCCURS and MAX. OCCURS input fields are hidden. These are examples of dynamic screen management, described more fully in Field attribute dependency rules.

FILEMGMT Field Attributes FILENAME: ABC FIELDNAME: ABCFIELD Data Type PREALLOCATED Fixed Length Security STRING REPEATABLE 1__ IN BYTES ____ LVL: 0__ UPD IN PLACE NO. OF UNIQUE VALUES:________ KEY NON-ORDERED ===== ACCESS/TARGET Descriptors ===== FRV NON-NUMERIC-RANGE Picture Format FIXED MANY VALUED X(20)_______ NO MIXED CASE ===> 1=HELp 2= 3=QUIt 4=RECords 5=COPy 6=COMmands 7=PREv value 8=NEXt value 9=SIZe 10= 11= 12=END

Field Attribute Screen: Example 2 (ORDERED)

When you specify an ORDERED field, a new set of parameters appears at the bottom of the screen.

Notice that the NON-UNIQUE attribute appears, while the FRV attribute has been hidden.

FILEMGMT Field Attributes FILENAME: ABC FIELDNAME: ABCFIELD Data Type NON-PREALLOCATED Average Length Security STRING REPEATABLE IN BYTES ____ LVL: 0__ UPD IN PLACE MIN. OCCURS 1__ NO. OF UNIQUE MAX. OCCURS 1__ VALUES:________ NON-KEY ORDERED CHAR NON-UNIQUE ==== ACCESS/TARGET Descriptors ===== NON-NUMERIC-RANGE Picture Format FIXED X(20)_______ NO MIXED CASE ==================== Parameters for Ordered Index===================== IMMED: 1 LRESERVE: 15% SIZING PARAMETER: THE PERCENTAGE OF (PTRS TO TABLE-B NRESERVE: 15% THE VALUES TO BE DDED DIRECTLY, NOT IN LEAF ENTRY) SPLITPCT: 50% BY DEFERRED UPDATE) 50% ===> 1=HELp 2= 3=QUIt 4=RECords 5=COPy 6=COMmands 7=PREv value 8=NEXt value 9=SIZe 10= 11= 12=END

Field Attribute screen input

Based on the command and your entry point, you have the following options for changing information on the screen:

  • DEFINE/REDEFINE

    You can change the field name if you entered the Field Attributes screen from the primary screen to define a field. Otherwise, you cannot change the field name.

    You can type over the values of any of the attributes if the field is staged for DEFINE. Some attributes are entry-protected if the field is staged for REDEFINE.

Note: Requesting a field REDEFINE that changes the average length of a non-preallocated field might generate a record REDEFINE command for each record that the field cross-references. Each record's average length is readjusted to reflect the difference between the old and new average length multiplied by the field percent rate for the record.

  • DELETE/RENAME

    You can view but not change any information on this screen.

Field Attribute screen commands

To issue a command, press a PF key or type a command name at the prompt (===>), and press Enter.

Key Command Meaning
F1 HELP Displays HELp text for the Field Attributes screen.
F3 QUIt Exits from the Field Attributes screen and returns to the previous screen without making any changes to the current field.
F4 RECords Proceeds to the Record Name List screen. This screen lists the records in the file. Changes to the current field are saved in the dictionary.
F5 COPY This PF key allows you to copy attribute values from an existing field to a field being defined or redefined. To execute the COPY command, enter the qualified or unqualified name of the source field on the command line and press F2. All parameter values are then copied to the field being defined. This option is valid only for defining a field.

If you specify the fully-qualified field name, you can then copy attributes from fields in external files, provided that the external files are defined in the Model 204 dictionary.

F6 COMmands Proceeds to the Execute Commands screen. This screen displays the staged commands that were generated for the file and allows you to select the commands you want to execute. Changes to the current field are saved in the dictionary.
F7 NEXt value Scrolls forward through the valid values of a particular cycling input field. When there are logical conflicts between attributes, cycling values can cause other attribute input fields to be hidden or revealed.
F8 PREv value Scrolls backward through the values of a cycling input field.
F9 SIZe Proceeds to the File Size Definition screen. This screen displays information about the size of the file. Changes to the current field are saved in the dictionary.
F10 PREvfld Displays the previous field, defined by the order in which fields were selected on the Field Name List screen. Changes to the current field are saved in the dictionary.
F11 NEXtfld Displays the next field, defined by the order in which fields were selected on the Field Name List screen. Changes to the current field are saved in the dictionary.
F12 END Exits from the Field Attributes screen and returns to your entry point (Field Name List screen or primary screen). Changes to the current field are saved in the dictionary.

Abbreviations

Another time-saving device is an extensive set of abbreviations for field attribute values. For example, you can type NP, NPRE, or NON when specifying the NON-PREALLOCATED attribute.

Note: Some abbreviations (such as NON) are valid for several different attributes. When using such abbreviations, take careful note of which field attribute on the screen you are changing.

The following table lists value-cycling input fields and their abbreviations on the Field Attribute screen:

Value-cycling input fields and abbreviations
Cycled values Valid abbreviations
PREALLOCATED
NON-PREALLOCATED
P, PRE, ALLOC
NP, NPRE, NON
STRING
CODED STRING
BINARY
CODED BINARY
FLOAT
CODED FLOAT
PURE DBCS
MIXED DBCS
CLOB
BLOB
S, STR
CS, CSTR, CDSTR
B, BIN
CB, CBIN, CDBIN
F, FLT
CF, CFL, CDFL
K, KANJI, DBCS
M, MIXED, MIX
CL, CLOB, CHARLOB
BL, BLOB, BINLOB
FEW VALUED
MANY VALUED
F, FV, FEW
M, MV, MANY
AT-MOST-ONE
REPEATABLE
O, AT, ONE
R, RP, REPT
INVISIBLE
UPD IN PLACE
UPD AT END
I, INV, INVIS
UP, UIP
UE, UAE
DEFERRABLE
NON-DEFERRABLE
D, DEF
ND, NON, NDEF
KEY
NON-KEY
K
NK, NON, NKEY
ORDERED CHAR
ORDERED NUM
NON-ORDERED
OC, ORDC, ORD
ON, ORDN
NO, NON, NORD
UNIQUE
NON-UNIQUE
U, UN, UNIQ
NU, NON, NUNIQ
NUMERIC RANGE
NON NUMERIC RANGE
NR, RANGE
NNR, NON
FRV
NON-FRV
F
NF, NON, NFRV
FIXED
VARIABLE
F, FIX
V, VAR
LEADING ZEROS
TRAILING ZEROS
LEADING AND TRAILING ZEROS
NO LEADING OR TRAILING ZEROS
MIXED CASE
NO MIXED CASE
L, LZ
T, TZ
LT, LTZ
NLT, NLTZ
M, MIXED, MIX
NM, NOMIX, UPPER

Field attribute dependency rules

As the examples show, the Field Attributes screen features dynamic screen management, based on a set of dependency rules governing logical relations among attributes. The dependency rules are listed here for each attribute. For complete descriptions of file parameters, refer to List of Model 204 parameters.

Attribute Rules
Security Level Independent of all other input fields. The default value is zero, indicating that field-level security is not in effect. Maximum value is 255.
Data Type Independent of all other input fields. However, this string attribute includes the values CODED STRING, CODED BINARY, and CODED FLOAT to enforce the association of CODED with one of these three data types.

The double-byte character set (DBCS) parameters are allowed only when the system parameter DBCSENV indicates that DBCS is supported at your site.

Preallocated/Non PREALLOCATED means that space is reserved in Table B for the field. Use the REPEATABLE input field to indicate the number of occurrences to preallocate. PREALLOCATED implies Fixed Length and conflicts with the attribute INVISIBLE.

The default setting is NON-PREALLOCATED, in which case the number of occurrences cannot be entered in the REPEATABLE input field. For Large Object (CLOB) or BLOB) fields, preallocation refers only to the pointer entry stored in Table B for a Large Object field. The pointer entry is 27 bytes for each preallocated Large Object field and 30 bytes for each non-preallocated field.

Length The meaning of the Length input field depends on data type and preallocation. FLOAT implies Precision. Otherwise, NON-PREALLOCATED implies Average Length; PREALLOCATED implies Fixed Length.

The Length input field is hidden when the data type is BINARY, because this data type has a predetermined length.

PURE DBCS fields, if preallocated, require even values in the Length input field.

For Large Object (BLOB and CLOB) fields, the length of the actual object should be entered. If the Large Object data is larger than 9,999 bytes, use the Length Multiplier to enter a larger number.

Length Multiplier Enables the ability to multiply a CLOB or BLOB field length by 100 if a value of H is entered; 1,000 if a value of T is entered; or by 1,000,000 if an M is entered.
Pad Character This input field is available only when a field is preallocated and the Length attribute is also displayed. Otherwise, it is hidden.
Many-Valued/Few-Valued This input field is available only in combination with the CODED BINARY, CODED STRING, and CODED FLOAT data types, or with FRV. Otherwise, it is hidden.

The default is MANY-VALUED, as it is for the Model 204 DEFINE FIELD command.

At-Most-One/Repeatable These mutually exclusive parameters must be selected by value cycling.

Selecting AT-MOST-ONE hides the minimum and maximum input fields, which appear only if the input field value is REPEATABLE and not PREALLOCATED. If a REPEATABLE field is PREALLOCATED, use the REPEATABLE input field to indicate the number of occurrences to preallocate.

The default is REPEATABLE.

Update in Place/Invisible This input field combines two Model 204 attributes: VISIBLE/INVISIBLE and UPDATE IN PLACE/UPDATE AT END. The values UPD AT END and UPD IN PLACE imply INVISIBLE.

The value INVISIBLE is not permitted when the field is preallocated.

The default value is UPD IN PLACE.

Deferrable/Non-deferrable This input field is available only with KEY, ORDERED, or NUMERIC RANGE. Otherwise, it is hidden.

The default value is DEFERRABLE.

Min/Max Occurrences These range estimates are needed and displayed only for NON-PREALLOCATED fields.
No. of Unique Values This optional input field is displayed when a field is CODED, KEY, ORDERED, FRV, or NUMERIC RANGE.
Key This input field is independent of all the others. The default value is NON-KEY.
Ordered This input field is independent of all other input fields. The value attribute FRV is incompatible with ORDERED. NUMERIC RANGE is incompatible with ORDERED NUMERIC. The default is NON-ORDERED.
Unique This input field is displayed only when KEY and NON-ORDERED have NON-FRV.
FRV (for each value) This input field is displayed only when KEY and NON-ORDERED have been selected. Otherwise, it is hidden. The default is NON-FRV.
NUMERIC RANGE This input field is hidden if FLOAT or ORDERED NUM have been selected. The default is NON-NUMERIC RANGE.
Significant Digits This input field is displayed only for NUMERIC RANGE fields. The default value is 1.
Access/204 descriptors Applicable only to Access/204 users; dependencies are not enforced. However, warning messages are written.
Ordered Field parameters These parameters (Immediate, LRESERVE, and so on) appear only when either ORDERED NUM or ORDERED CHAR has been specified.
LRESERVE Percentage of space to leave free on the left when a leaf-page splits during a deferred update or B-tree REORGANIZE OI.

Valid values are 0 - 99. The default is 15.

NRESERVE Percentage of space to leave free on the left when a node-page splits during a deferred update or B-tree REORGANIZE OI.

Valid values are 0 - 99. The default is 15.

SPLITPCT Percentage of data to leave on the left when a page is split by an immediate update.

Valid values are 1 - 100. The default is 50.

IMMED Immediate pointers per segment in B-tree. The value determines the number of instances that can be saved in the nodes of a B-tree rather than in a separate list.

Valid values are 0 - 255. The default is 1.

SIZING PARAMETER Percentage of values that are directly added to the file (not via FLOD or deferred updates). The percentage is only a rough estimate such as 0, 50, 75, or 100.

The value is used by file sizing as a weighting factor to estimate the relative significance of LRESERVE and SPLITPCT.

Note: You can redefine the above tree structure parameters. The new values apply to the extensions of the tree, but not to the tree already in place.