Hello, i dont know how to proceed on this. data work.test; length result $100 conv $100; result = ""; conv = ""; run; %macro run; /* here i build some dynamic sql*/ %do i=1 %to 10; %let query = Select %scan(&name.,&i) as %scan(&name.,&i) from maps.%scan(&table.,&i) where color = 'blue'; %let tmp_name = %scan(&name,&i.); /*and now the strange part*/ proc sql outobs=1; insert into work.test (result,conv) values ("&query", "tmp_name"); /* so this work and i got as the result result conv SELECT COMMENT1 from maps.XY where color ... COMMENT1 SELECT Dell from maps.XY where and so on DELL But i want the result from the dynamic sql, like: result conv Santa Barb COMMENT1 Sakassuro DELL With proc sql outobs=1; insert into work.test (result) (&query); i get the correct data: result Santa Barb Sakassuro But if i want to add some more columns, i need to add the quotation marks in combination with values and i cant get by that. I have tried many options, even with a new dataset and so on, but i cant get it solved.
... View more