DATA Subcommand (REPEATING DATA command)

DATA specifies a name, location within each repeating segment, and format for each variable to be read from the repeating groups. DATA is required and must be the last subcommand on REPEATING DATA.

  • The specifications for DATA are the same as for the DATA LIST command.
  • The specified location of the variables on DATA is their location within each repeating group—not their location within the record.
  • Any input format available on the DATA LIST command can be specified on the DATA subcommand. Both FORTRAN-like and the column-style specifications can be used.

Example

INPUT PROGRAM.
DATA LIST FILE=VEHICLE / SEQNUM 2-4 NUMPERS 6-7 NUMVEH 9-10.
REPEATING DATA STARTS=12 /OCCURS=NUMVEH
 /DATA=MAKE 1-8 (A) MODEL 9 (A) NUMCYL 10.
END INPUT PROGRAM.
LIST.
  • Variable MAKE is a string variable read from positions 1 through 8 of each repeating group; MODEL is a single-character string variable read from position 9; and NUMCYL is a one-digit numeric variable read from position 10.
  • The DATA LIST command defines variables SEQNUM, NUMPERS, and NUMVEH. These variables are spread to each output case built from the repeating groups.