![]() | ![]() | ![]() | ![]() | ![]() |
/* This code creates a macro variable, using SQL, that contains */
/* a quoted string to be used later within a WHERE clause using */
/* the IN operator. */
data one;
input empl $;
datalines;
12345
67890
45678
00001
98765
;
proc sql noprint;
select quote(trim(left(empl)))
into :list separated by ' '
from one;
quit;
data master;
input empl $ job $;
datalines;
12345 clerk
34567 rep
00001 analyst
;
proc print data=master;
where empl in(&list);
run;Obs empl job 1 12345 clerk 3 00001 analyst
| Type: | Sample |
| Topic: | SAS Reference ==> Macro |
| Date Modified: | 2008-05-29 11:16:04 |
| Date Created: | 2005-09-06 13:21:27 |
| Product Family | Product | Host | SAS Release | |
| Starting | Ending | |||
| SAS System | Base SAS | All | n/a | n/a |





