access.reformat Verb: Access/Access: Verbs


Command access.reformat Verb: Access/Access: Verbs
Applicable release versions: AP, R83
Category Access: Verbs (152)
Description takes values from the attributes specified in the command and places them either in another file or to magnetic media in the order in which they are presented.

The specific items to be selected are included in the "itemlist".

If no "itemlist" is specified, all items in the file are selected in order by the group into which they hash, and within groups, in the order they were added to the file. The items are written to the new file or tape in the order in which they are selected.

The output specifications indicate those attributes that are to be selected.

The source item-id is selected first and becomes the destination item-id unless id-supp is specified. In that case, the first attribute value becomes the new item-id. Subsequent attributes are placed in the new item in the order they are specified.

"reformat" requests the destination file.reference. To send the output to a file, enter the file.reference. To send the output to magnetic tape, enter the word "tape". To write the output back onto the source file, press <return> or <enter>.

If the items are to be written back to the source file, an itemlist must be specified or a list must be active, otherwise, an infinite loop condition may result, in which items are continually added to the file!

When a file is reformatted to tape, the values are concatenated and either truncated or padded at the end with nulls (hexadecimal 00) to the record length specified by the most recently executed "t-att" verb. One tape record is written for each item.

item-ids are printed as items are dumped, unless the "id-supp" connective, or "i" option, is specified.

A tape label, which contains the file.reference, tape record length in hexadecimal, time, and date, is written on the tape first, unless the "hdr-supp" or "col-hdr-supp" connectives ("h" or "c" options) are specified. Two end-of-file (EOF) marks terminate the tape.

Any processing code that refers to a selected attribute is applied before the item is written to the new file or tape.
Syntax reformat file.reference {sellist} {itemlist} outlist {modlist}
filename:destination-file or tape<return>
Options see "options: Access (Access: Verbs)"
reformat entity a0 name phone
File Name   :? entity-new

This takes all items from the "entity" file and writes them to the 
"entity-new" file, using the temporary attribute-defining item 
reference of "a0" to use the same item-id's in both files. The 
data in "entity-new" will contain the "name" in attribute 
one and the "phone" number in attribute two.
Related access.options