Can anyone please help me out with below code: libname lib1 'E:\SAS Practice Starting'; Data lib1.hospital; infile datalines dlm='~' dsd; input patient:$10. hospitalname:$10. location:$8. amount; datalines; p001~lotus~hyd~3000 p002~lotus~hyd~5000 p003~rainbow~bng~2000 p004~rainbow~hyd~5000 p005~apolo~gujarat~1500 p006~apolo~gujarat~3000 p007~yasoda~mumbai~2000 p008~yasoda~mumbai~800 p009~global~hyd~5000 p0010~global~hyd~800 p002~lotus~hyd~5000 p003~rainbow~bng~2000 p005~apolo~gujarat~1500 run; but my actual problem starts in below program i cant able to use like this '&lib.&table' but i can able to use like this 'lib1.&table'. But i want to pass both libraryname and tablename and i want to resolve together. %macro pp(lib,table,hospitalname); PROC SQL; select sum(amount) as Amount,&hospitalname from &lib.&table /*where hospitalname='lotus'*/ group by &hospitalname; QUIT; %mend; %pp(lib1,hospital,hospitalname); %pp;
... View more