This question is not directly related to SAS Stored Processes. For help with how to combine or manipulate data, your best bet is to read the documentation on joining SAS data sets or to contact Tech Support for help on this particular problem.
That person wanted to count people who appeared in a group and you want to do essentially the same thing.
Here's a PROC TABULATE solution that uses a SAS format to do the lookup so you don't have to code it in a MERGE. I coded the format the way I did because it seems that column A is tied to the value in column B and rather than loading 2 formats, it was easier to just load 1 format.
For more help understanding what this program is doing, you might consider reading the PROC TABULATE and PROC FORMAT documentation or contacting Tech Support for help with your particular set of data and output needs. For example, do you need an output table or an output report??? In any case, the Stored Process forum is not the right spot to post questions like this. Beginning syntax or usage questions are most appropriate for Tech Support.
ods html file='c:\temp\tabexamp.html';
** PROC TABULATE;
options missing=0 nodate nonumber;
proc tabulate data=consumer f=comma8.
title "Using PROC TABULATE";
class b /preloadfmt;
table cid* b, n / printmiss;
label b = 'A and B';
keylabel n = 'Total Category';
format b lookup.;
** show output data created by tabulate;
proc print data=tabout;
title 'proc print of data created by tabulate';
title2 'column "B" uses LOOKUP format';
var cid b n;
ods html close;
and the TABULATE output in the LISTING window would look like this:
Using PROC TABULATE