<?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: Replacement of value of a variable with condition on the value of another variable in SAS Data Science</title>
    <link>https://communities.sas.com/t5/SAS-Data-Science/Replacement-of-value-of-a-variable-with-condition-on-the-value/m-p/422007#M6474</link>
    <description>&lt;P&gt;Hello&amp;nbsp;Zhi Wei -&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By "clear the value", it sounds like you mean that you want to replace car values of 0 with a missing value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One approach is to connect a SAS Code node to your flow, and write code to perform the replacement.&amp;nbsp; Select the Code Editor property of the SAS Code node, and try code like this (let car_value be the variable name that corresponds to 'car value'):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data &amp;amp;em_export_train;&lt;BR /&gt;&amp;nbsp; set &amp;amp;EM_IMPORT_DATA;&lt;BR /&gt;&amp;nbsp; if car_value=0 then car_value=.;&lt;BR /&gt;&amp;nbsp; run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;After the SAS Code node, continue your modeling flow.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Some customers prefer to perform re-coding in the ETL process that prepares the SAS data set before it is used in Enterprise Miner, rather than performing the re-coding in Enterprise Miner.&amp;nbsp; Use whichever approach you prefer.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have a good week!&lt;/P&gt;</description>
    <pubDate>Mon, 18 Dec 2017 15:39:43 GMT</pubDate>
    <dc:creator>MikeStockstill</dc:creator>
    <dc:date>2017-12-18T15:39:43Z</dc:date>
    <item>
      <title>Replacement of value of a variable with condition on the value of another variable</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Replacement-of-value-of-a-variable-with-condition-on-the-value/m-p/421751#M6469</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am new at SAS Enterprise Miner 14.1.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to do a replacement of values for a variable of the value of another value is 0.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;E.g.&lt;/P&gt;&lt;P&gt;Car Ownership (Binary)&lt;/P&gt;&lt;P&gt;Car Value (Interval)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to clear the Car Value value for all rows that Car Ownership = 0.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Zhi Wei&lt;/P&gt;</description>
      <pubDate>Sat, 16 Dec 2017 05:46:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Replacement-of-value-of-a-variable-with-condition-on-the-value/m-p/421751#M6469</guid>
      <dc:creator>gzhiwei</dc:creator>
      <dc:date>2017-12-16T05:46:55Z</dc:date>
    </item>
    <item>
      <title>Re: Replacement of value of a variable with condition on the value of another variable</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Replacement-of-value-of-a-variable-with-condition-on-the-value/m-p/422007#M6474</link>
      <description>&lt;P&gt;Hello&amp;nbsp;Zhi Wei -&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By "clear the value", it sounds like you mean that you want to replace car values of 0 with a missing value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One approach is to connect a SAS Code node to your flow, and write code to perform the replacement.&amp;nbsp; Select the Code Editor property of the SAS Code node, and try code like this (let car_value be the variable name that corresponds to 'car value'):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data &amp;amp;em_export_train;&lt;BR /&gt;&amp;nbsp; set &amp;amp;EM_IMPORT_DATA;&lt;BR /&gt;&amp;nbsp; if car_value=0 then car_value=.;&lt;BR /&gt;&amp;nbsp; run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;After the SAS Code node, continue your modeling flow.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Some customers prefer to perform re-coding in the ETL process that prepares the SAS data set before it is used in Enterprise Miner, rather than performing the re-coding in Enterprise Miner.&amp;nbsp; Use whichever approach you prefer.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have a good week!&lt;/P&gt;</description>
      <pubDate>Mon, 18 Dec 2017 15:39:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Replacement-of-value-of-a-variable-with-condition-on-the-value/m-p/422007#M6474</guid>
      <dc:creator>MikeStockstill</dc:creator>
      <dc:date>2017-12-18T15:39:43Z</dc:date>
    </item>
  </channel>
</rss>

