Hi Folks, I cannot get my mind around an issue I am having with a call of a macro var within a %sysexec -statement. I am executing several shell commands within one %sysexec - statement. Now, I'd like to loop this statement by using a macrovar in the "SELECT * FROM &TABLE" - part. However, every time I execute this statement I do not get any error message, but there is nothing being written to the "test.txt" file either. (<ssh credentials> and <mysql credentials> is not the problem). I executed this step by replacing the &TABLE-macrovar with the real table name (i.e. "testtable") and it worked just fine. I am pretty sure, it has got to do with masking/unmasking the macrovar. Can someone help me out with this issue? I tried using %sysfunc(symget("TABLE")), but the symget function is not allowed with %sysfunc..... One problem could be, that the mysql - statement is in single quotes. But unfortunatelly, I cannot replace them with double quots, because then, the shell statement does not work anymore. %LET TABLE = testtable;
%MACRO get_data_from_mysql;
%sysexec %str(ssh <SSH credentials>
'mysql <mysql credentials> -e
"USE <schema>; SELECT * FROM &TABLE. ";'
> /path/to/my/folder/test.txt)
;
%mend;
%get_data_from_mysql; Thanks, FK1
... View more