Extract data

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 14
Accepted Solution

Extract data

I have 500 variables in my datasets and I wish to extract  10variables for my analysis , If anyone have an idea how do I extracts 10variables from 500variables .

I have used Proc sort and proc MI and specified my 10 variables but i couldn't

Help!!!!:smileyconfused:


Accepted Solutions
Solution
‎02-20-2014 10:26 AM
Super User
Posts: 19,771

Re: Extract data

Keep Statement.

Data want (KEEP=var1 var2 var3 var4...var10);

set have;

run;

View solution in original post


All Replies
Solution
‎02-20-2014 10:26 AM
Super User
Posts: 19,771

Re: Extract data

Keep Statement.

Data want (KEEP=var1 var2 var3 var4...var10);

set have;

run;

Respected Advisor
Posts: 3,799

Re: Extract data

Would it be more efficient to put the KEEP data set option on the SET statement?

Contributor
Posts: 22

Re: Extract data

You can try using Keep statement.

data final;

set input; /* which has 500 variables.*/;

keep a b c d; /* a,b,c,d are the variables which you want */

run;

hope this helps.

Occasional Contributor
Posts: 14

Re: Extract data

thank you guys !!!!! Smiley Happy

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 294 views
  • 3 likes
  • 4 in conversation