| Date: | Tue, 28 Nov 2006 06:24:25 -0800 |
| Reply-To: | brodkorbtd <Tyson.D.Brodkorb@WELLSFARGO.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | brodkorbtd <Tyson.D.Brodkorb@WELLSFARGO.COM> |
| Organization: | http://groups.google.com |
| Subject: | ODS Options in Proc Print |
|
| Content-Type: | text/plain; charset="iso-8859-1" |
|---|
I'm using code similar to the following to print a data set. I'm
having problems doing two things:
1. I need to get rid of the by line at the top of each section -
"City = xxxxxx"
2. I want to make the "City Total" row in each group bold.
Any help is greatly appreciated.
I'm running on SAS 9.1.3 Service Pack 2.
Here is my sample code:
OPTIONS LS=72;
ods _all_ close;
options orientation=landscape ls=256 ps=600 missing = '' nodate;
ods pdf style = Journal notoc;
DATA A;
INPUT (JAN FEB MAR) (10.2) CITY 3. PRODUCT 3.;
YTD = SUM(JAN,FEB,MAR); /* Calculate year-to-date totals. */
CARDS;
24519.21 27210.54 21546.00 1 1
28349.28 24318.06 29783.49 1 2
16283.82 18122.33 19323.83 1 3
29816.00 31233.19 26984.51 1 4
21926.00 22905.00 24936.86 1 5
28196.59 23590.06 23215.10 1 6
19321.55 18417.52 21562.41 2 1
24217.14 21015.27 19218.33 2 2
12157.12 15378.58 13582.33 2 3
31072.68 31243.90 32945.31 2 4
30548.12 32847.22 29430.45 2 5
21726.47 20720.93 20722.83 2 6
24672.50 19143.00 16588.09 3 1
23476.51 24981.85 20611.72 3 2
19161.47 19445.70 18892.28 3 3
34145.37 31427.36 30661.78 3 4
25934.46 28316.00 27186.06 3 5
22578.63 24548.37 25618.23 3 6
;
RUN;
PROC SORT;
BY CITY;
RUN;
PROC FORMAT;
VALUE CCODES 1='RALEIGH NC' 2='CHARLOTTE NC'
3='WINSTON-SALEM NC';
VALUE PCODES 1='AMPLIFIERS' 2='RECEIVERS' 3='TURNTABLES'
4='TAPE DECKS' 5='SPEAKERS' 6='OTHER AUDIO'
7=' CITY TOTAL';
RUN;
PROC MEANS NOPRINT SUM;
BY CITY;
VAR JAN FEB MAR YTD;
OUTPUT OUT=B SUM=JAN FEB MAR YTD; /* Output CITY totals. */
RUN;
DATA C; SET A B(IN=B);
BY CITY;
/* Interleave original observations with totals. */
IF B THEN PRODUCT = 7;
RUN;
/* PRINT report. */
PROC PRINT
style(table) = {frame = box
rules = all
borderwidth = 1
just = center}
style(header) = {background = lightgrey
just = center
font_size = 7 pt
font_weight = Bold}
style(data) = {just = center
font_size = 7 pt};
BY CITY;
VAR PRODUCT JAN FEB MAR YTD;
FORMAT JAN FEB MAR YTD 12.2 CITY CCODES. PRODUCT PCODES.;
TITLE1 'FIRST QUARTER SALES FOR SUNY STEREO INC.';
TITLE2 'IN DOLLARS BY CITY';
RUN;
|