<?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: Using two Formats in One Variable in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Using-two-Formats-in-One-Variable/m-p/186604#M47397</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This sounds like a reporting requirement, surely not a must for storage. If one is to store different kind of values in the same variable in permanent storage, I would have some helper variable specifying the nature of the measures.&lt;/P&gt;&lt;P&gt;Reezas suggestion will probably work for many situations, but results kind be weird if you have a $0 result, or want to introduce other kind of measures, like diff last month etc.&lt;/P&gt;&lt;P&gt;Perhaps you could accomplish this in the presentation layer instead?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 25 Feb 2014 20:03:46 GMT</pubDate>
    <dc:creator>LinusH</dc:creator>
    <dc:date>2014-02-25T20:03:46Z</dc:date>
    <item>
      <title>Using two Formats in One Variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Using-two-Formats-in-One-Variable/m-p/186602#M47395</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all--&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a data set which looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 219px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" width="126"&gt;&lt;STRONG&gt;KPI&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="47"&gt;&lt;STRONG&gt;Control&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="46"&gt;&lt;STRONG&gt;Test&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="20" style="border-top: none;" width="126"&gt;Response Rate&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;" width="47"&gt;0.0037&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;" width="46"&gt;0.0032&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="20" style="border-top: none;" width="126"&gt;Conversion Rate&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;" width="47"&gt;0.3401&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;" width="46"&gt;0.3406&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="20" style="border-top: none;" width="126"&gt;Yield&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;" width="47"&gt;0.0012&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;" width="46"&gt;0.0011&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="20" style="border-top: none;" width="126"&gt;Online Response Rate&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;" width="47"&gt;0.0015&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;" width="46"&gt;0.0012&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="20" style="border-top: none;" width="126"&gt;Total Response Rate&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;" width="47"&gt;0.0051&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;" width="46"&gt;0.0044&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="20" style="border-top: none;" width="126"&gt;Total Yield&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;" width="47"&gt;0.0014&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;" width="46"&gt;0.0012&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="20" style="border-top: none;" width="126"&gt;CPR&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;" width="47"&gt;68.1&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;" width="46"&gt;65.5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="20" style="border-top: none;" width="126"&gt;CPS&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;" width="47"&gt;251.69&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;" width="46"&gt;237.99&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to have&amp;nbsp; the CPR and CPS values formatted dollar10.2&amp;nbsp; and the rest of the KPIs formatted Percent10.2. So, the data set should look like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="219"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" width="126"&gt;KPI&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="47"&gt;Control&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="46"&gt;Test&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;" width="126"&gt;Response Rate&lt;/TD&gt;&lt;TD align="right" class="xl67" style="border-top: none; border-left: none;" width="47"&gt;0.37%&lt;/TD&gt;&lt;TD align="right" class="xl67" style="border-top: none; border-left: none;" width="46"&gt;0.32%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;" width="126"&gt;Conversion Rate&lt;/TD&gt;&lt;TD align="right" class="xl67" style="border-top: none; border-left: none;" width="47"&gt;34.01%&lt;/TD&gt;&lt;TD align="right" class="xl67" style="border-top: none; border-left: none;" width="46"&gt;34.06%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;" width="126"&gt;Yield&lt;/TD&gt;&lt;TD align="right" class="xl67" style="border-top: none; border-left: none;" width="47"&gt;0.12%&lt;/TD&gt;&lt;TD align="right" class="xl67" style="border-top: none; border-left: none;" width="46"&gt;0.11%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;" width="126"&gt;Online Response Rate&lt;/TD&gt;&lt;TD align="right" class="xl67" style="border-top: none; border-left: none;" width="47"&gt;0.15%&lt;/TD&gt;&lt;TD align="right" class="xl67" style="border-top: none; border-left: none;" width="46"&gt;0.12%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;" width="126"&gt;Total Response Rate&lt;/TD&gt;&lt;TD align="right" class="xl67" style="border-top: none; border-left: none;" width="47"&gt;0.51%&lt;/TD&gt;&lt;TD align="right" class="xl67" style="border-top: none; border-left: none;" width="46"&gt;0.44%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;" width="126"&gt;Total Yield&lt;/TD&gt;&lt;TD align="right" class="xl67" style="border-top: none; border-left: none;" width="47"&gt;0.14%&lt;/TD&gt;&lt;TD align="right" class="xl67" style="border-top: none; border-left: none;" width="46"&gt;0.12%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;" width="126"&gt;CPR&lt;/TD&gt;&lt;TD align="right" class="xl68" style="border-top: none; border-left: none;" width="47"&gt;$68.10&lt;/TD&gt;&lt;TD align="right" class="xl68" style="border-top: none; border-left: none;" width="46"&gt;$65.50&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;" width="126"&gt;CPS&lt;/TD&gt;&lt;TD align="right" class="xl68" style="border-top: none; border-left: none;" width="47"&gt;$251.69&lt;/TD&gt;&lt;TD align="right" class="xl68" style="border-top: none; border-left: none;" width="46"&gt;$237.99&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to apply two formats to one variable? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Feb 2014 19:37:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Using-two-Formats-in-One-Variable/m-p/186602#M47395</guid>
      <dc:creator>Mgarret</dc:creator>
      <dc:date>2014-02-25T19:37:39Z</dc:date>
    </item>
    <item>
      <title>Re: Using two Formats in One Variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Using-two-Formats-in-One-Variable/m-p/186603#M47396</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can nest the formats, if you can assume the percentages will be between 0-1 and all others will be higher. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc format;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; value mixed_fmt&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0 -1 = [percent10.2]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1-high = [dollar10.2];&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;format control test mixed_fmt.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Feb 2014 19:51:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Using-two-Formats-in-One-Variable/m-p/186603#M47396</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-02-25T19:51:45Z</dc:date>
    </item>
    <item>
      <title>Re: Using two Formats in One Variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Using-two-Formats-in-One-Variable/m-p/186604#M47397</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This sounds like a reporting requirement, surely not a must for storage. If one is to store different kind of values in the same variable in permanent storage, I would have some helper variable specifying the nature of the measures.&lt;/P&gt;&lt;P&gt;Reezas suggestion will probably work for many situations, but results kind be weird if you have a $0 result, or want to introduce other kind of measures, like diff last month etc.&lt;/P&gt;&lt;P&gt;Perhaps you could accomplish this in the presentation layer instead?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Feb 2014 20:03:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Using-two-Formats-in-One-Variable/m-p/186604#M47397</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2014-02-25T20:03:46Z</dc:date>
    </item>
  </channel>
</rss>

