Create a data set that contains five rows of random numbers.
data numbers;
drop i j;
array a[5];
do j=1 to 5;
do i=1 to 5;
a[i] = ranuni(12345) * (i+123.234);
end;
output;
end;
run;
Create a macro to standardize a data set with a given value for mean and std.
%macro standardize;
%let dsname=%sysfunc(dequote(&dsname));
%let colname=%sysfunc(dequote(&colname));
proc standard data=&dsname mean=&MEAN std=&STD out=_out;
var &colname;
run;
data &dsname;
set_out;
run;
%mend standardize;
Use the FCMP function to call WRITE_ARRAY, which writes the data to a data set.
Call RUN_MACRO to standardize the data in the data set. Call WRITE_ARRAY to
write data to a data ...
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.