It works! THANK YOU SO MUCH!!
That saves me hours!!!
DMP wrote:
I want only the frequency of value "c" occuring in all 4 vb. (A,B,C,D) in the output. how can I do this?
Thank you!
You put an OR in your code, assuming you want A=B=C=D you want an AND in your where clause instead.
Maybe this is closer to what you want :
data test;
length A B C D $1;
input (A B C D) ($1.) @@;
if cmiss(A,B,C,D)=0;
datalines;
abcdedbbcdeabcedeacbdeaceccabedaddea
;
ods select none;
proc freq data=test;
table A B C D;
ods output OneWayfreqs=owf;
run;
ods select all;
data cFreq;
keep var frequency;
set owf;
if cats(of f_:)="c";
var = substr(table,7);
run;
proc print data=cfreq; run;
PG
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.