Skip to Main Content
Statistical Programming in SAS
book

Statistical Programming in SAS

by John Bailer
April 2015
Intermediate to advanced content levelIntermediate to advanced
460 pages
14h 45m
English
SAS Institute
Content preview from Statistical Programming in SAS
332 Statistical Programming in SAS
Display 9.4 Expanding a single record into multiple records
data D6;
input name $ sex $ t1 t2 t3 t4 t5 time6 time_7;
ARRAY num_array{*} _NUMERIC_;
DO inum = 1 to dim(num_array);
time = inum;
ADL = num_array{inum};
output;
END;
keep name sex time ADL;
datalines;
Smith M 6 6 5 5 5 4 3
Jones F 7 5 4 4 3 2 1
Fisher M 5 5 5 3 2 2 1
;
run;
The array statement collects all of the numeric variables. The dim function returns the
length of this array (=7 in this example). The time variable is defined in the loop, and
the ADL variable is defined in terms of each array element. The results of this iterative ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Elementary Statistics Using SAS

Elementary Statistics Using SAS

Sandra D. Schlotzhauer

Publisher Resources

ISBN: 9781607645047