想從網(wǎng)上下載歷史水位數(shù)據(jù),比如
http://www.ctgpc.com.cn/inc/sqsk.php
從網(wǎng)上找到類似代碼:
源自本壇http://xalimeijing.com/thread-1118208-1-1.html
%let url = http://funds.money.hexun.com/fun ... 2.aspx?code=000001;
%let code = %scan(&url,2,'=');
filename raw url "&url";
data temp;
infile raw length=len lrecl=5000;
input x $varying5000.len;
run;
data temp2;
set temp;
retain code pattern_id ;
if _n_ = 1 then do;
code = &code;
pattern_id = prxparse("#(\d{4}-\d{2}-\d{2}|\d\.\d{4})</td>$#");
end;
if prxmatch(pattern_id,strip(x));
call prxposn(pattern_id,1,start,length);
y = substrn(x,start,length);
keep code y;
run;
data final;
set temp2;
retain date unit_value cum_value;
format code Z6. date yymmdd10. unit_value cum_value 8.4;
if mod(_n_,3) = 1 then date = input(y,yymmdd10.);
else if mod(_n_,3) = 2 then unit_value = input(y,8.);
else if mod(_n_,3) = 0 then do;
cum_value = input(y,8.);
output;
end;
drop y;
run;
非常感謝guoluo提供的代碼,希望guoluo能繼續(xù)解答。跪拜ing