access.reformat

Verb: Access/Access: Verbs, Releases: AP and R83

Reformats data to file or tape.

Syntax

reformat file.reference {sellist} {itemlist} outlist {modlist} filename:destination-file or tape<return>

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.

Options

see 'options: Access (Access: Verbs)'

Example

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.

See Also

Command Name Type Description
access.options Definition Standard options: b,c,d,h,i,j,k,n,p,r,s,u,y
access.itemlist Definition Defines a specific list of item-ids.
access.outlist Definition Defines list of attributes to output.
access.modifiers.modlist Definition Defines list of modifiers.
access.sreformat Verb: Access Reformats data in sorted order to file or tape.
access.col-hdr-supp Modifier suppresses column and page headings on Access reports.
tcl.t-att Verb: Access Attaches magnetic media unit to current process.
access.verbs Definition General form of Access sentences.

User Comments

What do you think?

Share your experience or ask a question by using the form below.

Login to leave your comments.