[程式] sas merge問題

看板Statistics作者 (朝右邊鋒邁進)時間15年前 (2010/12/05 23:26), 編輯推噓2(2010)
留言12則, 4人參與, 最新討論串1/4 (看更多)
各位好 我在使用sas程式時, 有製造出了n個暫時資料, 資料名稱分別為 output_temp1,output_temp2,....,output_tempn. n為多少呢我則是用sql的方式來抓. eg: proc sql noprint; select count(*) into :n from report; quit; 現在我想將此n個暫時的資料夾merge起來卻發生錯誤.(每個資料夾都sort過了) data matrix; merge output_temp1-output_temp&n; by temp; run; 感謝各位!! -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 60.250.86.244

12/05 23:28, , 1F
我想append應該可以做, 可是我還是想知道怎麼做merge
12/05 23:28, 1F

12/06 00:29, , 2F
merge後面接的是datasets, 不要跟variable lists混為一談
12/06 00:29, 2F

12/06 00:30, , 3F
我記得merge那行不能這樣寫 會出錯
12/06 00:30, 3F

12/06 00:31, , 4F
試看看這樣 data matrix; %do i=1 to &n;
12/06 00:31, 4F

12/06 00:31, , 5F
merge output_temp&i; by temp; run;
12/06 00:31, 5F

12/06 00:32, , 6F
上面run;前面我忘了加end; 請自行加入
12/06 00:32, 6F

12/06 00:32, , 7F
^% 年紀大了忘東忘西...
12/06 00:32, 7F

12/06 10:57, , 8F
你的into寫法是進入macro字串動作 不是merge
12/06 10:57, 8F

12/06 10:58, , 9F
印象是寫在from 那邊
12/06 10:58, 9F

12/06 11:01, , 10F
Orz 記錯 上述自爆
12/06 11:01, 10F

12/06 11:02, , 11F
count裡面若指定特定變項 試試看
12/06 11:02, 11F

12/06 14:51, , 12F
謝謝各位!
12/06 14:51, 12F
文章代碼(AID): #1C-wy-5s (Statistics)
文章代碼(AID): #1C-wy-5s (Statistics)