以下の行を使用して、マクロで perlcommand を実行します
%let perlcommand="/home/diham/test.pl read";
filename myfh pipe "&perlcommand";
最初の繰り返しでは正しく実行され、myfh が割り当てられます。テーブルが既に存在し、これが予想されるため、その後の私の PROC SQL は失敗します。
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;
誰かがここで私を助けてくれますか。ありがとう!