一拆多 验证打标
data a;
input id$ aa$ bb;
cards;
3 1 da
3 2 22
1 1 123
1 2 113
2 1 22
2 2 33
;
run;
/*笨办法,按照分类标志取子表,几个分类就取几张*/
data a1;
set a;
rename aa=a1
bb=b1;
if aa="1";
run;
proc sort data=https://www.it610.com/article/a1;
by id;
run;
data a2;
set a;
rename aa=a2 bb=b2;
if aa="2";
run;
proc sort data=https://www.it610.com/article/a2;
by id;
run;
/*再merge分表*/
data aa;
merge a1 a2;
by id;
run;
/*一招搞定*/
proc sort data=https://www.it610.com/article/a;
by id ;
run;
proc transpose data=https://www.it610.com/article/a out=aaaa(drop=_:) prefix=value_;
by id;
/*主键*/
var bb;
/*需要分类的变量*/
run;
/*测试*/
data test1;
input id$ a3$;
cards;
1 123
1 2
1 244
1 455
2 22
2 2323
2 4355
3 da
3 22
;
run;
/*test2的a3用来检验,如果在aaaa总则打标y=1*/
data test2;
merge test1(in=t1)
aaaa;
by id;
if t1;
if a3=value_1 or a3=value_2 then y="1" ;
else y="0";
run;
推荐阅读
- 放屁有这三个特征的,请注意啦!这说明你的身体毒素太多
- 爱就是希望你好好活着
- 昨夜小楼听风
- 知识
- 死结。
- 我从来不做坏事
- 烦恼和幸福
- 关于QueryWrapper|关于QueryWrapper,实现MybatisPlus多表关联查询方式
- Linux下面如何查看tomcat已经使用多少线程
- 说得清,说不清