<?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: proc report define statement in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/proc-report-define-statement/m-p/702867#M79909</link>
    <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; A PROC REPORT use of alias&amp;nbsp; as &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt; suggested is the way to get what you want. Using SASHELP.HEART, which has DIASTOLIC and SYSTOLIC as variables, this is what it looks like, including headers:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_0-1606847540173.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/52221iABA419F94D0CDA99/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_0-1606847540173.png" alt="Cynthia_sas_0-1606847540173.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I used BP_STATUS as the GROUP variable, but that was the major difference.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; And, you can accomplish the same results using the comma operator with an analysis variable (essentially "crossing" or "nesting" statistics under an analysis variable, as shown in the code below:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_0-1606850326883.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/52222iA2074ACA826850F8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_0-1606850326883.png" alt="Cynthia_sas_0-1606850326883.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;And although that simplifies the COLUMN statement, it also has the limitation that MEAN and STD each get only 1 DEFINE statement, so you couldn't easily have one label for MEAN under SYSTOLIC and a separate label for MEAN under DIASTOLIC, for example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
    <pubDate>Tue, 01 Dec 2020 19:20:54 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2020-12-01T19:20:54Z</dc:date>
    <item>
      <title>proc report define statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-report-define-statement/m-p/702740#M79907</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been working on this problem for quite a while and cannot seem to figure out how to break up my proc report statements so as to display mean and std simultaneously for a numeric variable.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The table I wish to produce is:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;Average Pressures&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;Systolic&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;Diastolic&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;Race Code&lt;/STRONG&gt;&lt;/P&gt;&lt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115.2&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;15.5&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;69.8&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;11.0&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;White&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;449&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;120.8&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;15.5&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;70.0&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;7.6&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;573&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;120.8&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;15.4&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;70.6&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;7.8&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My current code will not allow me to simultaneously display MEAN and STD:&lt;/P&gt;&lt;P&gt;PROC REPORT&lt;BR /&gt;DATA = hypanal.hypanalysis1 Split="/"&lt;BR /&gt;MISSING;&lt;BR /&gt;COLUMN RaceCd N ("Average Pressures"&lt;BR /&gt;("Systolic" SBP SBP) ("Diastolic" DBP DBP));&lt;BR /&gt;DEFINE RaceCd /group;&lt;BR /&gt;Define N / "N";&lt;BR /&gt;DEFINE SBP / ANALYSIS MEAN STD format=4.1 "MEAN" "STD";&lt;BR /&gt;DEFINE DBP / ANALYSIS MEAN STD format=4.1 "MEAN" "STD";&lt;BR /&gt;RBREAK AFTER / SUMMARIZE;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the result is close, but only displays STD instead of STDs and MEANS:&lt;/P&gt;&lt;P&gt;&amp;nbsp; Average Pressures&amp;nbsp; Systolic DiastolicRace Code N MEANSTD MEANSTD MEANSTD MEANSTD&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;11&lt;/TD&gt;&lt;TD&gt;11.1&lt;/TD&gt;&lt;TD&gt;11.1&lt;/TD&gt;&lt;TD&gt;9.0&lt;/TD&gt;&lt;TD&gt;9.0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;83&lt;/TD&gt;&lt;TD&gt;15.3&lt;/TD&gt;&lt;TD&gt;15.3&lt;/TD&gt;&lt;TD&gt;7.0&lt;/TD&gt;&lt;TD&gt;7.0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;O&lt;/TD&gt;&lt;TD&gt;30&lt;/TD&gt;&lt;TD&gt;15.5&lt;/TD&gt;&lt;TD&gt;15.5&lt;/TD&gt;&lt;TD&gt;11.0&lt;/TD&gt;&lt;TD&gt;11.0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;W&lt;/TD&gt;&lt;TD&gt;449&lt;/TD&gt;&lt;TD&gt;15.5&lt;/TD&gt;&lt;TD&gt;15.5&lt;/TD&gt;&lt;TD&gt;7.6&lt;/TD&gt;&lt;TD&gt;7.6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;573&lt;/TD&gt;&lt;TD&gt;15.4&lt;/TD&gt;&lt;TD&gt;15.4&lt;/TD&gt;&lt;TD&gt;7.8&lt;/TD&gt;&lt;TD&gt;7.8&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would appreciate any help!!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks so much&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2020 06:29:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-report-define-statement/m-p/702740#M79907</guid>
      <dc:creator>rhaley1821</dc:creator>
      <dc:date>2020-12-01T06:29:05Z</dc:date>
    </item>
    <item>
      <title>Re: proc report define statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-report-define-statement/m-p/702751#M79908</link>
      <description>&lt;P&gt;You can only request one statistic or apply one column heading per Define statement.&lt;/P&gt;
&lt;P&gt;One way that may do what you want is to use alias for the variable to request separate statistics. To do that you use "variable = aliasname" in the Columns statement and then use the Define with the aliasname&lt;/P&gt;
&lt;P&gt;Something like:&lt;/P&gt;
&lt;PRE&gt;PROC REPORT DATA = hypanal.hypanalysis1 Split="/"
  MISSING;
   COLUMN RaceCd N ("Pressures"
    ("Systolic" SBP=sysmean SBP=sysstd) ("Diastolic" DBP=dysmean DBP=dysstd));
   DEFINE RaceCd /group;
   Define N / "N";
   DEFINE sysmean / ANALYSIS MEAN  format=4.1 "MEAN" ;
   DEFINE sysstd / ANALYSIS  STD format=4.1  "STD";
   DEFINE dysmean / ANALYSIS MEAN STD format=4.1 "MEAN";
   DEFINE dysstd / ANALYSIS MEAN STD format=4.1  "STD";
   RBREAK AFTER / SUMMARIZE;
RUN;&lt;/PRE&gt;
&lt;P&gt;I'm not sure that the column headings you are placing on the column statement with the parentheses will do exactly as you want but the define statements should work. You may want to include more decimals in the STD to be a bit more meaningful.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2020 08:10:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-report-define-statement/m-p/702751#M79908</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-12-01T08:10:13Z</dc:date>
    </item>
    <item>
      <title>Re: proc report define statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-report-define-statement/m-p/702867#M79909</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; A PROC REPORT use of alias&amp;nbsp; as &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt; suggested is the way to get what you want. Using SASHELP.HEART, which has DIASTOLIC and SYSTOLIC as variables, this is what it looks like, including headers:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_0-1606847540173.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/52221iABA419F94D0CDA99/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_0-1606847540173.png" alt="Cynthia_sas_0-1606847540173.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I used BP_STATUS as the GROUP variable, but that was the major difference.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; And, you can accomplish the same results using the comma operator with an analysis variable (essentially "crossing" or "nesting" statistics under an analysis variable, as shown in the code below:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_0-1606850326883.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/52222iA2074ACA826850F8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_0-1606850326883.png" alt="Cynthia_sas_0-1606850326883.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;And although that simplifies the COLUMN statement, it also has the limitation that MEAN and STD each get only 1 DEFINE statement, so you couldn't easily have one label for MEAN under SYSTOLIC and a separate label for MEAN under DIASTOLIC, for example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2020 19:20:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-report-define-statement/m-p/702867#M79909</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2020-12-01T19:20:54Z</dc:date>
    </item>
  </channel>
</rss>

