<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: In-Line Formatting PROC REPORT COLUMN Statement Header in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/In-Line-Formatting-PROC-REPORT-COLUMN-Statement-Header/m-p/850693#M336184</link>
    <description>&lt;P&gt;Trick it?&amp;nbsp; Add some non breaking spaces to the end of the string.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
%let pad=%sysfunc(repeat(%sysfunc(inputc(A0,$hex2.)),120));
ODS ESCAPECHAR = "^" ;

PROC REPORT DATA=work.make_classification MISSING ;
    COLUMNS ("How can I left align ^{style [textdecoration=underline]ONLY} this text?&amp;amp;pad."
  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 ;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 21 Dec 2022 23:47:12 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2022-12-21T23:47:12Z</dc:date>
    <item>
      <title>In-Line Formatting PROC REPORT COLUMN Statement Header</title>
      <link>https://communities.sas.com/t5/SAS-Programming/In-Line-Formatting-PROC-REPORT-COLUMN-Statement-Header/m-p/850690#M336183</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Piggy-backing off an earlier post, I am trying to left align the top column header in the last PROC REPORT section:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;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, &amp;amp;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 ;


&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;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 ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Any help is appreciated, Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2022 22:16:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/In-Line-Formatting-PROC-REPORT-COLUMN-Statement-Header/m-p/850690#M336183</guid>
      <dc:creator>GBL__</dc:creator>
      <dc:date>2022-12-21T22:16:03Z</dc:date>
    </item>
    <item>
      <title>Re: In-Line Formatting PROC REPORT COLUMN Statement Header</title>
      <link>https://communities.sas.com/t5/SAS-Programming/In-Line-Formatting-PROC-REPORT-COLUMN-Statement-Header/m-p/850693#M336184</link>
      <description>&lt;P&gt;Trick it?&amp;nbsp; Add some non breaking spaces to the end of the string.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
%let pad=%sysfunc(repeat(%sysfunc(inputc(A0,$hex2.)),120));
ODS ESCAPECHAR = "^" ;

PROC REPORT DATA=work.make_classification MISSING ;
    COLUMNS ("How can I left align ^{style [textdecoration=underline]ONLY} this text?&amp;amp;pad."
  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 ;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 21 Dec 2022 23:47:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/In-Line-Formatting-PROC-REPORT-COLUMN-Statement-Header/m-p/850693#M336184</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-12-21T23:47:12Z</dc:date>
    </item>
    <item>
      <title>Re: In-Line Formatting PROC REPORT COLUMN Statement Header</title>
      <link>https://communities.sas.com/t5/SAS-Programming/In-Line-Formatting-PROC-REPORT-COLUMN-Statement-Header/m-p/850700#M336186</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; You would have more control if you used COMPUTE BEFORE _PAGE_ instead of a spanning header. Here's what I mean:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC REPORT DATA=sashelp.cars MISSING ;
    COLUMNS  make n ("msrp" msrp=msrp_sum msrp=msrp_pctsum)
        ("weight" weight) ("mpg_city" mpg_city=MPGC_AVG mpg_city=MPGC_MAX) 
        ("mpg_highway" mpg_highway=MPGH_AVG mpg_highway=MPGH_MAX) 
        ("horsepower" horsepower=HP_AVG)  ;
    where substr(make,1,1) le 'K';
    DEFINE make / group ORDER=DATA ;
    DEFINE N /  "Count" f=comma11. ;
    DEFINE MSRP_SUM / SUM "Total" f=dollar18.2 ;
    DEFINE MSRP_PCTSUM / PCTSUM "% of Total" f=percent12.3 ;
    DEFINE weight / Max "Max" f=10.;
    DEFINE MPGC_AVG / mean "Average"  f=10.;
    DEFINE MPGC_MAX / max "Max"  f=10.;
    DEFINE MPGH_AVG / mean "Average"  f=10.;
    DEFINE MPGH_MAX / max "Max"  f=10.;
    DEFINE HP_AVG / mean "Average" f=5.;

    RBREAK AFTER / SUMMARIZE STYLE=header[font_style=italic] ;
    compute before _page_ / style=Header{textalign=left};
	  line 'How can I left align this text?';
	endcomp;
    COMPUTE AFTER;
	  Make = "Grand Totals";
      CALL DEFINE("make", "style", 'style=header[textalign=right]') ;
    ENDCOMP ;
RUN ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I just did everything in PROC REPORT because seemed to be what you wanted and I cut the subset down so it ended with Kia, just to make the screen shot more managable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Here's the output:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_0-1671675585726.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/78801iA191DD83D405737F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_0-1671675585726.png" alt="Cynthia_sas_0-1671675585726.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Hope this heps,&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2022 02:20:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/In-Line-Formatting-PROC-REPORT-COLUMN-Statement-Header/m-p/850700#M336186</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2022-12-22T02:20:05Z</dc:date>
    </item>
    <item>
      <title>Re: In-Line Formatting PROC REPORT COLUMN Statement Header</title>
      <link>https://communities.sas.com/t5/SAS-Programming/In-Line-Formatting-PROC-REPORT-COLUMN-Statement-Header/m-p/850703#M336187</link>
      <description>&lt;P&gt;That works.&amp;nbsp; Note you don't need to tell it to "left align".&amp;nbsp; You can just tell it to start at the beginning of the line.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;compute before _page_ / style=Header;
line @1 'How can I left align this text?';
endcomp;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 22 Dec 2022 02:58:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/In-Line-Formatting-PROC-REPORT-COLUMN-Statement-Header/m-p/850703#M336187</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-12-22T02:58:19Z</dc:date>
    </item>
    <item>
      <title>Re: In-Line Formatting PROC REPORT COLUMN Statement Header</title>
      <link>https://communities.sas.com/t5/SAS-Programming/In-Line-Formatting-PROC-REPORT-COLUMN-Statement-Header/m-p/850779#M336213</link>
      <description>&lt;P&gt;Thank you very much, Cynthia!&amp;nbsp; This is exactly what I wanted, and exactly what I needed!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The reason I added the extra PROC SQL step was because in my actual situation I need the output to be in descending MSRP_PCTSUM order, and without and values in the summary line except for the N, SUM and PCTSUM columns.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I did not know of a way to do this via PROC REPORT alone.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you again for your help!!!&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2022 13:38:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/In-Line-Formatting-PROC-REPORT-COLUMN-Statement-Header/m-p/850779#M336213</guid>
      <dc:creator>GBL__</dc:creator>
      <dc:date>2022-12-22T13:38:46Z</dc:date>
    </item>
    <item>
      <title>Re: In-Line Formatting PROC REPORT COLUMN Statement Header</title>
      <link>https://communities.sas.com/t5/SAS-Programming/In-Line-Formatting-PROC-REPORT-COLUMN-Statement-Header/m-p/850795#M336219</link>
      <description>Hi:&lt;BR /&gt;  The reason I use the style override instead of the @ control is that some ODS destinations do not use the @ placement for text. All of the ODS destinations that support style overrides will use the textalign attribute.&lt;BR /&gt;Cynthia</description>
      <pubDate>Thu, 22 Dec 2022 15:12:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/In-Line-Formatting-PROC-REPORT-COLUMN-Statement-Header/m-p/850795#M336219</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2022-12-22T15:12:45Z</dc:date>
    </item>
  </channel>
</rss>

