Hi,
I am actually learning SAS by myself. Can you please help me in creating a macro for this program using infile function instead of using the datalines.
Data file will have the following data. Strore it as problem1.txt
0 1 1 0 -2 6 7 7 4 -3 9 14
Write a macro and store it to compute the sum for the following program
The SAS program without macro goes here.
/* Fisher Randomization test */
Thank you so much in advance.
I am actually learning SAS by myself. Can you please help me in creating a macro for this program using infile function instead of using the datalines.
Data file will have the following data. Strore it as problem1.txt
0 1 1 0 -2 6 7 7 4 -3 9 14
Write a macro and store it to compute the sum for the following program
The SAS program without macro goes here.
/* Fisher Randomization test */
Code:
option ls=78;
data xx;
input y1-y12;
array ss(*) y1-y12;
m=4; nn=12;
do n1=1 to nn-m+1;
do n2=n1+1 to nn-m+2;
do n3=n2+1 to nn-m+3;
do n4=n3+1 to nn-m+4;
do n5=n4+1 to nn-m+5;
sum=ss(n1)+ss(n2)+ss(n3)+ss(n4)+ss(n5);
if sum <=0 then t=1; else t=0;
output;
end; end; end; end; end;
datalines;
0 1 1 0 -2 6 7 7 4 -3 9 14
run;
/* The main objective is instead of using datalines here, store the data in a file and use infile keyword */
proc univariate noprint;
var t;
output out=temp n=nn sum=tt;
data xx;
set temp;
pp=tt*2/nn;
proc print data=xx;
var tt pp;
run;