Defining fields manually: Difference between revisions
No edit summary |
|||
Line 9: | Line 9: | ||
<p>where:</p> | <p>where:</p> | ||
<p>name is a 1 to 255 character name that must begin with a letter and can contain any alphanumeric characters, including spaces, except:</p> | <p>name is a 1 to 255 character name that must begin with a letter and can contain any alphanumeric characters, including spaces, except:</p> | ||
<p class="code"> | <p class="code">?? | ||
?$ | ?$ | ||
?& | ?& | ||
Line 23: | Line 23: | ||
</p> | </p> | ||
<p>Specify as many field attributes as needed from [[Field Attributes|Field attributes]]. For each attribute pair shown in the list, only one of the alternatives can be specified; conflicting attributes, such as KEY and NON-KEY, cannot be used together in a single description.</p> | <p>Specify as many field attributes as needed from [[Field Attributes|Field attributes]]. For each attribute pair shown in the list, only one of the alternatives can be specified; conflicting attributes, such as KEY and NON-KEY, cannot be used together in a single description.</p> | ||
<p>Note</ | <p class="note"><b>Note:</b> | ||
Every attribute has a default value. Therefore, you only need to specify the attribute if it is not the default.</p> | |||
===When to use the FIELD keyword=== | ===When to use the FIELD keyword=== | ||
<p>The keyword FIELD is required before field names that begin with the word FIELD, PRINTER, or DATASET. It is optional with other field names. If FIELD is specified, only one field can be defined or redefined per command. For example:</p> | <p>The keyword FIELD is required before field names that begin with the word FIELD, PRINTER, or DATASET. It is optional with other field names. If FIELD is specified, only one field can be defined or redefined per command. For example:</p> | ||
Line 33: | Line 34: | ||
<p class="code">DEFINE FIELD FIELD LOCATION | <p class="code">DEFINE FIELD FIELD LOCATION | ||
</p> | </p> | ||
===Defining sort key, hash key, and record security fields=== | ===Defining sort key, hash key, and record security fields=== | ||
<p>The DEFINE command cannot be used to define sort key fields, hash key fields, or record security fields. These fields can be defined only with the | <p>The DEFINE command cannot be used to define sort key fields, hash key fields, or record security fields. These fields can be defined only with the <var>[[Initializing Files#INITIALIZE command|INITIALIZE]]</var> command and the appropriate parameter settings.</p> | ||
===Field attributes=== | ===Field attributes=== | ||
<p>The attributes listed in the following tables are introduced in [[Field Design (File Management)|Field Design]], along with a summary of the rules follow in assigning them. A number of the attributes have additional optional attributes (in particular, see [[Field Design (File Management)#ORDERED field definition|the ORDERED attribute]]) that can be specified with the [[DEFINE FIELD command]], which are also described in [[Field Design (File Management)|Field Design]].</p> | <p>The attributes listed in the following tables are introduced in [[Field Design (File Management)|Field Design]], along with a summary of the rules follow in assigning them. A number of the attributes have additional optional attributes (in particular, see [[Field Design (File Management)#ORDERED field definition|the ORDERED attribute]]) that can be specified with the [[DEFINE FIELD command]], which are also described in [[Field Design (File Management)|Field Design]].</p> | ||
====Indexing attributes==== | ====Indexing attributes==== | ||
Line 46: | Line 48: | ||
<caption>Indexing field attributes with the DEFINE command</caption> | <caption>Indexing field attributes with the DEFINE command</caption> | ||
<tr class="head"> | <tr class="head"> | ||
<th>Attribute</th> | <th>Attribute</th><th>Abbreviation</th><th>Default</th> | ||
<th>Abbreviation</th> | |||
<th>Default</th> | |||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td | <td> | ||
ORDERED CHARACTER<p>NON-ORDERED</p> | |||
<p>NON-ORDERED</p> | |||
</td> | </td> | ||
<td | <td> | ||
ORD CHAR<p>NORD</p> | |||
<p>NORD</p> | |||
</td> | </td> | ||
<td | <td>NON-ORDERED</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td> | |||
ORDERED NUMERIC<p>NON-ORDERED</p> | |||
<td | |||
<p>NON-ORDERED</p> | |||
</td> | </td> | ||
<td | <td> | ||
ORD NUM<p>NORD</p> | |||
<p>NORD</p> | |||
</td> | </td> | ||
<td | <td>NON-ORDERED</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td> | |||
KEY<p>NON-KEY</p> | |||
<td | |||
<p>NON-KEY</p> | |||
</td> | </td> | ||
<td | <td> | ||
<p>NKEY</p> | <p>NKEY</p> | ||
</td> | </td> | ||
<td | <td>NON-KEY</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td> | |||
FRV<p>NON-FRV</p> | |||
<td | <p>The ORD attribute is preferable; shown for compatibility.</p> | ||
<p | |||
<p | |||
</td> | </td> | ||
<td | <td> | ||
<p | <p>NFRV</p> | ||
</td> | </td> | ||
<td | <td>NON-FRV</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td> | |||
[NUMERIC] RANGE<p>NON-RANGE</p> | |||
<td | <p>Obsolete; supported for compatibility.</p> | ||
<p | |||
<p | |||
</td> | </td> | ||
<td | <td> | ||
NR<p>NNR</p> | |||
</td> | </td> | ||
<td | <td>NON-RANGE</td> | ||
</tr> | </tr> | ||
</table> | </table> | ||
====Data types==== | ====Data types==== | ||
<p> | |||
<p>In most cases, only one of these may be specified on any field (see the UTF attributes). The default is STRING</p> | In most cases, only one of these may be specified on any field (see the UTF attributes). The default is STRING</p> | ||
<table> | <table> | ||
Line 142: | Line 121: | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td | <td> | ||
BINARY-LARGE-OBJECT<p>CHARACTER-LARGE-OBJECT</p> | |||
<p>CHARACTER-LARGE-OBJECT</p> | |||
</td> | </td> | ||
<td | <td> | ||
BLOB<p>CLOB</p> | |||
<p>CLOB</p> | |||
</td> | </td> | ||
<td | <td> | ||
Must have Table E enabled<p></p> | |||
<p></p> | |||
</td> | </td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>FLOAT</td> | <td>FLOAT</td> | ||
<td>FLT</td> | <td>FLT</td> | ||
<td> | <td>Must have LEN specified</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
Line 167: | Line 142: | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td | <td> | ||
UTF-8<p>UTF-16</p> | |||
<p>UTF-16</p> | |||
</td> | </td> | ||
<td | <td> | ||
UTF8<p>UTF16</p> | |||
<p>UTF16</p> | |||
</td> | </td> | ||
<td | <td> | ||
Must be used in conjunction with the BLOB or CLOB attribute<p></p> | |||
</td> | </td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td | <td> | ||
VISIBLE<p>INVISIBLE</p> | |||
<p>INVISIBLE</p> | |||
</td> | </td> | ||
<td | <td> | ||
VIS<p>INV</p> | |||
<p>INV</p> | |||
</td> | </td> | ||
</tr> | </tr> | ||
</table> | </table> | ||
==== Data | ==== Data content attributes==== | ||
<table> | <table> | ||
<caption>Data content field attributes with the DEFINE command</caption> | <caption>Data content field attributes with the DEFINE command</caption> | ||
Line 207: | Line 171: | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td | <td> | ||
UPDATE IN PLACE<p>UPDATE AT END</p> | |||
<p>UPDATE AT END</p> | |||
</td> | </td> | ||
<td | <td> | ||
UP<p>UE</p> | |||
<p>UE</p> | |||
</td> | </td> | ||
<td | <td>UPDATE IN PLACE</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td> | <td> | ||
LENGTH <var class="term">m</var> | |||
</td> | </td> | ||
<td> | <td> | ||
LEN <var class="term">m</var> | |||
</td> | </td> | ||
<td> | <td> | ||
No preallocated length | |||
</td> | </td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
Line 236: | Line 194: | ||
<td>OCC n</td> | <td>OCC n</td> | ||
<td>No preallocated occurrences</td> | <td>No preallocated occurrences</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td> | <td> | ||
PAD <var class="term">character</var> | |||
</td> | </td> | ||
<td> | <td> | ||
| |||
</td> | </td> | ||
<td> | <td> | ||
< | <var class="term">character</var> = X'00' | ||
</td> | </td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td> | |||
DEFERRABLE<p>NON-DEFERRABLE</p> | |||
<td | |||
<p>NON-DEFERRABLE</p> | |||
</td> | </td> | ||
<td | <td> | ||
DEF<p>NDEF</p> | |||
<p>NDEF</p> | |||
</td> | </td> | ||
<td | <td>DEFERRABLE</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td> | |||
AT-MOST-ONE<p>EXACTLY-ONE</p> | |||
<td | |||
<p>EXACTLY-ONE</p> | |||
<p>REPEATABLE</p> | <p>REPEATABLE</p> | ||
</td> | </td> | ||
<td | <td> | ||
ONE<p>EXONE</p> | |||
<p>EXONE</p> | |||
<p>REPT</p> | <p>REPT</p> | ||
</td> | </td> | ||
<td | <td>REPT (except in 1NF files), or inside a field group (where it is EXONE)<p></p><p></p></td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td> | |||
CODED<p>NON-CODED</p> | |||
<td | |||
<p>NON-CODED</p> | |||
</td> | </td> | ||
<td | <td> | ||
COD<p>NCOD</p> | |||
<p>NCOD</p> | |||
</td> | </td> | ||
<td | <td>NON-CODED</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td> | |||
FEW-VALUED<p>MANY-VALUED</p> | |||
<td | |||
<p>MANY-VALUED</p> | |||
</td> | </td> | ||
<td | <td> | ||
FV<p>MV</p> | |||
<p>MV</p> | |||
</td> | </td> | ||
<td | <td>MANY-VALUED</td> | ||
</tr> | </tr> | ||
</table> | </table> | ||
Line 318: | Line 253: | ||
<table> | <table> | ||
<caption>Field constraint attributes with | <caption>Field constraint attributes with DEFINE</caption> | ||
<tr class="head"> | <tr class="head"> | ||
<th>Attribute</th> | <th>Attribute</th> | ||
Line 325: | Line 260: | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td | <td> | ||
UNIQUE<p>NON-UNIQUE</p> | |||
<p>NON-UNIQUE</p> | |||
</td> | </td> | ||
<td | <td> | ||
UNIQ<p>NUNIQ</p> | |||
<p>NUNIQ</p> | |||
</td> | </td> | ||
<td | <td>NON-UNIQUE is default</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td> | <td> | ||
LEVEL | |||
</td> | </td> | ||
<td> | <td> | ||
LEV | |||
</td> | </td> | ||
<td> | <td> | ||
See [[Security]] | |||
</td> | </td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td colspan="3"> | <td colspan="3"> | ||
<p><center>Field length constraints</center></p> | <p><center><b>Field length constraints</b></center></p> | ||
</td> | </td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
Line 366: | Line 293: | ||
<td>LENGTH-LE</td><td>LLE</td><td></td> | <td>LENGTH-LE</td><td>LLE</td><td></td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td colspan="3"> | <td colspan="3"> | ||
< | <center><b>Integer value constraints</b></center> | ||
(validate contents against permissible integer value) | (validate contents against permissible integer value) | ||
</td> | </td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
Line 388: | Line 310: | ||
<tr> | <tr> | ||
<td>INTEGER-LT</td><td>INTLT</td><td></td> | <td>INTEGER-LT</td><td>INTLT</td><td></td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td colspan="3"> | <td colspan="3"> | ||
< | <center><b>Float value constraints</b></center> | ||
(validate contents against permissible float value) | (validate contents against permissible float value) | ||
</td> | </td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
Line 415: | Line 333: | ||
<tr> | <tr> | ||
<td colspan="3"> | <td colspan="3"> | ||
< | <center><b>Date Time value constraints</b></center> | ||
(validate contents against permissible date times value) | (validate contents against permissible date times value) | ||
</td> | </td> | ||
</tr> | </tr> | ||
Line 430: | Line 348: | ||
<tr> | <tr> | ||
<td>DATETIME-LT</td><td>DTLT</td><td></td> | <td>DATETIME-LT</td><td>DTLT</td><td></td> | ||
</tr> | </tr> | ||
</table> | </table> | ||
==== Concatenated fields ==== | ==== Concatenated fields ==== | ||
<table> | <table> | ||
<caption>Concatenated field attributes with the DEFINE command</caption> | <caption>Concatenated field attributes with the DEFINE command</caption> | ||
Line 448: | Line 358: | ||
<th>Abbreviation</th> | <th>Abbreviation</th> | ||
<th>Notes</th> | <th>Notes</th> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>CONCATENATION-OF</td> | <td>CONCATENATION-OF</td> | ||
<td>CAT</td> | <td>CAT</td> | ||
<td> | <td>All source fields must be EXACTLY-ONE</td> | ||
</tr> | </tr> | ||
</table> | </table> | ||
Line 462: | Line 368: | ||
==== Automatic fields ==== | ==== Automatic fields ==== | ||
<table> | <table> | ||
<caption>Automatic field attributes with the DEFINE command</caption> | <caption>Automatic field attributes with the DEFINE command</caption> | ||
Line 472: | Line 377: | ||
<tr> | <tr> | ||
<td> | <td> | ||
COUNT-OCCURRENCES-OF | |||
</td> | </td> | ||
<td> | <td> | ||
CTO | |||
</td> | </td> | ||
<td> | <td> | ||
Followed by what it is you are counting; | |||
<br> | <br> | ||
not allowed for fields defined as REPEATABLE | not allowed for fields defined as REPEATABLE | ||
</td> | </td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td colspan="3"> | <td colspan="3"> | ||
< | <center><b>Tracking updates with automatic fields</b></center> | ||
</td> | </td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>CREATE-TIME</td><td>CRTM</td><td>Not allowed for fields defined as REPEATABLE</td> | |||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>CREATE- | <td>CREATE-TIMEUTC</td><td>CRTMU</td><td>Not allowed for fields defined as REPEATABLE</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td> | <td>UPDATE-TIME</td><td>UPTM</td><td>Not allowed for fields defined as REPEATABLE</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>UPDATE- | <td>UPDATE-TIMEUTC</td><td>UPTMU</td><td>Not allowed for fields defined as REPEATABLE</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>CREATE-USER</td><td>CRUS</td><td>Not allowed for fields defined as REPEATABLE</td> | |||
<td>CREATE-USER</td><td>CRUS</td><td> | |||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>UPDATE-USER</td><td>UPUS</td><td>Not allowed for fields defined as REPEATABLE</td> | |||
</tr> | </tr> | ||
</table> | </table> | ||
==== Defining a field inside a field group ==== | ==== Defining a field inside a field group ==== | ||
<table> | <table> | ||
<caption>Linking a field to a field group with the DEFINE command</caption> | <caption>Linking a field to a field group with the DEFINE command</caption> | ||
Line 525: | Line 424: | ||
<td>FIELDGROUP</td> | <td>FIELDGROUP</td> | ||
<td>FG</td> | <td>FG</td> | ||
<td>If not the last attribute specified, requires | <td>If not the last attribute specified, requires ' AND ' after it</td> | ||
</tr> | </tr> | ||
</table> | </table> | ||
===OCCURS and LENGTH clauses=== | ===OCCURS and LENGTH clauses=== | ||
<p>The variables n and m specified for OCCURS and LENGTH must be decimal numbers between 1 and 255. The PAD character can be specified in decimal, hexadecimal (X'xx'), or character (C'c') form, and can take on any value equivalent to a number between 0 and 255.</p> | <p> | ||
<p>All preallocated fields (fields that have an OCCURS clause) must be defined before any records are added to the file. </p> | The variables n and m specified for OCCURS and LENGTH must be decimal numbers between 1 and 255. The PAD character can be specified in decimal, hexadecimal (X'xx'), or character (C'c') form, and can take on any value equivalent to a number between 0 and 255.</p> | ||
<p> | |||
All preallocated fields (fields that have an OCCURS clause) must be defined before any records are added to the file. </p> | |||
<p class="note"><b>Note:</b> After records are loaded, you can add a preallocated field definition only by reinitializing the file, defining all the fields-including the new preallocated field-and reloading the records. Non-preallocated field definitions can be added at any time. </p> | <p class="note"><b>Note:</b> After records are loaded, you can add a preallocated field definition only by reinitializing the file, defining all the fields-including the new preallocated field-and reloading the records. Non-preallocated field definitions can be added at any time. </p> | ||
===Defining field retrieval attributes=== | ===Defining field retrieval attributes=== | ||
<p>If you do not know if a field will be used in retrievals, you can define it initially as NON-KEY, NON-ORDERED, and NON-RANGE. Then, you will be able to monitor the use of the field in FIND statements using information written to the journal data set and redefine it as KEY, NUMERIC RANGE, or ORDERED when necessary.</p> | <p> | ||
<p>For details, see [[ File Statistics and Tuning#Monitoring field retrievals in FIND statements|Monitoring field retrievals in FIND statements]].</p> | If you do not know if a field will be used in retrievals, you can define it initially as NON-KEY, NON-ORDERED, and NON-RANGE. Then, you will be able to monitor the use of the field in FIND statements using information written to the journal data set and redefine it as KEY, NUMERIC RANGE, or ORDERED when necessary.</p> | ||
<p> | |||
For details, see [[File Statistics and Tuning#Monitoring field retrievals in FIND statements|Monitoring field retrievals in FIND statements]].</p> | |||
==Implementing the date-time stamp feature (DTS)== | ==Implementing the date-time stamp feature (DTS)== |
Revision as of 20:50, 9 October 2013
This chapter describes the use of DEFINE FIELD command, which allows you to define the fields in a file. For the full syntax, follow that link.
Defining fields
After you create and initialize a Model 204 file, use the DEFINE command or the IFDFLD Host Language Interface function to establish the names and types of the fields in the file.
The format of the DEFINE command is:
Syntax
DEFINE FIELD name [(attribute [,[attribute ...]]) | WITH [attribute][,[attribute ...]]]
where:
name is a 1 to 255 character name that must begin with a letter and can contain any alphanumeric characters, including spaces, except:
?? ?$ ?& @ (or an alternative delete character) # (or an alternative flush character)
attribute is a member of the list in Field attributes.
If you specify the ORDERED attribute, you can follow it with a list of qualifying parameters that designate the type of ordering and the space utilization characteristics of the Ordered Index. See the discussion of the ORDERED attribute in ORDERED and NON-ORDERED attributes.
Example
In the following example the field CUSTID is named and given the ORDERED CHARACTER attribute:
DEFINE FIELD CUSTID ORDERED CHARACTER
Specify as many field attributes as needed from Field attributes. For each attribute pair shown in the list, only one of the alternatives can be specified; conflicting attributes, such as KEY and NON-KEY, cannot be used together in a single description.
Note: Every attribute has a default value. Therefore, you only need to specify the attribute if it is not the default.
When to use the FIELD keyword
The keyword FIELD is required before field names that begin with the word FIELD, PRINTER, or DATASET. It is optional with other field names. If FIELD is specified, only one field can be defined or redefined per command. For example:
DEFINE FIELD POLICYHOLDER DEFINE POLICYHOLDER
Each example above defines a field with the name POLICYHOLDER. The following example defines a field with the name FIELD LOCATION:
DEFINE FIELD FIELD LOCATION
Defining sort key, hash key, and record security fields
The DEFINE command cannot be used to define sort key fields, hash key fields, or record security fields. These fields can be defined only with the INITIALIZE command and the appropriate parameter settings.
Field attributes
The attributes listed in the following tables are introduced in Field Design, along with a summary of the rules follow in assigning them. A number of the attributes have additional optional attributes (in particular, see the ORDERED attribute) that can be specified with the DEFINE FIELD command, which are also described in Field Design.
Indexing attributes
The overall effect of the defaults is that, unless specified, the field is not indexed.
Attribute | Abbreviation | Default |
---|---|---|
ORDERED CHARACTER NON-ORDERED |
ORD CHAR NORD |
NON-ORDERED |
ORDERED NUMERIC NON-ORDERED |
ORD NUM NORD |
NON-ORDERED |
KEY NON-KEY |
NKEY |
NON-KEY |
FRV NON-FRV The ORD attribute is preferable; shown for compatibility. |
NFRV |
NON-FRV |
[NUMERIC] RANGE NON-RANGE Obsolete; supported for compatibility. |
NR NNR |
NON-RANGE |
Data types
In most cases, only one of these may be specified on any field (see the UTF attributes). The default is STRING
Attribute | Abbreviation | Notes |
---|---|---|
STRING | STR | |
BINARY | BIN | |
BINARY-LARGE-OBJECT CHARACTER-LARGE-OBJECT |
BLOB CLOB |
Must have Table E enabled |
FLOAT | FLT | Must have LEN specified |
DATETIME | DT | |
UTF-8 UTF-16 |
UTF8 UTF16 |
Must be used in conjunction with the BLOB or CLOB attribute |
VISIBLE INVISIBLE |
VIS INV |
Data content attributes
Attribute | Abbreviation | Default |
---|---|---|
UPDATE IN PLACE UPDATE AT END |
UP UE |
UPDATE IN PLACE |
LENGTH m |
LEN m |
No preallocated length |
OCCURS n | OCC n | No preallocated occurrences |
PAD character |
|
character = X'00' |
DEFERRABLE NON-DEFERRABLE |
DEF NDEF |
DEFERRABLE |
AT-MOST-ONE EXACTLY-ONE REPEATABLE |
ONE EXONE REPT |
REPT (except in 1NF files), or inside a field group (where it is EXONE) |
CODED NON-CODED |
COD NCOD |
NON-CODED |
FEW-VALUED MANY-VALUED |
FV MV |
MANY-VALUED |
Field constraints
More than one constraint may be set on a field. For example, if you only want to accept integer values between 5 and 99, then you can code:
DEFINE FIELD fieldname WITH INTGE 5 INTLE 99
Attribute | Abbreviation | Notes |
---|---|---|
UNIQUE NON-UNIQUE |
UNIQ NUNIQ |
NON-UNIQUE is default |
LEVEL |
LEV |
See Security |
|
||
LENGTH-EQ | LEQ | |
LENGTH-GE | LGE | |
LENGTH-LE | LLE | |
(validate contents against permissible integer value) |
||
INTEGER-GE | INTGE | |
INTEGER-GT | INTGT | |
INTEGER-LE | INTLE | |
INTEGER-LT | INTLT | |
(validate contents against permissible float value) |
||
FLOAT-GE | FLTGE | |
FLOAT-GT | FLTGT | |
FLOAT-LE | FLTLE | |
FLOAT-LT | FLTLT | |
(validate contents against permissible date times value) |
||
DATETIME-GE | DTGE | |
DATETIME-GT | DTGT | |
DATETIME-LE | DTLE | |
DATETIME-LT | DTLT |
Concatenated fields
Attribute | Abbreviation | Notes |
---|---|---|
CONCATENATION-OF | CAT | All source fields must be EXACTLY-ONE |
Automatic fields
Attribute | Abbreviation | Notes |
---|---|---|
COUNT-OCCURRENCES-OF |
CTO |
Followed by what it is you are counting;
|
|
||
CREATE-TIME | CRTM | Not allowed for fields defined as REPEATABLE |
CREATE-TIMEUTC | CRTMU | Not allowed for fields defined as REPEATABLE |
UPDATE-TIME | UPTM | Not allowed for fields defined as REPEATABLE |
UPDATE-TIMEUTC | UPTMU | Not allowed for fields defined as REPEATABLE |
CREATE-USER | CRUS | Not allowed for fields defined as REPEATABLE |
UPDATE-USER | UPUS | Not allowed for fields defined as REPEATABLE |
Defining a field inside a field group
Attribute | Abbreviation | Notes |
---|---|---|
FIELDGROUP | FG | If not the last attribute specified, requires ' AND ' after it |
OCCURS and LENGTH clauses
The variables n and m specified for OCCURS and LENGTH must be decimal numbers between 1 and 255. The PAD character can be specified in decimal, hexadecimal (X'xx'), or character (C'c') form, and can take on any value equivalent to a number between 0 and 255.
All preallocated fields (fields that have an OCCURS clause) must be defined before any records are added to the file.
Note: After records are loaded, you can add a preallocated field definition only by reinitializing the file, defining all the fields-including the new preallocated field-and reloading the records. Non-preallocated field definitions can be added at any time.
Defining field retrieval attributes
If you do not know if a field will be used in retrievals, you can define it initially as NON-KEY, NON-ORDERED, and NON-RANGE. Then, you will be able to monitor the use of the field in FIND statements using information written to the journal data set and redefine it as KEY, NUMERIC RANGE, or ORDERED when necessary.
For details, see Monitoring field retrievals in FIND statements.
Implementing the date-time stamp feature (DTS)
The date-time stamp feature in Model 204 lets you can easily discern when a record in a file was last changed. The date-time stamp feature is supported for ONLINE and BATCH204.
See Setting Up the Date-Time Stamp Field for the steps the System Manger must take before this feature is used,
and Adding a Date-Time Stamp field for rules on using the feature.
Preventing definition of new field names
Model 204 permits a user to define new fields at any time. This is an advantage in some applications, because it enables the file to evolve beyond its original definition. If your site does not want users to add new field names, reset the FOPT parameter to X'01' from its default value of X'00'. This file option causes Model 204 to issue the following response, when a user issues a DEFINE command:
*** M204.1261: NEW FIELD NAMES NOT PERMITTED
Regardless of the setting of the FOPT parameter, users with file manager privileges (see the PRIVDEF parameter) can define new fields at any time. See the discussion in FOPT parameter for more detail.