sreformat

sreformat


sort-label Index Level ss
Syntax sreformat file.reference {sellist} {itemlist} {outlist} {seqlist} {modlist} {options}
filename:{destination-file | tape }
Category Access
Type Verb
Description moves the sorted values from the attributes specified in the Access sentence and places them either in another file or to tape in the order of the specified sort key(s) (specified in "seqlist").

Each entry in the outlist becomes an attribute in the destination item, in the same order as in the outlist. The source item-id is selected first and becomes the destination item-id, unless "id-supp" (or an "i" option) is specified. In this case, the first attribute value becomes the new item-id.

Upon execution of this command, the prompt, "file name:", appears on the screen. Either a file.reference may be entered, which directs the output to the specified file.reference, or the literal, "tape", which directs the output to the attached magnetic tape.

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

The attributes are written to the new file or tape in the order they are selected.

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 item list 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.

The item-ids are printed as items are not printed as the items are transferred.

A tape label, containing the file name, tape record length in hexadecimal, time, and date, is written 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 (or correlative) that refers to a selected attribute is applied before the item is written to the destination file or tape.
Options *  see "options: Access"
See Also options: modlist sellist selection criteria seqlist col-hdr-supp active list t-att tape label reformat outlist Access verbs
Example :sreformat sls by region region total amount (d
filename:temp-sales
Warnings "sreformat" to an existing item has different results in D3 than it did in R83.

If the targeted attribute is null, the new value is placed there. If the targeted attribute is non-null, on R83, the attribute is overwritten. In D3, a new value is added to the end of the attribute.  To overwrite the attribute in D3, use the "o" option.
Compatibility D3 7.0 AP R83
sort-label Index Level ss