In reply to Leonid Batkhan.

Dear Leonid,
thank you very much for the post and the code. I tried to adapt it to three dimentional dataset - simply by adding a third character variable - sex (M-male,F- female). The parts of code which in my opinion needed to be modified are the following:
- three new macro variables:
- additional variable format definition:
- proc report in column statement and in define statement;
- proc means in format and class statement;
- data _null_ datastep defining number of columns of the proc report result;
- %macro supppress:
a) one more parameter is needed: %macro suppress(in,supclass1,supclass2,out);
b) in proc sort in by statement: by &supclass1 &supclass2 count;
c) in by grouping processing of data &out datastep in by statement: by &supclass1 &supclass2 count;
- % macro iterate_suppresion by adding class3= parameter and defining two nextclass1 and nextclass2 macrovariables.

In fact one can get different results based on the order of variables defining dimensions of the data. I am wondering if it is possible to somehowe optimize the results to point out "the best" solution. One approach could be based on the minimizing the sum of counts suppressed by different order of variables used in the procedure. But the other could be based on the minimizing the number of cells suppressed. Do you have any suggestions in the matter? Thank you very much. Best regards, Tomasz