So something like this (note your datalines is incorrect for the first one - it should be a on separate line, as such your numbers are 1 short). What I do is blank the data I don't want to include, as tabulate does not use that by default:
data all_uk_ts;
input V10101 2. +1 co_nike 1. +1 co_Adidas 1. +1 co_Reebok 1. +1 co_Bat 1.;
array c co_:;
do over c;
if c=2 then c=.;
end;
datalines;
11 1 1 2 2
11 1 2 1 1
11 2 2 1 2
11 1 2 1 1
11 1 2 2 1
11 2 1 2 2
11 1 1 1 1
11 2 2 2 2
11 2 2 2 1
11 1 1 1 1
12 1 2 1 1
12 2 2 1 2
12 1 1 1 1
12 1 1 1 1
12 2 1 2 2
12 1 1 1 1
12 2 2 2 2
12 1 1 1 1
12 1 1 1 1
;
run;
proc format;
value for_ownership
1='Owners'
2='Nonowners';
value for_country
11='UK'
12='GE';
run;
proc tabulate data=all_uk_ts format=10.0;
format co_: for_ownership. v10101 for_country.;
class v10101;
var co_:;
tables co_: * (n=''),v10101; /* You could put the word owners in the label there */
run;
Its a bit of a faff, which is why I really don't like the tabulate procedure. If I was doing this table I would datastep my results, just a retained count, then transpose that up by country if needed.
... View more