2013-01-04 100 views
1

下面的代碼有一個錯誤消息,我正在努力嘗試弄清楚它。錯誤消息是:「未命名Libname HDMAPP」。架構未分配?

感謝您的幫助提前!

%let tmpschema = HDMAPP;  *schema for transient tables, test-HDMAPP, prod-HDMAPP; 
%let userid = &uid;   *data mart user; 
%let password = &pw;   *data mart password; 
%let memschema = HDMTST;   *schema for member tables; 
%let datasrc = PHEDISRP;  *odbc data source to connect to db2; 

proc sql; 
connect to odbc as HDMconnect (datasrc=&datasrc user=&userid password=&password); 
    create table &tmpschema..testmp as 
    select * from connection to HDMconnect 
    (select * from HDMPRD.MEMBER_CMPL); 
disconnect from HDMconnect; 
quit; 

回答

1

錯誤消息意味着你沒有SAS庫引用的名稱HDMAPP定義(「邏輯庫引用名」)。

create table &tmpschema..testmp as 

如果你想創建一個SAS數據集,你應該有這樣的語句proc sql步驟之前:因爲那是你的宏變量tmpschema的價值,它是由這條線在你的程序造成的:

libname HDMAPP 'path-to-local-file-system'; 
+0

「Libname HDMAPP未分配」錯誤的原因是我們需要在創建新表之前爲新表&tmpschema..testmp分配內存。 – user1238178