본문 바로가기
SAS

[SAS] SQL in sas

by Aubreyy 2022. 4. 24.

1. Making table

proc sql;
create table db2 as
select * from db
quit;

 

2. create variable when certain variable containes specific words.

proc sql;
create table db2 as
select * , case when fruit like '%apple%' then 1 else 0 end as apple, 
	case when fruit like '%banana%' then 1 else 0 end as banana
from db 
quit;

'SAS' 카테고리의 다른 글

[SAS] Delete imported table/dataset  (0) 2022.04.25
[SAS] data type check  (0) 2022.04.24
[SAS] print the first 10 line of data  (0) 2022.04.24
[SAS] Import excel file (+specifying a sheet)  (0) 2022.04.22

댓글