<?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: IS THERE ANY FUNCTION TO REPLACE VALUE &amp;quot;0&amp;quot; TO Missing for entire dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/IS-THERE-ANY-FUNCTION-TO-REPLACE-VALUE-quot-0-quot-TO-Missing/m-p/119458#M259596</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If there are multiple variables in the dataset that need to be converted you could combine &lt;A __default_attr="807378" __jive_macro_name="user" class="jive_macro jive_macro_user" href="https://communities.sas.com/"&gt;&lt;/A&gt; post with an array:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data new;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; drop i j;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set old;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; array c(*) _char_; /*or all your char variables that need to be converted*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; array n(*) _numeric_; /*or all your numeric variables that need to be converted*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do i = 1 to hbound(c); /*sets the defined char vars where 0 to blank*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if c(i) = "0" then c(i) = "";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do j = 1 to hbound(n); /*sets the defined numeric variables where 0 to missing*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if n(j)=0 then n(j)=.;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EJ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 26 Jun 2013 12:25:13 GMT</pubDate>
    <dc:creator>esjackso</dc:creator>
    <dc:date>2013-06-26T12:25:13Z</dc:date>
    <item>
      <title>IS THERE ANY FUNCTION TO REPLACE VALUE "0" TO Missing for entire dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IS-THERE-ANY-FUNCTION-TO-REPLACE-VALUE-quot-0-quot-TO-Missing/m-p/119453#M259591</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;IS THERE ANY FUNCTION TO REPLACE VALUE "0" TO Missing for entire dataset&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Jun 2013 11:43:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IS-THERE-ANY-FUNCTION-TO-REPLACE-VALUE-quot-0-quot-TO-Missing/m-p/119453#M259591</guid>
      <dc:creator>venkatard</dc:creator>
      <dc:date>2013-06-26T11:43:19Z</dc:date>
    </item>
    <item>
      <title>Re: IS THERE ANY FUNCTION TO REPLACE VALUE "0" TO Missing for entire dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IS-THERE-ANY-FUNCTION-TO-REPLACE-VALUE-quot-0-quot-TO-Missing/m-p/119454#M259592</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;not a function...but...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;update ds1&lt;/P&gt;&lt;P&gt;set col1=null where col1=0;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Jun 2013 11:48:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IS-THERE-ANY-FUNCTION-TO-REPLACE-VALUE-quot-0-quot-TO-Missing/m-p/119454#M259592</guid>
      <dc:creator>DBailey</dc:creator>
      <dc:date>2013-06-26T11:48:18Z</dc:date>
    </item>
    <item>
      <title>Re: IS THERE ANY FUNCTION TO REPLACE VALUE "0" TO Missing for entire dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IS-THERE-ANY-FUNCTION-TO-REPLACE-VALUE-quot-0-quot-TO-Missing/m-p/119455#M259593</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this just for one column in a data set, if yes then a simple solution would be to use a data step including the following line of code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;if my_var=0 then my_var=.;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did notice that you surrounded the zero value with quotes ("0"), so if it is a character variable then you could use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;if my_var="0" then my_var="";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amir.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Jun 2013 11:51:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IS-THERE-ANY-FUNCTION-TO-REPLACE-VALUE-quot-0-quot-TO-Missing/m-p/119455#M259593</guid>
      <dc:creator>Amir</dc:creator>
      <dc:date>2013-06-26T11:51:37Z</dc:date>
    </item>
    <item>
      <title>Re: IS THERE ANY FUNCTION TO REPLACE VALUE "0" TO Missing for entire dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IS-THERE-ANY-FUNCTION-TO-REPLACE-VALUE-quot-0-quot-TO-Missing/m-p/119456#M259594</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For a function you could conditionally use in a data step:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;call missing(my_var);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and it wouldn't matter if the variable is numeric or character.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amir.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Amir Malik - added data step reference.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Jun 2013 11:55:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IS-THERE-ANY-FUNCTION-TO-REPLACE-VALUE-quot-0-quot-TO-Missing/m-p/119456#M259594</guid>
      <dc:creator>Amir</dc:creator>
      <dc:date>2013-06-26T11:55:49Z</dc:date>
    </item>
    <item>
      <title>Re: IS THERE ANY FUNCTION TO REPLACE VALUE "0" TO Missing for entire dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IS-THERE-ANY-FUNCTION-TO-REPLACE-VALUE-quot-0-quot-TO-Missing/m-p/119457#M259595</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to replace for all the variables. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Jun 2013 12:23:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IS-THERE-ANY-FUNCTION-TO-REPLACE-VALUE-quot-0-quot-TO-Missing/m-p/119457#M259595</guid>
      <dc:creator>venkatard</dc:creator>
      <dc:date>2013-06-26T12:23:56Z</dc:date>
    </item>
    <item>
      <title>Re: IS THERE ANY FUNCTION TO REPLACE VALUE "0" TO Missing for entire dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IS-THERE-ANY-FUNCTION-TO-REPLACE-VALUE-quot-0-quot-TO-Missing/m-p/119458#M259596</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If there are multiple variables in the dataset that need to be converted you could combine &lt;A __default_attr="807378" __jive_macro_name="user" class="jive_macro jive_macro_user" href="https://communities.sas.com/"&gt;&lt;/A&gt; post with an array:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data new;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; drop i j;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set old;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; array c(*) _char_; /*or all your char variables that need to be converted*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; array n(*) _numeric_; /*or all your numeric variables that need to be converted*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do i = 1 to hbound(c); /*sets the defined char vars where 0 to blank*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if c(i) = "0" then c(i) = "";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do j = 1 to hbound(n); /*sets the defined numeric variables where 0 to missing*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if n(j)=0 then n(j)=.;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EJ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Jun 2013 12:25:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IS-THERE-ANY-FUNCTION-TO-REPLACE-VALUE-quot-0-quot-TO-Missing/m-p/119458#M259596</guid>
      <dc:creator>esjackso</dc:creator>
      <dc:date>2013-06-26T12:25:13Z</dc:date>
    </item>
    <item>
      <title>Re: IS THERE ANY FUNCTION TO REPLACE VALUE "0" TO Missing for entire dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IS-THERE-ANY-FUNCTION-TO-REPLACE-VALUE-quot-0-quot-TO-Missing/m-p/119459#M259597</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This will only replace for one variable. I need to replace for entire dataset&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Jun 2013 12:25:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IS-THERE-ANY-FUNCTION-TO-REPLACE-VALUE-quot-0-quot-TO-Missing/m-p/119459#M259597</guid>
      <dc:creator>venkatard</dc:creator>
      <dc:date>2013-06-26T12:25:29Z</dc:date>
    </item>
  </channel>
</rss>

