<?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: Retaining value of variable to set another variable within a by-group in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Retaining-value-of-variable-to-set-another-variable-within-a-by/m-p/157005#M30663</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you post sample data in the form of the data you have and the data you need.&lt;/P&gt;&lt;P&gt;I'm having a hard time seeing why if/then statements won't work. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 26 Jun 2014 17:25:27 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2014-06-26T17:25:27Z</dc:date>
    <item>
      <title>Retaining value of variable to set another variable within a by-group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Retaining-value-of-variable-to-set-another-variable-within-a-by/m-p/157004#M30662</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 problem I'm trying to solve and am in the middle of researching it but thought I'd try here as well.&amp;nbsp; Any help is greatly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The data set I have is large but the operative fields are as follows:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;order_no&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pc_cat&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pc_cat_no&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; X&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 21&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Y&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 11&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NULL&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 22&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NULL&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12&lt;/P&gt;&lt;P&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; X&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 21&lt;/P&gt;&lt;P&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NULL&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 22&lt;/P&gt;&lt;P&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NULL&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I need to do is reset the NULL values to X where pc_cat_no is equal to 22, and set the NULL values to Y where pc_cat_no is equal to 12 (because in the actual data pc_cat_no 12 is related to 11 and pc_cat_no 22 is related to 21), and leave NULL where pc_cat_no is anything else; but the hard part is I need to only search for and replace NULL's based on pc_cat_no within a given order_no. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think it may be the retain function or some variant, but have been unable to crack the code thus far. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jun 2014 17:15:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Retaining-value-of-variable-to-set-another-variable-within-a-by/m-p/157004#M30662</guid>
      <dc:creator>eric_balke</dc:creator>
      <dc:date>2014-06-26T17:15:17Z</dc:date>
    </item>
    <item>
      <title>Re: Retaining value of variable to set another variable within a by-group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Retaining-value-of-variable-to-set-another-variable-within-a-by/m-p/157005#M30663</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you post sample data in the form of the data you have and the data you need.&lt;/P&gt;&lt;P&gt;I'm having a hard time seeing why if/then statements won't work. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jun 2014 17:25:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Retaining-value-of-variable-to-set-another-variable-within-a-by/m-p/157005#M30663</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-06-26T17:25:27Z</dc:date>
    </item>
    <item>
      <title>Re: Retaining value of variable to set another variable within a by-group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Retaining-value-of-variable-to-set-another-variable-within-a-by/m-p/157006#M30664</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;IMG alt="mult_prodcats.PNG" class="jive-image-thumbnail jive-image" height="237" src="https://communities.sas.com/legacyfs/online/6710_mult_prodcats.PNG" width="1155" /&gt;&lt;/P&gt;&lt;P&gt;Above is an image of the actual data.&amp;nbsp; The first problem which is depicted above is that there can be multiple Bucketing values for a given order.&amp;nbsp; I need to attribute other lines within the same order to either Bucket or neither depending on the value of prodcat.&amp;nbsp; The second, and bigger proglem I think, (sorry I wasn't clear in the first question) is that a given &lt;STRONG&gt;prodcat&lt;/STRONG&gt; can apply to more than one &lt;STRONG&gt;"Bucketing"&lt;/STRONG&gt; category, and the value I assign to Bucketing for a given prodcat depends on the value encountered on the order for Bucketing.&amp;nbsp; This problem is depicted in the following images.&amp;nbsp; In the first image, all lines where prodcat is 20&lt;/P&gt;&lt;P&gt;should be assigned a Bucketing value of CPAP, whereas in the second image all lines where prodcat is 20 should be assigned a Bucketing value of BiPAP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="cpap.PNG" class="jive-image-thumbnail jive-image" height="161" src="https://communities.sas.com/legacyfs/online/6711_cpap.PNG" width="1152" /&gt;&lt;/P&gt;&lt;P&gt; &lt;IMG alt="bipap.PNG" class="jive-image-thumbnail jive-image" height="179" src="https://communities.sas.com/legacyfs/online/6712_bipap.PNG" width="1152" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Thanks again for your time!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jun 2014 17:50:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Retaining-value-of-variable-to-set-another-variable-within-a-by/m-p/157006#M30664</guid>
      <dc:creator>eric_balke</dc:creator>
      <dc:date>2014-06-26T17:50:05Z</dc:date>
    </item>
  </channel>
</rss>

