Overview (REREAD command)
REREAD instructs
the program to reread a record in the data. It is available only within
an INPUT PROGRAM structure and
is generally used to define data using information obtained from a
previous reading of the record. REREAD is usually specified within a conditional structure, such as DO IF—END IF, and is followed by
a DATA LIST command. When it
receives control for a case, REREAD places the pointer back to the column specified for the current
case and begins reading data as defined by the DATA LIST command that follows.
Options
Data Source. You can use inline data
or data from an external file specified on the FILE subcommand. Using external files allows you to open
multiple files and merge data.
Beginning Column. You can specify a beginning
column other than column 1 using the COLUMN subcommand.
Basic Specification
The basic
specification is the command keyword REREAD. The program rereads the current case according to the data definitions
specified on the following DATA LIST.
Subcommand Order
Subcommands can be specified in any order.
Syntax Rules
-
REREADis available only within anINPUT PROGRAMstructure. - Multiple
REREADcommands can be used within the input program. Each must be followed by an associatedDATA LISTcommand.
Operations
-
REREADcauses the nextDATA LISTcommand to reread the most recently processed record in the specified file. - When it receives
control for a case,
REREADplaces the pointer back to column 1 for the current case and begins reading data as defined by theDATA LISTthat follows. If theCOLUMNsubcommand is specified, the pointer begins reading in the specified column and uses it as column 1 for data definition. -
REREADcan be used to read part of a record inFIXEDformat and the remainder inLISTformat. MixingFIXEDandFREEformats yields unpredictable results. - Multiple
REREADcommands specified without an interveningDATA LISTdo not have a cumulative effect. All but the last are ignored.