Hello,
I am trying to figure out how to left align a column header in PROC REPORT, but what Im trying to do might not be possible I guess?
Piggy-backing off an earlier post, I am trying to left align the top column header in the last PROC REPORT section:
PROC SQL NOPRINT ;
SELECT SUM(msrp) format=18.2 INTO :total_msrp TRIMMED
FROM sashelp.cars ;
QUIT ;
PROC SQL ;
CREATE TABLE work.make_classification AS
SELECT
make ,
COUNT(*) AS COUNT FORMAT=comma11. ,
SUM(msrp) AS MSRP_SUM FORMAT=dollar18.2 ,
DIVIDE(CALCULATED MSRP_SUM, &total_msrp.) AS MSRP_PCTSUM FORMAT=percent12.3 ,
MAX(weight) AS W_MAX FORMAT=10. ,
AVG(mpg_city) AS MPGC_AVG FORMAT=10. ,
MAX(mpg_city) AS MPGC_MAX FORMAT=10. ,
AVG(mpg_highway) AS MPGH_AVG FORMAT=10. ,
MAX(mpg_highway) AS MPGH_MAX FORMAT=10. ,
AVG(horsepower) AS HP_AVG FORMAT=5.
FROM
sashelp.cars
GROUP BY
make
ORDER BY
MSRP_PCTSUM DESC ;
QUIT ;
ODS ESCAPECHAR = "^" ;
PROC REPORT DATA=work.make_classification MISSING ;
COLUMNS ("^{style[textalign=left]How can I left align this text?}" make COUNT ("msrp" MSRP_SUM MSRP_PCTSUM)
("weight" W_MAX) ("mpg_city" MPGC_AVG MPGC_MAX) ("mpg_highway" MPGH_AVG MPGH_MAX) ("horsepower" HP_AVG)) ;
DEFINE make / ORDER ORDER=DATA ;
DEFINE COUNT / SUM "Count" ;
DEFINE MSRP_SUM / SUM "Total" ;
DEFINE MSRP_PCTSUM / SUM "% of Total" ;
DEFINE W_MAX / DISPLAY "Max" ;
DEFINE MPGC_AVG / DISPLAY "Average" ;
DEFINE MPGC_MAX / DISPLAY "Max" ;
DEFINE MPGH_AVG / DISPLAY "Average" ;
DEFINE MPGH_MAX / DISPLAY "Max" ;
DEFINE HP_AVG / DISPLAY "Average" ;
RBREAK AFTER / SUMMARIZE STYLE=header[font_style=italic] ;
COMPUTE AFTER ;
CALL DEFINE("make", "style", 'style=header[pretext="Grand Totals" textalign=right]') ;
ENDCOMP ;
RUN ;
The above "^{style[textalign=left] text to align}" does not seem to work, and if I add some other style options in the PROC REPORT statement and each DEFINE line, then the other column headers are left aligned, not JUST the top one
PROC REPORT DATA=work.make_classification MISSING STYLE(header)=[textalign=left] ;
COLUMNS ("How can I left align ^{style [textdecoration=underline]ONLY} this text?" make COUNT ("msrp" MSRP_SUM MSRP_PCTSUM)
("weight" W_MAX) ("mpg_city" MPGC_AVG MPGC_MAX) ("mpg_highway" MPGH_AVG MPGH_MAX) ("horsepower" HP_AVG)) ;
DEFINE make / ORDER ORDER=DATA STYLE(header)=[textalign=center] ;
DEFINE COUNT / SUM "Count" STYLE(header)=[textalign=center] ;
DEFINE MSRP_SUM / SUM "Total" STYLE(header)=[textalign=center] ;
DEFINE MSRP_PCTSUM / SUM "% of Total" STYLE(header)=[textalign=center] ;
DEFINE W_MAX / DISPLAY "Max" STYLE(header)=[textalign=center] ;
DEFINE MPGC_AVG / DISPLAY "Average" STYLE(header)=[textalign=center] ;
DEFINE MPGC_MAX / DISPLAY "Max" STYLE(header)=[textalign=center] ;
DEFINE MPGH_AVG / DISPLAY "Average" STYLE(header)=[textalign=center] ;
DEFINE MPGH_MAX / DISPLAY "Max" STYLE(header)=[textalign=center] ;
DEFINE HP_AVG / DISPLAY "Average" STYLE(header)=[textalign=center] ;
RBREAK AFTER / SUMMARIZE STYLE=header[font_style=italic] ;
COMPUTE AFTER ;
CALL DEFINE("make", "style", 'style=header[pretext="Grand Totals" textalign=right]') ;
ENDCOMP ;
RUN ;
Any help is appreciated, Thank you!
... View more