REDEFINE command: Difference between revisions

From m204wiki
Jump to navigation Jump to search
(Automatically generated page update)
m (link repair)
 
(22 intermediate revisions by 3 users not shown)
Line 6: Line 6:
<dd>Modifies the definition of a field in a <var class="product">Model&nbsp;204</var> file
<dd>Modifies the definition of a field in a <var class="product">Model&nbsp;204</var> file
</dl>
</dl>
==Syntax==
==Syntax==
<p class="syntax">REDEFINE [FIELD]
<p class="syntax">REDEFINE [FIELD]
  {<i>field-description</i> [<i>field-description</i>]...
  {<span class="term">field-description</span> [<span class="term">field-description</span>]...
  | <i>fieldname</i> WITH <i>attribute</i> [<i>attribute</i>]...}
  | <span class="term">fieldname</span> WITH <span class="term">attribute</span> [<span class="term">attribute</span>]...}
</p>
</p>
   
   
Line 15: Line 16:
<table>  
<table>  
<tr>
<tr>
<th>field-description</th>
<th nowrap>field-description</th>
<td> takes the following form:
<td>Takes the following form:
<p class="code"><i>fieldname</i> [(<i>attribute</i> [<i>attribute</i>]...)]
<p class="code"><i>fieldname</i> [(<i>attribute</i> [<i>attribute</i>]...)]
</p></td>
</p></td>
Line 23: Line 24:
<tr>
<tr>
<th>fieldname</th>
<th>fieldname</th>
<td> (1 to 255 characters) is the name of a field in the open <var class="product">Model&nbsp;204</var> file.</td>
<td>The name (1 to 255 characters) of a field in the open <var class="product">Model&nbsp;204</var> file.</td>
</tr>
</tr>
   
   
<tr>
<tr>
<th>attribute</th>
<th>attribute</th>
<td> is one of those listed in the table below. All attributes are described in detail in the <var class="book">Model&nbsp;204 File Manager's Guide</var>.
<td>One of those listed in the table below. All attributes are described in detail in [[DEFINE FIELD command]] and [[Field design]].
<table>
 
<caption> Field description attributes </caption>
<table class="thJustBold">
   
<tr class="head">  
<tr> <th>
<th><p>Field description attribute</p>
<p>Field description attribute</p>
</th>  
</th> <th>
<th><p>Abbreviation</p>
<p>Abbreviation</p>
</th> </tr>
</th> </tr>
    
    
<tr> <th><var>
<tr> <th><var><p>BINARY-LARGE-OBJECT</p></var></th>  
<p>BINARY-LARGE-OBJECT</p>
<td><p>BLOB</p>
</var></th> <td>
<p>BLOB</p>
</td> </tr>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var><p>CHARACTER-LARGE-OBJECT</p></var></th>  
<p>CHARACTER-LARGE-OBJECT</p>
<td><p>CLOB</p></td>  
</var></th> <td>
</tr>
<p>CLOB</p>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var><p>DEFERRABLE</p></var></th>  
<p>DEFERRABLE</p>
<td><p>DEF</p>
</var></th> <td>
<p>DEF</p>
</td> </tr>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var><p>NON-DEFERRABLE</p></var></th>  
<p>NON-DEFERRABLE</p>
<td><p>NDEF</p>
</var></th> <td>
<p>NDEF</p>
</td> </tr>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var><p>FEW-VALUED *</p></var></th>  
<p>FEW-VALUED *</p>
<td><p>FV</p>
</var></th> <td>
<p>FV</p>
</td> </tr>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var><p>MANY-VALUED *</p></var></th>  
<p>MANY-VALUED *</p>
<td><p>MV</p>
</var></th> <td>
<p>MV</p>
</td> </tr>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var><p>FRV (for-each-value)</p></var></th>  
<p>FRV (for-each-value)</p>
<td><p>-</p>
</var></th> <td>
<p>-</p>
</td> </tr>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var><p>NON-FRV</p></var></th>  
<p>NON-FRV</p>
<td><p>NFRV</p>
</var></th> <td>
<p>NFRV</p>
</td> </tr>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var><p>KEY</p></var></th>  
<p>KEY</p>
<td><p>-</p>
</var></th> <td>
<p>-</p>
</td> </tr>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var><p>NON-KEY</p></var></th>  
<p>NON-KEY</p>
<td><p>NKEY</p>
</var></th> <td>
<p>NKEY</p>
</td> </tr>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var><p>LEVEL k</p></var></th>  
<p>LEVEL k</p>
<td><p>LVL k</p>
</var></th> <td>
<p>LVL k</p>
</td> </tr>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var><p><b>[</b>NUMERIC<b>]</b> RANGE</p></var></th>  
<p><b>[</b>NUMERIC<b>]</b> RANGE</p>
<td><p>NR</p>
</var></th> <td>
<p>NR</p>
</td> </tr>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var><p>NON-RANGE</p></var></th>  
<p>NON-RANGE</p>
<td><p>NNR</p>
</var></th> <td>
<p>NNR</p>
</td> </tr>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var><p>ORDERED</p></var></th>  
<p>ORDERED</p>
<td><p>-</p>
</var></th> <td>
<p>-</p>
</td> </tr>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var><p>NON-ORDERED</p></var></th>  
<p>NON-ORDERED</p>
<td><p>NORD</p>
</var></th> <td>
<p>NORD</p>
</td> </tr>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var><p>UNIQUE</p></var></th>  
<p>UNIQUE</p>
<td><p>UNIQ</p>
</var></th> <td>
<p>UNIQ</p>
</td> </tr>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var><p>NON-UNIQUE</p></var></th>  
<p>NON-UNIQUE</p>
<td><p>NUNIQ</p>
</var></th> <td>
<p>NUNIQ</p>
</td> </tr>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var><p>UPDATE IN PLACE</p></var></th>  
<p>UPDATE IN PLACE</p>
<td><p>UP</p>
</var></th> <td>
<p>UP</p>
</td> </tr>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var><p>UPDATE AT END</p></var></th>  
<p>UPDATE AT END</p>
<td><p>UE</p>
</var></th> <td>
</td> </tr>  
<p>UE</p>
</td> </tr>
 
</table>
</table>
<p>* You can specify FEW-VALUED and MANY-VALUED only if a field is being redefined from NON-FRV NON-CODED to FRV NON-CODED.</p>
 
<p>* You can specify <var>FEW-VALUED</var> and <var>MANY-VALUED</var> only if a field is being redefined from <var>NON-FRV NON-CODED</var> to <var>FRV NON-CODED</var>.</p>
</td>
</td>
</tr>
</tr>  
</table>
</table>
===Syntax notes===
===Syntax notes===
<p>If FIELD is specified or the WITH form of the REDEFINE command is used, only one field can be redefined; otherwise, multiple fields can be redefined.</p>
<ul>
<p>The attributes must be enclosed in parentheses unless WITH is specified.</p>
<li>If <var>FIELD</var> is specified, or if the <var>WITH</var> form of the <var>REDEFINE</var> command is used, only one field can be redefined; otherwise, multiple fields can be redefined.</li>
<p>Attributes must be separated by commas or by one or more blanks.</p>
 
<p>REDEFINE can be specified only in file context.</p>
<li>The attributes must be enclosed in parentheses unless <var>WITH</var> is specified.
<p>
Attributes must be separated by commas or by one or more blanks.</p></li>
 
<li><var>REDEFINE</var> can be specified only in file context.</li>
</ul>
 
==Example==
==Example==
<p class="code">REDEFINE SOC SEC (KEY,NR,LEVEL 0)
<p class="code">REDEFINE SOC SEC (KEY,NR,LEVEL 0)
REDEFINE AGE WITH KEY  
REDEFINE AGE WITH KEY  
</p>
</p>
==Usage notes==
==Usage notes==
<p>The REDEFINE command allows the file manager to alter a field definition without having to reinitialize or reload the file in which the field is stored. </p>
<ul>
<p>The file manager can specify as many attributes as are needed. OCCURS, LENGTH, and PAD (see [[DEFINE FIELD command|DEFINE FIELD]]) cannot be included. For each attribute, only one of the alternatives shown above can be specified. For example, either KEY or NON-KEY can be specified, but not both. </p>
<li>The <var>REDEFINE</var> command allows the file manager to alter a field definition without having to reinitialize or reload the file in which the field is stored.  
<p>If an attribute is specified in the DEFINE command, but not changed by the REDEFINE, that attribute remains in effect for the field. </p>
<p>
<p>A field can be REDEFINED with the UNIQUE attribute. However, if non-unique values are found during REDEFINE processing, the REDEFINE fails and the following error message is produced for each non-unique value:</p>
The file manager can specify as many attributes as are needed. <var>OCCURS</var>, <var>LENGTH</var>, and <var>PAD</var> (see <var>[[DEFINE FIELD command|DEFINE FIELD]]</var>) cannot be included. For each attribute, only one of the alternatives shown above can be specified. For example, either <var>KEY</var> or <var>NON-KEY</var> can be specified, but not both. </p></li>
 
<li>If an attribute is specified in the <var>DEFINE</var> command, but not changed by the <var>REDEFINE</var>, that attribute remains in effect for the field. </li>
 
<li>You can <var>REDEFINE</var> a field with the <var>UNIQUE</var> attribute. However, if non-unique values are found during <var>REDEFINE</var> processing, the <var>REDEFINE</var> fails, and the following error message is produced for each non-unique value:
<p class="code">*** M204.1701: NON-UNIQUE VALUE value FOUND FOR FIELD
<p class="code">*** M204.1701: NON-UNIQUE VALUE value FOUND FOR FIELD
fieldname IN RECORD NUMBER n; CONFLICTS WITH RECORD NUMBER n
fieldname IN RECORD NUMBER n; CONFLICTS WITH RECORD NUMBER n
</p>
</p></li>
====FIELD keyword====
</ul>
<p>The keyword FIELD is required before field names that begin with the word FIELD, PRINTER, or DATASET. It is optional before other field names. If FIELD is specified, only one field can be redefined per command.</p>
 
<p>The following examples both redefine a field with the name POLICYHOLDER:</p>
===FIELD keyword===
<p>
The keyword <var>FIELD</var> is required before field names that begin with the word <code>FIELD</code>, <code>PRINTER</code>, or <code>DATASET</code>. It is optional before other field names. If <var>FIELD</var> is specified, only one field can be redefined per command.</p>
<p>
The following examples both redefine a field with the name <code>POLICYHOLDER</code>:</p>
<p class="code">REDEFINE FIELD POLICYHOLDER (KEY)
<p class="code">REDEFINE FIELD POLICYHOLDER (KEY)
REDEFINE POLICYHOLDER (KEY)
REDEFINE POLICYHOLDER (KEY)
</p>
</p>
<p>The following example redefines a field with the name FIELD LOCATION. In this example the keyword FIELD must precede the name of the field name to avoid confusing <var class="product">Model&nbsp;204</var>: </p>
<p>
The following example redefines a field with the name <code>FIELD LOCATION</code>. In this example the keyword <var>FIELD</var> must precede the name of the field name to avoid confusing <var class="product">Model&nbsp;204</var>: </p>
<p class="code">REDEFINE FIELD FIELD LOCATION (ORD)  
<p class="code">REDEFINE FIELD FIELD LOCATION (ORD)  
</p>
</p>
====ORDERED fields====
 
<p>The NON-ORDERED and ORDERED attributes relate to the Ordered Index. The NON-ORDERED attribute can be used to eliminate the Ordered Index for a given field.</p>
===ORDERED fields===
<p>The ORDERED attribute followed by a new tree type can change the tree type of an ORDERED field. The tree type can be either CHARACTER or NUMERIC. Changing the tree type deletes the old tree type.</p>
<p>
<p>If a field already is defined as ORDERED, the REDEFINE command can change the related attributes by specifying the attribute and a new value. A change to the LRESERVE, NRESERVE, SPLITPCT, or IMMED attribute does not cause any change to the existing Ordered Index but modifies the effect of any updates.</p>
The <var>NON-ORDERED</var> and <var>ORDERED</var> attributes relate to the Ordered Index. The <var>NON-ORDERED</var> attribute can be used to eliminate the Ordered Index for a given field.</p>
<p>Refer to the discussion of the [[DEFINE FIELD command|"DEFINE FIELD: Field names and attributes"]] for more information on the Ordered Index field attributes.</p>
<p>
<p>The following example eliminates the Ordered Index for the TAX field: </p>
The <var>ORDERED</var> attribute followed by a new tree type can change the tree type of an <var>ORDERED</var> field. The tree type can be either <var>CHARACTER</var> or <var>NUMERIC</var>. Changing the tree type deletes the old tree type.</p>
<p>
If a field already is defined as <var>ORDERED</var>, the <var>REDEFINE</var> command can change the related attributes by specifying the attribute and a new value. A change to the <var>LRESERVE</var>, <var>NRESERVE</var>, <var>SPLITPCT</var>, or <var>IMMED</var> attribute does not cause any change to the existing Ordered Index but modifies the effect of any updates.</p>
<p>
Refer to the discussion in [[DEFINE FIELD command]] for more information on the Ordered Index field attributes.</p>
<p>
The following example eliminates the Ordered Index for the <code>TAX</code> field: </p>
<p class="code">REDEFINE TAX (NON-ORDERED)  
<p class="code">REDEFINE TAX (NON-ORDERED)  
</p>
</p>
<p>The following example changes the tree type of the Ordered Index CHARGE field: </p>
<p>
The following example changes the tree type of the Ordered Index <code>CHARGE</code> field: </p>
<p class="code">REDEFINE CHARGE (ORDERED CHAR)  
<p class="code">REDEFINE CHARGE (ORDERED CHAR)  
</p>
</p>
<p>The following example changes the related attributes of an Ordered Index field:</p>
<p>
The following example changes the related attributes of an Ordered Index field:</p>
<p class="code">REDEFINE EXPENSE (IMMED 20)   
<p class="code">REDEFINE EXPENSE (IMMED 20)   
</p>
</p>
====Redefining INVISIBLE fields====
 
<p>You cannot use the REDEFINE command to add a new index to a field with the INVISIBLE attribute that is in a file that has been used, so that MSTRADD is nonzero. For an invisible field the REDEFINE command cannot specify the KEY, ORD CHAR, and ORD NUM attribute nor the NUMERIC RANGE attribute, unless the field was originally defined with that attribute.</p>
===Redefining OI CHUNK fields===
<p>The behavior of the REDEFINE command changed in Version 5.1. Prior to Version 5.1, when you redefined an invisible field with options that added a new index, such as KEY, NUMERIC RANGE, or ORDERED, the redefinition for the field was accepted. However, the new index was not actually built (and could not be because the field was invisible). Now, if you redefine an invisible field with options that specify a new index for the field, the redefinition is rejected with the following message:</p>
Redefining OI <var>CHUNK</var> fields or OI <var>CHUNK</var> target fields is not allowed.
 
===Redefining INVISIBLE fields===
<p>
You cannot use the <var>REDEFINE</var> command to add a new index to a field with the <var>INVISIBLE</var> attribute that is in a file that has been used, so that <var>MSTRADD</var> is nonzero. For an invisible field, the <var>REDEFINE</var> command cannot specify the <var>KEY</var>, <var>ORD CHAR</var>, and <var>ORD NUM</var> attributes nor the <var>NUMERIC RANGE</var> attribute, unless the field was originally defined with that attribute.</p>
<p>
The behavior of the <var>REDEFINE</var> command changed in Version 5.1. Prior to Version 5.1, when you redefined an invisible field with options that added a new index, such as <var>KEY</var>, <var>NUMERIC RANGE</var>, or <var>ORDERED</var>, the redefinition for the field was accepted. However, the new index was not actually built (and could not be because the field was invisible). Now, if you redefine an invisible field with options that specify a new index for the field, the redefinition is rejected with the following message:</p>
<p class="code">M204.0411: CONFLICTING ATTRIBUTES: INVISIBLE FIELD WITH NEW INDEX
<p class="code">M204.0411: CONFLICTING ATTRIBUTES: INVISIBLE FIELD WITH NEW INDEX
</p>
</p>
====The following exception applies====
<blockquote class="note">
<p>in the case where no records have ever been stored in the file, and that case only, redefining an invisible field may specify options that add a new index for the field.</p>
<p><b>Exception:</b>
<p>The behavior of the REDEFINE command does not change when used with invisible fields and options that do not add a new index for the field.</p>
The following exception applies: in the case where no records have ever been stored in the file, and that case only, redefining an invisible field can specify options that add a new index for the field.</p>
====Update units====
<p>
<p>When it processes REDEFINE, <var class="product">Model&nbsp;204</var> ends any update unit in progress and begins a non-backoutable update unit. For more information about <var class="product">Model&nbsp;204</var> update units, see the <var class="book">Model&nbsp;204 File Manager's Guide</var>.</p>
The behavior of the <var>REDEFINE</var> command does not change when used with invisible fields and options that do not add a new index for the field.</p>
====Redefining Large Object fields====
</blockquote>
<p>You can redefine a Large Object field, if the file is empty and you specify that the that the field is (BLOB NCLOB) or (CLOB NBLOB). For example, the following statement is unsuccessful: </p>
 
===Update units===
<p>
When it processes <var>REDEFINE</var>, <var class="product">Model&nbsp;204</var> ends any update unit in progress and begins a non-backoutable [[File integrity and recovery#Update units and transactions|update unit]].</p>
 
===Redefining Large Object fields===
<p>
You can redefine a Large Object field, if the file is empty and you specify that the that the field is (<var>BLOB NCLOB</var>) or (<var>CLOB NBLOB</var>). For example, the following statement is unsuccessful: </p>
<p class="code">REDEFINE FLD_LOB (BLOB)
<p class="code">REDEFINE FLD_LOB (BLOB)
<b></b>*** 2 M204.0411: CONFLICTING ATTRIBUTES: BLOB AND CLOB
<b></b>*** 2 M204.0411: CONFLICTING ATTRIBUTES: BLOB AND CLOB
</p>
</p>
<p>However, the following statement is successful:</p>
<p>
However, the following statement is successful:</p>
<p class="code">REDEFINE FLD_LOB (BLOB NCLOB)
<p class="code">REDEFINE FLD_LOB (BLOB NCLOB)
</p>
</p>
<p>Furthermore, you can redefine a field as a Large Object field, if no data has been entered in the field. For example, the following statements are unsuccessful: </p>
<p>
Furthermore, you can redefine a field as a Large Object field, if no data has been entered in the field. For example, the following statements are unsuccessful: </p>
<p class="code">REDEFINE FLD_LOB (BLOB NCLOB)
<p class="code">REDEFINE FLD_LOB (BLOB NCLOB)
<b></b>*** 2 M204.0411: CONFLICTING ATTRIBUTES: FILE NOT EMPTY
<b>*** 2 M204.0411: CONFLICTING ATTRIBUTES: FILE NOT EMPTY</b>
 
REDEFINE FLD_LOB (KEY NCLOB)
REDEFINE FLD_LOB (KEY NCLOB)
<b></b>*** 2 M204.0411: CONFLICTING ATTRIBUTES: FILE NOT EMPTY
<b>*** 2 M204.0411: CONFLICTING ATTRIBUTES: FILE NOT EMPTY</b>
</p>
</p>
[[Category: File manager commands]]
[[Category: File manager commands]]
[[Category:Commands]]
[[Category:Commands]]

Latest revision as of 18:22, 3 August 2015

Summary

Privileges
File manager
Function
Modifies the definition of a field in a Model 204 file

Syntax

REDEFINE [FIELD] {field-description [field-description]... | fieldname WITH attribute [attribute]...}

Where:

field-description Takes the following form:

fieldname [(attribute [attribute]...)]

fieldname The name (1 to 255 characters) of a field in the open Model 204 file.
attribute One of those listed in the table below. All attributes are described in detail in DEFINE FIELD command and Field design.

Field description attribute

Abbreviation

BINARY-LARGE-OBJECT

BLOB

CHARACTER-LARGE-OBJECT

CLOB

DEFERRABLE

DEF

NON-DEFERRABLE

NDEF

FEW-VALUED *

FV

MANY-VALUED *

MV

FRV (for-each-value)

-

NON-FRV

NFRV

KEY

-

NON-KEY

NKEY

LEVEL k

LVL k

[NUMERIC] RANGE

NR

NON-RANGE

NNR

ORDERED

-

NON-ORDERED

NORD

UNIQUE

UNIQ

NON-UNIQUE

NUNIQ

UPDATE IN PLACE

UP

UPDATE AT END

UE

* You can specify FEW-VALUED and MANY-VALUED only if a field is being redefined from NON-FRV NON-CODED to FRV NON-CODED.

Syntax notes

  • If FIELD is specified, or if the WITH form of the REDEFINE command is used, only one field can be redefined; otherwise, multiple fields can be redefined.
  • The attributes must be enclosed in parentheses unless WITH is specified.

    Attributes must be separated by commas or by one or more blanks.

  • REDEFINE can be specified only in file context.

Example

REDEFINE SOC SEC (KEY,NR,LEVEL 0) REDEFINE AGE WITH KEY

Usage notes

  • The REDEFINE command allows the file manager to alter a field definition without having to reinitialize or reload the file in which the field is stored.

    The file manager can specify as many attributes as are needed. OCCURS, LENGTH, and PAD (see DEFINE FIELD) cannot be included. For each attribute, only one of the alternatives shown above can be specified. For example, either KEY or NON-KEY can be specified, but not both.

  • If an attribute is specified in the DEFINE command, but not changed by the REDEFINE, that attribute remains in effect for the field.
  • You can REDEFINE a field with the UNIQUE attribute. However, if non-unique values are found during REDEFINE processing, the REDEFINE fails, and the following error message is produced for each non-unique value:

    *** M204.1701: NON-UNIQUE VALUE value FOUND FOR FIELD fieldname IN RECORD NUMBER n; CONFLICTS WITH RECORD NUMBER n

FIELD keyword

The keyword FIELD is required before field names that begin with the word FIELD, PRINTER, or DATASET. It is optional before other field names. If FIELD is specified, only one field can be redefined per command.

The following examples both redefine a field with the name POLICYHOLDER:

REDEFINE FIELD POLICYHOLDER (KEY) REDEFINE POLICYHOLDER (KEY)

The following example redefines a field with the name FIELD LOCATION. In this example the keyword FIELD must precede the name of the field name to avoid confusing Model 204:

REDEFINE FIELD FIELD LOCATION (ORD)

ORDERED fields

The NON-ORDERED and ORDERED attributes relate to the Ordered Index. The NON-ORDERED attribute can be used to eliminate the Ordered Index for a given field.

The ORDERED attribute followed by a new tree type can change the tree type of an ORDERED field. The tree type can be either CHARACTER or NUMERIC. Changing the tree type deletes the old tree type.

If a field already is defined as ORDERED, the REDEFINE command can change the related attributes by specifying the attribute and a new value. A change to the LRESERVE, NRESERVE, SPLITPCT, or IMMED attribute does not cause any change to the existing Ordered Index but modifies the effect of any updates.

Refer to the discussion in DEFINE FIELD command for more information on the Ordered Index field attributes.

The following example eliminates the Ordered Index for the TAX field:

REDEFINE TAX (NON-ORDERED)

The following example changes the tree type of the Ordered Index CHARGE field:

REDEFINE CHARGE (ORDERED CHAR)

The following example changes the related attributes of an Ordered Index field:

REDEFINE EXPENSE (IMMED 20)

Redefining OI CHUNK fields

Redefining OI CHUNK fields or OI CHUNK target fields is not allowed.

Redefining INVISIBLE fields

You cannot use the REDEFINE command to add a new index to a field with the INVISIBLE attribute that is in a file that has been used, so that MSTRADD is nonzero. For an invisible field, the REDEFINE command cannot specify the KEY, ORD CHAR, and ORD NUM attributes nor the NUMERIC RANGE attribute, unless the field was originally defined with that attribute.

The behavior of the REDEFINE command changed in Version 5.1. Prior to Version 5.1, when you redefined an invisible field with options that added a new index, such as KEY, NUMERIC RANGE, or ORDERED, the redefinition for the field was accepted. However, the new index was not actually built (and could not be because the field was invisible). Now, if you redefine an invisible field with options that specify a new index for the field, the redefinition is rejected with the following message:

M204.0411: CONFLICTING ATTRIBUTES: INVISIBLE FIELD WITH NEW INDEX

Exception: The following exception applies: in the case where no records have ever been stored in the file, and that case only, redefining an invisible field can specify options that add a new index for the field.

The behavior of the REDEFINE command does not change when used with invisible fields and options that do not add a new index for the field.

Update units

When it processes REDEFINE, Model 204 ends any update unit in progress and begins a non-backoutable update unit.

Redefining Large Object fields

You can redefine a Large Object field, if the file is empty and you specify that the that the field is (BLOB NCLOB) or (CLOB NBLOB). For example, the following statement is unsuccessful:

REDEFINE FLD_LOB (BLOB) *** 2 M204.0411: CONFLICTING ATTRIBUTES: BLOB AND CLOB

However, the following statement is successful:

REDEFINE FLD_LOB (BLOB NCLOB)

Furthermore, you can redefine a field as a Large Object field, if no data has been entered in the field. For example, the following statements are unsuccessful:

REDEFINE FLD_LOB (BLOB NCLOB) *** 2 M204.0411: CONFLICTING ATTRIBUTES: FILE NOT EMPTY REDEFINE FLD_LOB (KEY NCLOB) *** 2 M204.0411: CONFLICTING ATTRIBUTES: FILE NOT EMPTY