我使用下面的行在宏中执行 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;
有人可以在这里帮助我。谢谢!