PROC SQL noprint;
select distinct age into :agelist separated by ',' from agedataset;
quit;
The code above takes all of the ages from the data set conveniently called agedataset, and places them into a macro (also conveniently) called agelist. This list of ages within the macro is then separated via commas (',').
Now if I want to filter another table for only the ages within the agedataset, all I need to do is filter for ages IN &agelist and SAS will do the rest for me!
No comments:
Post a Comment