, 또는 네이티브 SAS)를 사용하여 변수 이름과 유형을 저장합니다.
그런 다음이 데이터 사전에서 변수 목록을 만들어 변수를 분리 할 수 있습니다.
다음, 당신은 엑셀 "c:\mydata\data_dictionary.xlsx"
파일이 상상 : 당신은 물론 두 데이터 세트에 (즉 무엇이든) 귀하의 ID 변수를 계속 확인해야
proc import file="c:\mydata\data_dictionary.xlsx"
out=datadict dbms=xlsx replace; *or dbms=excel or excelcs depending on your installation and version;
sheet="datadict_sheet";
run;
proc sql;
select colname
into :cat_var_list separated by ' '
from datadict
where coltype = 'Categorical'
;
select colname
into :cont_var_list separated by ' '
from datadict
where coltype = 'Continuous'
;
quit;
data cat_vars(keep=&cat_var_list. idvar) cont_vars(keep=&cont_var_list. idvar);
set yourdata;
run;
.
출처
2016-12-19 16:11:52
Joe
예제 데이터를 추가 할 수 있습니까? 또는 변수에 대한 자세한 정보? 즉 그들은 모두 숫자이며, 범주 적 변수는 모든 문자 등입니다. –
AgeBand 10-20,20-30,30-40,40-50, 지불 금액 -20,30,40,50, Type-A, B, C, D – user6016731
질문에 데이터를 포함시켜 재현 할 수 있도록하는 것이 가장 좋습니다. 또한 어떤 변수를 분리하고 싶은지 확실하지 않습니다. –