- data a;
- x=1;output;
- x=2;output;
- x=3;output;
- x=4;output;
- x=5;output;
- x=3;output;
- x=5;output;
- x=7;output;
- x=2;output;
- x=1;output;
- x=3;output;
- x=8;output;
- x=7;output;
- x=4;output;
- x=3;output;
- x=5;output;
- x=4;output;
- x=3;output;
- x=1;output;
- x=5;output;
- x=8;output;
- x=9;output;
- x=22;output;
- x=33;output;
- x=32;output;
- x=43;output;
- x=56;output;
- x=44;output;
- x=6;output;
- x=9;output;
- x=13;output;
- x=15;output;
- x=17;output;
- x=15;output;
- x=15;output;
- x=14;output;
- x=13;output;
- x=12;output;
- x=12;output;
- x=10;output;
- run;
- data b1(keep=i x) b2(keep=i x rename=(x=x_));
- set a;
- do i=1 to 99;
- if _n_=10*i then output b1;
- if _n_=5*(2*i-1) then output b2;
- end;
- run;
- data want;
- merge b1 b2;
- by i;
- if n(x,x_)=2 then av_x=(x+x_)/2;
- run;
- proc sql noprint;
- create table c as select avg(av_x) as avg from want where av_x ne .;
- quit;