put only the create table statement in the macro Make and break the connection outside the macro, like: %macro _input (table=, input=); CREATE TABLE website.&table. AS SELECT * FROM CONNECTION TO xxxx (&input.); %mend; PROC SQL; CONNECT TO xxxx as xxxx (NOPROMPT= "DSN=xxxx;SERVER=xxxx;UID=;PWD=; DATABASE=xxxx"); %input( table= xxxxxxxxxxxxxx, input= yyyyyyyyyyyyyyyyyyyyy ); %input( table= xxxxxxxxxxxxxx, input= yyyyyyyyyyyyyyyyyyyyy ); %input( table= xxxxxxxxxxxxxx, input= yyyyyyyyyyyyyyyyyyyyy ); %input( table= xxxxxxxxxxxxxx, input= yyyyyyyyyyyyyyyyyyyyy ); %input( table= xxxxxxxxxxxxxx, input= yyyyyyyyyyyyyyyyyyyyy ); %input( table= xxxxxxxxxxxxxx, input= yyyyyyyyyyyyyyyyyyyyy ); disconnect from xxxx ; QUIT;
... View more