Hi:
I'm not sure what you mean by changing the headers? You can use N and MEAN in DEFINE statements:
[pre]
define n / "Count of Players";
define mean / "Adjusted Mean";
[/pre]
This gives you the opportunity to change the column headers.
One useful technique for determining what absolute column names have been assigned to your ACROSS variables, is to use the OUT= option to take a look:
[pre]
proc report data=test nowd out=whatcols;
[/pre]
Then, a PROC PRINT after this step will reveal how the columns are named. In your case, if you had 2 possible values for category and you have N and MEAN nested underneath each category, then PROC REPORT would name 4 columns. Since SEX is the first column, the numbering would start at _c2_ and _c3_ for N and MEAN under the first category and _c4_ and _c5_ for N and MEAN under the second category.
You may wonder why I listed N first, that's because PROC REPORT builds a report row from Left to Right. If you want to conditionally alter the value for MEAN for every category, based on N, then N has to appear BEFORE MEAN in the COLUMN statement:
[pre]
column sex category, salary, (n mean);
[/pre]
If you want to test N when MEAN is being written on the report row (so you can change the MEAN), then N has to be placed on the report row BEFORE MEAN, so it is available for the test. PROC REPORT does not have a Program Data Vector (like the DATA step) -- so when N is being placed on the report, there is no visibility of MEAN.
So, finally, how you would change MEAN is in a COMPUTE block. You were on the right track -- but only for a report without an ACROSS variable. But the simple column name "MEAN" -- while it is OK for the COMPUTE block-- is not OK for the IF statement. You need to tell PROC REPORT exactly WHICH value of MEAN should be adjusted -- the value for the first category or the second category. This means that you will need more than one IF statement in your COMPUTE block. If you have 2 categories, then you will need 2 IF statements:
[pre]
compute mean;
if _c2_ lt 5 then _c3_ = 0;
if _c4_ lt 5 then _c5_ = 0;
endcomp;
[/pre]
Hope this helps clarify things,
cynthia