直接从互联网下载数据时出错

问题描述 投票:0回答:1

我想从互联网下载一些 CSV 格式的数据并使用下面的代码

proc import datafile = 'https://raw.githubusercontent.com/sam16tyagi/Machine-Learning-techniques-in-python/master/logistic%20regression%20dataset-Social_Network_Ads.csv' out = Dat dbms = CSV;
run;

但是上面的行会生成如下错误

 1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 68         
 69         proc import datafile =
 69       ! 'https://raw.githubusercontent.com/sam16tyagi/Machine-Learning-techniques-in-python/master/logistic%20regression%20datase
 69       ! t-Social_Network_Ads.csv' out = Dat1 dbms = CSV;
 70         run;
 
 NOTE: Unable to open parameter catalog: SASUSER.PARMS.PARMS.SLIST in update mode. Temporary parameter values will be saved to 
 WORK.PARMS.PARMS.SLIST.
 ERROR: Physical file does not exist, 
 /pbr/biconfig/940/Lev1/SASApp/https://raw.githubusercontent.com/sam16tyagi/Machine-Learning-techniques-in-python/master/logistic%20r
 egression%20dataset-Social_Network_Ads.csv. 
 ERROR: Import unsuccessful.  See SAS Log for details.
 NOTE: The SAS System stopped processing this step because of errors.
 NOTE: PROCEDURE IMPORT used (Total process time):
       real time           0.02 seconds
       user cpu time       0.01 seconds
       system cpu time     0.01 seconds
       memory              8223.21k
       OS Memory           29208.00k
       Timestamp           13/07/2024 10:42:38 AM
       Step Count                        48  Switch Count  5
       Page Faults                       0
       Page Reclaims                     1172
       Page Swaps                        0
       Voluntary Context Switches        27
       Involuntary Context Switches      1
       Block Input Operations            0
       Block Output Operations           40
       
 71         
 72         OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 82         



 

您能否帮助理解为什么它失败了,正确的代码是什么?

csv sas
1个回答
0
投票

PROC IMPORT 默认情况下正在寻找本地文件,您可以从错误中看出(它在 /pbr/biconfig 内部搜索)。您可以定义一个 URL 文件名

filename github url "https://raw.githubusercontent.com/sam16tyagi/Machine-Learning-techniques-in-python/master/logistic%20regression%20dataset-Social_Network_Ads.csv";

proc import datafile=github dbms=csv out=dat;
quit;
© www.soinside.com 2019 - 2024. All rights reserved.