今回はDROPについて解説します。
(対比:KEEP 【SAS】KEEPはカラムの選択に使える。 | ビジネスイッチ (how-to-business.com))
/* drop_1 */
data data1;
Id1=1111; Id2=1111; Id3=1111; Id4=1111;
output;
Id1=2222; Id2=2222; Id3=2222; Id4=2222;
output;
Id1=3333; Id2=3333; Id3=3333; Id4=3333;
output;
run;
data data2; set data1;
drop Id2 Id3;
run;


- drop Id2 Id3で列を削除できる。
/* drop_2 */
data data1;
Id1=1111; Id2=1111; Id3=1111; Id4=1111;
output;
Id1=2222; Id2=2222; Id3=2222; Id4=2222;
output;
Id1=3333; Id2=3333; Id3=3333; Id4=3333;
output;
run;
data data2(drop=Id2 Id3); set data1;
run;


- (drop=Id2 Id3)で列を削除できる。