Help using Base SAS procedures

How to apply a command to all but a few variables?

Accepted Solution Solved
Reply
Contributor
Posts: 67
Accepted Solution

How to apply a command to all but a few variables?

Hello,

I'm trying to run proc corr on all but a few variables. Most of my variables are numeric (well, they weren't before, but I just converted from character to numeric), so I wanted to run:

proc corr data=h.april17;

var _all_ ;

run;

But when I run this, My log gives me this:

ERROR: Variable EX_COM in list does not match type prescribed for this list.

ERROR: Variable EX_OTR in list does not match type prescribed for this list.

ERROR: Variable organization in list does not match type prescribed for this list.

ERROR: Variable site_name in list does not match type prescribed for this list.

ERROR: Variable othocc in list does not match type prescribed for this list.

ERROR: Variable Q12 in list does not match type prescribed for this list.

ERROR: Variable Q13 in list does not match type prescribed for this list.

ERROR: Variable Q69g in list does not match type prescribed for this list.

How can I run this proc corr on all my variables except for the above 8 variables?

Thanks,

Gina


Accepted Solutions
Solution
‎04-18-2012 02:54 AM
Super User
Posts: 10,020

Re: How to apply a command to all but a few variables?

How about :

proc corr data=h.april17;

var _numeric_ ;

run;

Which includes all of your numeric variables.

Ksharp

View solution in original post


All Replies
Solution
‎04-18-2012 02:54 AM
Super User
Posts: 10,020

Re: How to apply a command to all but a few variables?

How about :

proc corr data=h.april17;

var _numeric_ ;

run;

Which includes all of your numeric variables.

Ksharp

Contributor
Posts: 67

Re: How to apply a command to all but a few variables?

thank you!!!!!!! that's what i was looking for Smiley Happy Unfortunately I have a lot of numeric variables so it's not easy to read haha.

🔒 This topic is solved and locked.

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

Discussion stats
  • 2 replies
  • 346 views
  • 0 likes
  • 2 in conversation