ROOT

Top  Previous  Next

 

The ROOT statement transforms a filename and index name into a form that can be used with the KEY statement when scanning an alternate key index.

 

 

Format

 

ROOT filename, index TO scan.var

{THEN statement(s)}

{ELSE statement(s)}

 

where

 

filenameis the name of the file for which the index is to be scanned.

 

indexidentifies the index to be scanned.

 

scan.varis a data collection variable returned by the ROOT statement for use in the KEY statement. Applications should make no assumptions about the content of this variable as it may change in future releases.

 

 

The index may be the name of an alternate key index or an A-correlative expression. In the latter case, the ROOT statement looks for an index that is constructed from this expression

 

At least one of the THEN and ELSE clauses must be present. The THEN clause will be executed if the action is successful. The ELSE clause will be executed if the action fails. Use of the STATUS() function will return the error code.

 

See the KEY statement for an example of usage.

 

 

 

See also:

Alternate key indices, KEY, SETLEFT, SELECTRIGHT