knowledge-database (beta)

Current group: comp.soft-sys.sas

how to create a new dataset deduct from a old data set

how to create a new dataset deduct from a old data set  
Kingfisher
 Re: how to create a new dataset deduct from a old data set  
xiangyang.ye at gmail.com
From:Kingfisher
Subject:how to create a new dataset deduct from a old data set
Date:Sat, 22 Jan 2005 09:03:29 +0800
I have a question of how to create a new dataset deduct from a old data set
If I have a original dataset :
id dx case
1 a 4
2 b 5
3 c 6
4 a 1
5 c 3
6 b 3

Now, I want to delete part of the data which contain the feature :
id dx
1 a
4 a
6 b

How can I do that ? I am expecting a new dataset which looks like:
id dx case
2 b 5
3 c 6
5 c 3

Please remember this is just a sample. I am actually managing a huge
dataset. Do tell me just delete those id=1 ro 4 or 6.
Thanks for any help.
From:xiangyang.ye at gmail.com
Subject:Re: how to create a new dataset deduct from a old data set
Date:22 Jan 2005 18:32:57 -0800
Kingfisher,

Here is a sql method to get the desired table.

data one;
input id dx $ case ;
cards;
1 a 4
2 b 5
3 c 6
4 a 1
5 c 3
6 b 3
;
data two;
input id dx $;
cards;
1 a
4 a
6 b
;

proc sql;
create table new as select * from one;
delete from new where id in (select id from two);
quit;

proc print data=new noobs;
run;

Sean
   

Copyright © 2006 knowledge-database   -   All rights reserved