data student1 student2; /*创建新的数据集student1和student2用于存放拆分后的数据*/
set sashelp.class;
IF sex=’男’ THEN OUTPUT student1; /*拆分性别为男的到数据集student1*/
IF sex=’女’ THEN OUTPUT student2; /*拆分性别为女的到数据集student2*/
run;
proc print data=student1; /*输出窗口打印出数据集student1*/
run;
proc print data=student2; /*输出窗口打印出数据集student2*/
run;