Examples (NUMERIC command)
Declaring Multiple Numeric Variables
NUMERIC V1 V2 (F4.0) / V3 (F1.0).
-
NUMERIC
declares variables V1 and V2 with formatF4.0
and declares variable V3 with formatF1.0
.NUMERIC V1 TO V6 (F3.1) / V7 V10 (F6.2).
-
NUMERIC
declares variables V1, V2, V3, V4, V5, and V6 with formatF3.1
and declares variables V7 and V10 with formatF6.2
.
Specifying Variable Order in the Active Dataset
NUMERIC SCALE85 IMPACT85 SCALE86 IMPACT86 SCALE87 IMPACT87
SCALE88 IMPACT88.
- Variables SCALE85 to IMPACT88 are added to the
active dataset in the order that is specified on
NUMERIC
. The order in which they are used in transformations does not affect their order in the active dataset.INPUT PROGRAM. STRING CITY (A24). NUMERIC POP81 TO POP83 (F9)/ REV81 TO REV83(F10). DATA LIST FILE=POPDATA RECORDS=3 /1 POP81 22-30 REV81 31-40 /2 POP82 22-30 REV82 31-40 /3 POP83 22-30 REV83 31-40 /4 CITY 1-24(A). END INPUT PROGRAM.
-
STRING
andNUMERIC
are specified within an input program to predetermine variable order in the active dataset. Though data in the file are in a different order, the working file dictionary uses the order that is specified onSTRING
andNUMERIC
. Thus, CITY is the first variable in the dictionary, followed by POP81, POP82, POP83, REV81, REV82, and REV83. - Formats are specified for the variables on
NUMERIC
. Otherwise, the program uses the default numeric format (F8.2
) from theNUMERIC
command for the dictionary format, even though it uses the format onDATA LIST
to read the data. In other words, the dictionary uses the first formats specified, even thoughDATA LIST
may use different formats to read cases.