Did you try the call sortc? How did it not work?
Your first response indicates that you have each value in a separate variable, is this correct?
data have;
infile cards dlm=',' truncover;
informat var1-var3 $20.;
input var1 var2 var3;
cards;
No smoking, Drinking water, Alcohol
Drinking water, Alcohol, No smoking
Alcohol, Drinking water, No physical exercise
No physical exercise, Drinking water, Alcohol
;
proc print data=have;
run;
data sorted;
set have;
call sortc(var1, var2, var3);
run;
proc freq data=sorted;
table var1*var2*var3 / list;
run;
@Barney1998 wrote:
Ι have a data set which contains the options for the question (the possible answers for the question ) for example : Healthy life data: No Smoking Drinking water Alcohol
no physical exercise ... And the respondent could have chosen until 3 answers in order to specify the factors that they believe have an impact in healthy lifestyle. But if a respondent answer to this question like this No Smoking Alcohol no physical exercise And the one other like this: no physical exercise Alcohol No Smoking Particularly, they are the same answers but code recognizes them as different. That i want to achieve, that is No Smoking Alcohol no physical exercise to be taken into account as the same answer as no physical exercise Alcohol No Smoking.
... View more