using where in sas macro when subsetting dataset -


i'm trying use in macro when subsetting dataset

     option mprint mlogic;       %macro subset_by_make (dsn, make);         data temp;             set &dsn(where = (make = &make));     run;     %mend subset_by_make;     %subset_by_make(sashelp.cars, acura); 

but i'm getting error variable acura not on file sashelp.cars

how proceed/ maggie

you need make sure macro generates valid sas syntax. in case did not include quotes around string literal, sas interpreted string acura generated macro variable name.

%macro subset_by_make (dsn, make);   data temp;     set &dsn(where = (make = "&make"));   run; %mend subset_by_make; 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -