[程式] 請問SAS的大量資料垂直合併。

看板Statistics作者 (啞巴羅傑)時間10年前 (2015/03/17 14:38), 10年前編輯推噓1(104)
留言5則, 2人參與, 最新討論串1/1
因為需要垂直合併大量資料, 請問各位先進以下語法是哪裡寫錯。 Libname DefDD "G:\Deficiency\ICD\DefDD"; %macro DefDD1klmn; %do klmn=1996 %to 2011; %do i= 1 %to 9 proc data=DefDD.defr0&i._dd&klmn.; out = DefDD.DefDD1&klmn.; replace; quit; proc append base=final data=DefDD.DefDD1&klmn.; quit; %end; %end; %mend; %DefDD1klmn; Log顯示出: WARNING: Apparent symbolic reference I not resolved. ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric operand is required. The condition was: 9 proc import datafile=DefDD.defr0&i._dd&klmn. ERROR: The %TO value of the %DO I loop is invalid. ERROR: The macro DEFDD1KLMN will stop executing. 請問是哪裡寫錯??感恩。 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 114.35.218.5 ※ 文章網址: https://www.ptt.cc/bbs/Statistics/M.1426574337.A.DB9.html ※ 編輯: MuteSun (114.35.218.5), 03/17/2015 15:07:41

03/17 17:51, , 1F
分號
03/17 17:51, 1F

03/17 19:04, , 2F
proc data???
03/17 19:04, 2F

03/17 19:06, , 3F
you don't write your porcedure but sas suggest you import
03/17 19:06, 3F

03/17 19:06, , 4F
you can read your log
03/17 19:06, 4F

03/17 19:07, , 5F
and i believe you should use datafile=
03/17 19:07, 5F
文章代碼(AID): #1L1ym1sv (Statistics)