Hi:
You might want to look at the examples in Technical Report P-258 and in the Proc Report doc:
http://support.sas.com/documentation/onlinedoc/v82/techreport_p258.pdf
http://support.sas.com/documentation/cdl/en/proc/59565/HTML/default/report-overview.htm
This example (below) shows how the numbers assigned to the across variables will change, depending on what you have crossed underneath the across variable. For example, in the first program, I have the income, the mean of income and the count all nested underneath the industry variable. In the second program, there are only 2 variables nested underneath the industry variable. You can see, when you run this program, that NOPRINT does not affect the column number that's assigned. I just used LINE statements instead of any calculations to show what was in each absolute column at the RBREAK.
There are SAS macro programs that you could write that would figure out the levels of the ACROSS variables so you don't have to hard code the column numbers, but for starting out, this is a good place.
For an example of using a macro to determine across levels, see this first paper (and some other papers of interest):
http://support.sas.com/rnd/papers/sgf07/sgf2007-report.pdf
http://www2.sas.com/proceedings/sugi31/235-31.pdf
http://www2.sas.com/proceedings/sugi30/244-30.pdf
http://www2.sas.com/proceedings/sugi29/242-29.pdf
cynthia
[pre]
data test(keep=state industry income);
set sashelp.prdsale;
State=region;
Industry=prodtype;
Income=actual;
run;
ods listing;
options nocenter nodate nonumber;
PROC REPORT DATA=TEST NOWD MISSING;
title 'With 3 variables under Across and all showing';
COLUMN STATE INDUSTRY,(INCOME income=incmn n);
DEFINE STATE/GROUP;
DEFINE INDUSTRY/ACROSS;
DEFINE INCOME /ANALYSIS f=dollar10.;
define incmn / mean 'Avg';
define n / 'Count';
RBREAK AFTER / SKIP OL SUMMARIZE;
compute after;
lnvar1 = catx(' ','Avg Income for _c3_ is: ',put(_c3_,dollar12.));
lnvar2 = catx(' ','Avg Income for _c6_ is: ',put(_c6_,dollar12.));
line ' ';
line lnvar1 $50.;
line lnvar2 $50.;
line ' ';
line 'Total for _c2_: ' _c2_ dollar10. ' and total for _c5_ is: ' _c5_ dollar10.;
endcomp;
RUN;
PROC REPORT DATA=TEST NOWD MISSING;
title 'With 2 variables under across and one of them NOPRINT';
COLUMN STATE INDUSTRY,(INCOME income=incmn);
DEFINE STATE/GROUP;
DEFINE INDUSTRY/ACROSS;
DEFINE INCOME /ANALYSIS f=dollar10.;
define incmn / mean 'Avg' noprint;
RBREAK AFTER / SKIP OL SUMMARIZE;
compute after;
lnvar1 = catx(' ','Avg Income for Furniture is: ',put(_c3_,dollar12.));
lnvar2 = catx(' ','Avg Income for Office is: ',put(_c5_,dollar12.));
line ' ';
line lnvar1 $50.;
line lnvar2 $50.;
line ' ';
line 'Total for _c2_: ' _c2_ dollar10. ' and total for _c4_ is: ' _c4_ dollar10.;
endcomp;
RUN;
[/pre]