12-04-2013 04:20 AM
In file A, I have a column ID with many different rows of ID numbers (stored as char variables).
File B also has column ID & an extra Age column.
For all the ID in file A I want to find the ID with Age >12 in file B, how do I do so and extract them into a file?
12-04-2013 05:11 AM
It's a bit difficult to give you a valid answer without you posting some representative sample data (2 data steps creating such data) and then telling us how the expected result should look like.
Here the recommendation of how to ask questions: https://communities.sas.com/docs/DOC-2263
Below some untested "pseudo code" which might or might not be what you're after.
create table want as
from TableA a, TableB b
where a.id=b.id and b.age>12
12-04-2013 10:51 AM
(select * from TableB where age>12) as b
instead as the where with the 'and' will limit the output of the TableA ids to only those as over age 12. Depends on how you meant 'all the ID in table A' to be interpretted.