Hi Tom, Many thanks for your quick reponse. I try to give more details I´ve made this simplified version (the goal program perform different task, I´ve tried to make an example easier) of goal.sas and I put into the macro, the objective is from example dataset use the variables to filter one different dataset and then append to one which contain the data validated. I understand your approach but I´m doing something wrong defining the macro (I´m not a user of macro language) %macro goal(code); CREATE TABLE Append_dataset AS SELECT Global.*, FROM SAS.Global WHERE Global.Code = "&CODE"; QUIT; proc append base=SAS.Global_ok data=Append_dataset force; run; %mend ; Could you kindly check what it´s wrong with the syntax? P.S It´s possible to achieve the same solution using this approach+ another piece of code? proc sql noprint;
select code into :varname1- from example;
%let nrows=&sqlobs;
quit; Thanks for your help!
... View more