Tuesday, December 7, 2010

jBase Query Language REFORMAT

REFORMAT is similar to the LIST Command in that it generates a formatted list of fields, but its output is directed to another file or the magnetic tape rather than to the terminal or printer.

Command Syntax

REFORMAT file-specifier {record-list} {selection-criteria} {USING file-specifier} {output-specification} {format-specification} {(options}

Prompt

At the prompt, supply the destination file:

File: Enter a file name, or the word “TAPE” for output to a magnetic tape.
Comments: Overwrites records that already exist in the destination file; when you reformat one file into another, each selected record becomes a record in the new file. It uses the first value specified in the output specification clause as the key for the new records. The remaining values in the output specification clause become fields in the new records.
When you reformat a file to tape, it concatenates the values specified in the output specification clause to form one tape record for each selected record. The record output is truncated or padded at the end with nulls (X”00”) to obtain a record the same length as specified when the tape was assigned by the T-ATT Command.
Unless you specify HDR-SUPP or COL-HDR-SUPP, or a C or H option, a tape label containing the file name, tape record length (in hexadecimal), it will write the time, and date to the tape. If specifying a HEADING clause, this will form the data for the tape label.
Unless the ID-SUPP modifier or the 'I' option is specified record keys are displayed as the records are written to tape.
Two EOF marks terminate the file on tape.

See also the SREFORMAT Command.

Example

REFORMAT SALES C.CODE NAME ADDRESS 
FILE: ADDRESS
Creates new records in the ADDRESS file, keyed on C.CODE from the SALES file. Each record contains two fields, one with the values from the NAME field and one with the values from the ADDRESS field.

0 comments:

Post a Comment

 

Blog Info

A Pakistani Website by Originative Systems

Total Pageviews

Tutorial Jinni Copyright © 2015 WoodMag is Modified by Originative Systems