I use below lines to execute a perlcommand in a macro
%let perlcommand="/home/diham/test.pl read";
filename myfh pipe "&perlcommand";
During the first iteration it executes correctly and myfh is assigned. My PROC SQL after that fails, as the tabe is already existing and this is expected.
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.
Next step in my code is to again call the above macro and run a select query. But this time the command is not getting executed.
%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;
Can someone help me here. Thanks!