<?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 - Specifying the Same Format for Multiple Variables with a Single Statement in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/PROC-Report-Specifying-the-Same-Format-for-Multiple-Variables/m-p/798350#M313856</link>
    <description>&lt;P&gt;You can use variable lists in the define statement, see the example below. The variable lists specified are based on the variable in the input data set not how variables are listed in the column statement.&lt;/P&gt;
&lt;P&gt;See here for a doc on variable list:&amp;nbsp;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lrcon/p0wphcpsfgx6o7n1sjtqzizp1n39.htm" target="_blank"&gt;https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lrcon/p0wphcpsfgx6o7n1sjtqzizp1n39.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc contents data=sashelp.cars order=varnum short;
run;

proc report data=sashelp.cars(obs=30);
  column Make Model Type EngineSize Cylinders Horsepower MPG_City MPG_Highway Weight Wheelbase Length;
  define make -- type / display style={background=lightyellow};
  define mpg_: / analysis sum format=z12.2 style={background=lightblue};
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 24 Feb 2022 10:04:10 GMT</pubDate>
    <dc:creator>BrunoMueller</dc:creator>
    <dc:date>2022-02-24T10:04:10Z</dc:date>
    <item>
      <title>PROC Report - Specifying the Same Format for Multiple Variables with a Single Statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-Report-Specifying-the-Same-Format-for-Multiple-Variables/m-p/798339#M313850</link>
      <description>&lt;P&gt;Please what is the PROC REPORT equivalent to specifying a common format for multiple variables using a single statement for efficiency?&lt;/P&gt;&lt;P&gt;in PROC PRINT I would do the following:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;format NumberofFarms TotalLivestock Average_Livestock_Size &amp;amp;TopLivestock1._Farms  &amp;amp;TopLivestock2._Farms  &amp;amp;TopLivestock3._Farms  &amp;amp;TopLivestock4._Farms &amp;amp;TopLivestock5._Farms 
&amp;amp;TopLivestock1._Livestock_Size &amp;amp;TopLivestock2._Livestock_Size &amp;amp;TopLivestock3._Livestock_Size &amp;amp;TopLivestock4._Livestock_Size &amp;amp;TopLivestock5._Livestock_Size Comma20.;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;For PROC REPORT using the DEFINE statement does not work for multiple variables i.e:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;DEFINE&amp;nbsp;NumberofFarms TotalLivestock /&amp;nbsp;format=comma20.;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;CODE class=""&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;Please&amp;nbsp;is&amp;nbsp;there&amp;nbsp;a&amp;nbsp;more&amp;nbsp;efficient&amp;nbsp;way&amp;nbsp;to&amp;nbsp;assign&amp;nbsp;formats to multiple variables in a single statement&amp;nbsp;when&amp;nbsp;using&amp;nbsp;PROC REPORT?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Feb 2022 08:39:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-Report-Specifying-the-Same-Format-for-Multiple-Variables/m-p/798339#M313850</guid>
      <dc:creator>baroche64</dc:creator>
      <dc:date>2022-02-24T08:39:56Z</dc:date>
    </item>
    <item>
      <title>Re: PROC Report - Specifying the Same Format for Multiple Variables with a Single Statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-Report-Specifying-the-Same-Format-for-Multiple-Variables/m-p/798342#M313852</link>
      <description>&lt;P&gt;Just use the format statement as in PROC PRINT:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc report data=sashelp.class;
column sex height weight;
format height weight 20.7;
define sex / group;
define height / display;
define weight / display;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 24 Feb 2022 08:54:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-Report-Specifying-the-Same-Format-for-Multiple-Variables/m-p/798342#M313852</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-02-24T08:54:54Z</dc:date>
    </item>
    <item>
      <title>Re: PROC Report - Specifying the Same Format for Multiple Variables with a Single Statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-Report-Specifying-the-Same-Format-for-Multiple-Variables/m-p/798350#M313856</link>
      <description>&lt;P&gt;You can use variable lists in the define statement, see the example below. The variable lists specified are based on the variable in the input data set not how variables are listed in the column statement.&lt;/P&gt;
&lt;P&gt;See here for a doc on variable list:&amp;nbsp;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lrcon/p0wphcpsfgx6o7n1sjtqzizp1n39.htm" target="_blank"&gt;https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lrcon/p0wphcpsfgx6o7n1sjtqzizp1n39.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc contents data=sashelp.cars order=varnum short;
run;

proc report data=sashelp.cars(obs=30);
  column Make Model Type EngineSize Cylinders Horsepower MPG_City MPG_Highway Weight Wheelbase Length;
  define make -- type / display style={background=lightyellow};
  define mpg_: / analysis sum format=z12.2 style={background=lightblue};
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 24 Feb 2022 10:04:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-Report-Specifying-the-Same-Format-for-Multiple-Variables/m-p/798350#M313856</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2022-02-24T10:04:10Z</dc:date>
    </item>
  </channel>
</rss>

