CNAME

CNAME, RENAME

Top  Previous  Next

 

The CNAME command (synonym RENAME) changes the name of a file or record(s) within a file.

 

 

Format

 

CNAME old.file.name, new.file.name

CNAME old.file.name TO new.file.name

 

where

old.file.nameis the current name of the file to be renamed.
new.file.nameis the new name of the file to be renamed.

 

or

 

CNAME {DICT} file.name old.record.id, new.record.id

CNAME {DICT} file.name old.record.id TO new.record.id

 

where

file.nameis the name of the file containing the record(s) to be renamed. The optional DICT prefix specifies that the dictionary portion of the file is to be processed.
old.record.idis the current name of the record to be renamed.
new.record.idis the new name for the renamed record.

 

 

Used with two file names, the CNAME command renames old.file.name to new.file.name. The VOC record defining the file is renamed. The underlying operating system directories representing the data file and the dictionary are also renamed if they are the default names and the new names are acceptable operating system directory names. Where the directory names are not the defaults, as would be the case for a file created with the PATHNAME option of the CREATE.FILE command, the directory can be renamed separately using operating system commands but the VOC entry must be manually edited to match this change.

 

 

Used with a single file name and two record names, the CNAME command renames a record within the file. In this format, multiple records may be renamed in a single command by repeating the old.record.id TO new.record.id component of the command.

 

 

The command

CNAME VOC OLD.NAME TO NEW.NAME

is equivalent to

CNAME OLD.NAME TO NEW.NAME

except that the directory will not be renamed at the operating system level.

 

 

Examples

 

CNAME CUST.FILE A7194 TO A7149

 

This command renames record A7194 of file CUST.FILE to A7149.

 

 

CNAME STOCK, INVENTORY

 

This command renames the STOCK file to INVENTORY. The VOC record defining the file is renamed. The underlying operating system directories representing the data file and the dictionary are also renamed if they are the default names and the new names are acceptable operating system directory names.

 

 

CNAME STOCK A8135,A008135 D4923,D004923

 

This command renames two data records within the STOCK file.