工作後我用下面的線在宏SAS PIPE不是一個失敗的SQL PROC
%let perlcommand="/home/diham/test.pl read";
filename myfh pipe "&perlcommand";
執行perlcommand在它正確執行和myfh被分配在第一次迭代。我的PROC SQL失敗後,因爲tabe已經存在,而且這是預期的。
create table dw.test_table(BULKLOAD=YES BL_DELETE_DATAFILE=YES
BL_OPTIONS='silent=(header,feedback),errors=0'
BL_SQLLDR_PATH="/opt/app/oracle/product/10.2.0.2/client/bin/sqlldr ")
as select * from dataset;
ERROR: The ORACLE table TEST_TABLE has been opened for OUTPUT. This table already exists, or there is a name conflict with an
existing object. This table will not be replaced. This engine does not support the REPLACE option.
我的代碼的下一步是再次調用上述宏並運行選擇查詢。但是這次命令沒有被執行。
%macro getCredentials (readwrite, database, acct);
/* Call the perl script and get the credentials */
%let credential = /home/diham/test.pl &readwrite &database &acct;
/*reading the material-set name and getting the credentials (username and password)*/
data _null_ ;
put "Executing getCredentials";
run;
LIBNAME DW CLEAR;
filename myfh clear;
filename myfh pipe "&credential";
data CREDS;
length username $ 20 password $ 20;
infile myfh delimiter=',' truncover;
input username $ password $;
run;
filename myfh clear;
data CREDS;
set CREDS;
call symput("username",username);
call symput("password",password);
run;
有人可以幫助我在這裏。謝謝!
/hime/- 是正確的而不是/ home /? – Joe
錯字糾正..但代碼有正確的路徑:) – diham