how to count variables

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 102
Accepted Solution

how to count variables

Hi i wonder if sas can do the same as excel.


is there something like: count(var1, var2,......var29) in SAS that spits out 29, for example??


Accepted Solutions
Solution
‎03-15-2015 04:25 PM
Frequent Contributor
Posts: 115

Re: how to count variables

data yourdata;

set yourdata;

array arrayname1 _character_ ;

array arrayname2 _numeric_;

varcount=dim(arrayname1)+dim(arrayname2);

run;

you can also use out=contents options in proc contents, dictionary tables, sashelp library vtable, vcolumn and so on

View solution in original post


All Replies
Solution
‎03-15-2015 04:25 PM
Frequent Contributor
Posts: 115

Re: how to count variables

data yourdata;

set yourdata;

array arrayname1 _character_ ;

array arrayname2 _numeric_;

varcount=dim(arrayname1)+dim(arrayname2);

run;

you can also use out=contents options in proc contents, dictionary tables, sashelp library vtable, vcolumn and so on

Frequent Contributor
Posts: 102

Re: how to count variables

you are a big help naveen. thank you!

🔒 This topic is solved and locked.

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

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