<?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: Formatting Class variable but not analytical variable in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Formatting-Class-variable-but-not-analytical-variable/m-p/47251#M12663</link>
    <description>Hello Darrylovia,&lt;BR /&gt;
&lt;BR /&gt;
I had the same problem and to solve it created a copy of inventory variable, applied format to it and used as a class variable:&lt;BR /&gt;
[pre]&lt;BR /&gt;
data i;&lt;BR /&gt;
  set sashelp.shoes; &lt;BR /&gt;
  inv=inventory;&lt;BR /&gt;
run;&lt;BR /&gt;
proc summary data=i nway;&lt;BR /&gt;
class inv;&lt;BR /&gt;
format inv quartilefmt.;&lt;BR /&gt;
var inventory;&lt;BR /&gt;
output out=inventory_by_quartiles mean=mean std=std;&lt;BR /&gt;
run; &lt;BR /&gt;
[/pre]&lt;BR /&gt;
I should also notice that without NWAY option you will get total mean and std that could be useful.&lt;BR /&gt;
Sincerely,&lt;BR /&gt;
SPR</description>
    <pubDate>Wed, 08 Dec 2010 21:26:09 GMT</pubDate>
    <dc:creator>SPR</dc:creator>
    <dc:date>2010-12-08T21:26:09Z</dc:date>
    <item>
      <title>Formatting Class variable but not analytical variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Formatting-Class-variable-but-not-analytical-variable/m-p/47250#M12662</link>
      <description>Hello SAS Forum Users,&lt;BR /&gt;
&lt;BR /&gt;
I'm trying to create a report that bins my variable into groups (say quartiles) and then find the mean for the variable in  the bin.  When I use a format in proc summary, the format applies to both the binned value(class variable) and the analytical variable.&lt;BR /&gt;
&lt;BR /&gt;
See the below code as an example with the problem that I am having.  Using the SASHELP tables, the output data set has the class variable, mean and std all formated with the quartilefmt. Is there a way to only apply the format to the class variable, so I can see the mean and std with no formatting?&lt;BR /&gt;
&lt;BR /&gt;
Thanks&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
proc format;&lt;BR /&gt;
  value quartilefmt&lt;BR /&gt;
       low  -  43155 = '1'&lt;BR /&gt;
     43155 &amp;lt;- 118849 = '2'&lt;BR /&gt;
    118849 &amp;lt;- 336513 = '3'&lt;BR /&gt;
    336513 &amp;lt;- high   = '4';&lt;BR /&gt;
&lt;BR /&gt;
proc summary data=sashelp.shoes nway;&lt;BR /&gt;
  class inventory;&lt;BR /&gt;
   format inventory quartilefmt.;&lt;BR /&gt;
  var inventory;&lt;BR /&gt;
  output out=inventory_by_quartiles mean=mean std=std;&lt;BR /&gt;
run;</description>
      <pubDate>Wed, 08 Dec 2010 20:55:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Formatting-Class-variable-but-not-analytical-variable/m-p/47250#M12662</guid>
      <dc:creator>darrylovia</dc:creator>
      <dc:date>2010-12-08T20:55:08Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting Class variable but not analytical variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Formatting-Class-variable-but-not-analytical-variable/m-p/47251#M12663</link>
      <description>Hello Darrylovia,&lt;BR /&gt;
&lt;BR /&gt;
I had the same problem and to solve it created a copy of inventory variable, applied format to it and used as a class variable:&lt;BR /&gt;
[pre]&lt;BR /&gt;
data i;&lt;BR /&gt;
  set sashelp.shoes; &lt;BR /&gt;
  inv=inventory;&lt;BR /&gt;
run;&lt;BR /&gt;
proc summary data=i nway;&lt;BR /&gt;
class inv;&lt;BR /&gt;
format inv quartilefmt.;&lt;BR /&gt;
var inventory;&lt;BR /&gt;
output out=inventory_by_quartiles mean=mean std=std;&lt;BR /&gt;
run; &lt;BR /&gt;
[/pre]&lt;BR /&gt;
I should also notice that without NWAY option you will get total mean and std that could be useful.&lt;BR /&gt;
Sincerely,&lt;BR /&gt;
SPR</description>
      <pubDate>Wed, 08 Dec 2010 21:26:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Formatting-Class-variable-but-not-analytical-variable/m-p/47251#M12663</guid>
      <dc:creator>SPR</dc:creator>
      <dc:date>2010-12-08T21:26:09Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting Class variable but not analytical variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Formatting-Class-variable-but-not-analytical-variable/m-p/47252#M12664</link>
      <description>Using a DATA Step view (data i / view = i) will avoid making a copy of the original data set which could be important if it is large. The new column will exist only in memory for single pass processing.</description>
      <pubDate>Fri, 07 Jan 2011 22:40:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Formatting-Class-variable-but-not-analytical-variable/m-p/47252#M12664</guid>
      <dc:creator>RSRay_SAS</dc:creator>
      <dc:date>2011-01-07T22:40:42Z</dc:date>
    </item>
  </channel>
</rss>

