Is there any option to define multiple dataset in proc freq data = ? statement.
Ex:- Suppose I have three dataset data1 , data2, data3 and have variable called sales_date (common in all three dataset). I want to have freq of sales_date on all three dataset.
Instead of writing a macro, do we have any option like :
- proc freq data = data1 data2 data3 ; tables sales_date/list missing;run;
macro solution:-
%macro freq(indsn,var_name);
Proc frea data = &indsn.;
tables &var_name./list missing;
run;
%mend;
%freq(data1,sales_date);
%freq(data2,sales_date);
%freq(data3,sales_date);
2) and is there any way to compare freq of sales_date across all three dataset without mergeing or creating new dataset with rename of sales_date. by variable could be store_id and want to compare sales_date across all thre dataset. store_id is unique.
proc freq data = mergedataset; (mergerdataset is merge of data1,data2, data3 on store_id and rename sales_date to sales_date1,2,3)
tables sales_date1*sales_date2*sales_date3/list misisng;
run;
so instead of above , is there any shortcut to compare it .
Thanks,
... View more