REFORMAT

Resembles LIST in that it generates a formatted list of attributes, but its output is directed to another file rather than to the terminal or a printer.

Syntax

REFORMAT file-specifier {item-list}{selection-criteria}{USING file-specifier} {output-specification} {format-specification} {macro-call} {(options}

The custom environment option REFORMAT.IID automatically adds the item-id to the output of the REFORMAT and SREFORMAT commands, for compatibility with MultiValue. Refer to Sentence Structure for descriptions of the other parameters.

Prompt

The system displays the following prompt:

DESTINATION FILE:

You must enter a file-specifier indicating where the new items should be written.

Before you execute the REFORMAT command, check whether items already existing in the destination file have the same item-ids as those being copied, as those items will be overwritten.

Reformatting to Another File

When you reformat one file into another, the first value specified in the output specification clause is used as the item-id for the item; the remaining values in the output specification clause are attributes in the item. Each item selected becomes an item in the new file.

You can omit the explicit output specification, in which case the implicit output specification given by the file's dictionary is used. The first attribute output via the implicit output specification is used to provide the item-ids of the new items.

SREFORMAT Command

SREFORMAT functions similarly to REFORMAT but sorts items before writing to the destination file.

Example

:LIST GUESTS '355' '222' LAST-NAME CITY COUNTRY

PAGE 1                                08:33:02   03 AUG 1994
GUESTS.... LAST-NAME. CITY.......... COUNTRY...
355        Taylor     Bennington     USA
222        O'Brien    Asbury         USA
2 ITEMS LISTED.
:REFORMAT GUESTS '355' '222' LAST-NAME CITY COUNTRY

DESTINATION FILE:  NAMETEMP

2 ITEMS COPIED.
:

The REFORMAT command creates two items in file NAMETEMP:

    Taylor              O'Brien
001 Bennington 001 Asbury
002 USA 002 USA