| Date: | Fri, 22 Aug 2008 13:36:06 -0700 |
| Reply-To: | Lauren <maillauren@GMAIL.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Lauren <maillauren@GMAIL.COM> |
| Organization: | http://groups.google.com |
| Subject: | subsetting data with a macro? |
|
| Content-Type: | text/plain; charset=ISO-8859-1 |
Does anyone know how to use an array or a macro to subset data?
I have 4 datasets to join:
a_2003 a_2004 a_2005 a_2006
and I have 10 consecutive variables in each dataset, the 1st variable
is called 'dgiar' the 10th is 'dshig'. I want to create 10 new
datasets, each containing records for all four years but only if each
of the ten variables is '1'. So the first new dataset will be called
dgiar_new and contain only records from all four years where diar=1.
Then I need to repeat that nine times for the other nine variables. Is
there a way to use the variable names like you would a number in a do
loop?
Not sure if this is clear enough to evoke any help... Thanks in
advance.
|