<?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: Replace value in the whole table in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Replace-value-in-the-whole-table/m-p/128358#M10557</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN class="j-post-author "&gt;&lt;STRONG&gt;&lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" data-avatarid="1510" data-externalid="" data-presence="null" data-userid="9792" data-username="Jagadishkatam" href="https://communities.sas.com/people/Jagadishkatam" id="jive-97923341016873591786"&gt;Jagadishkatam&lt;/A&gt;&lt;/STRONG&gt;&lt;/SPAN&gt; 's code is OK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Two kinds of variable may be need to be considered&amp;nbsp; if you had characteristic var code as '9999'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;array num(*)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _numeric_;&lt;/P&gt;&lt;P&gt;array char(*) $100&amp;nbsp; _character_;&lt;/P&gt;&lt;P&gt;do i=1 to dim(num);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if num(i)=9999 then call missing(num(i));&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;do j=1 to dim(char);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* corrected* /&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;if char(j)='9999' then call missing(char(j));&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 30 Oct 2013 07:59:17 GMT</pubDate>
    <dc:creator>HongqiuGu</dc:creator>
    <dc:date>2013-10-30T07:59:17Z</dc:date>
    <item>
      <title>Replace value in the whole table</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Replace-value-in-the-whole-table/m-p/128356#M10555</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I cannot find any option in SAS E-Guide or E-Miner to replace fixed value in the whole table at once, not only in one column. For example, I have table containing 600 variables and some of them (not all) have -9999 among other values representing missing value. I want to replace -9999 with nothing or empty cell. Clear that It is impossible to do for every variable one by one. Is there any code to do it automatically?&lt;/P&gt;&lt;P&gt;ise&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Oct 2013 07:34:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Replace-value-in-the-whole-table/m-p/128356#M10555</guid>
      <dc:creator>Dataminer</dc:creator>
      <dc:date>2013-10-30T07:34:53Z</dc:date>
    </item>
    <item>
      <title>Re: Replace value in the whole table</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Replace-value-in-the-whole-table/m-p/128357#M10556</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you can use arrays like below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;array var(*) var1-var600;&lt;/P&gt;&lt;P&gt;do i = 1 to dim(var);&lt;/P&gt;&lt;P&gt;if var(i)=-9999 then var(i)=.;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jagadish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Oct 2013 07:39:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Replace-value-in-the-whole-table/m-p/128357#M10556</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2013-10-30T07:39:12Z</dc:date>
    </item>
    <item>
      <title>Re: Replace value in the whole table</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Replace-value-in-the-whole-table/m-p/128358#M10557</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN class="j-post-author "&gt;&lt;STRONG&gt;&lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" data-avatarid="1510" data-externalid="" data-presence="null" data-userid="9792" data-username="Jagadishkatam" href="https://communities.sas.com/people/Jagadishkatam" id="jive-97923341016873591786"&gt;Jagadishkatam&lt;/A&gt;&lt;/STRONG&gt;&lt;/SPAN&gt; 's code is OK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Two kinds of variable may be need to be considered&amp;nbsp; if you had characteristic var code as '9999'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;array num(*)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _numeric_;&lt;/P&gt;&lt;P&gt;array char(*) $100&amp;nbsp; _character_;&lt;/P&gt;&lt;P&gt;do i=1 to dim(num);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if num(i)=9999 then call missing(num(i));&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;do j=1 to dim(char);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* corrected* /&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;if char(j)='9999' then call missing(char(j));&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Oct 2013 07:59:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Replace-value-in-the-whole-table/m-p/128358#M10557</guid>
      <dc:creator>HongqiuGu</dc:creator>
      <dc:date>2013-10-30T07:59:17Z</dc:date>
    </item>
    <item>
      <title>Re: Replace value in the whole table</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Replace-value-in-the-whole-table/m-p/128359#M10558</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunately I know very little about SAS programming (will definitely take a course in future) and don't quite understand this code. If I write the following in Guide:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data xxx;&lt;/P&gt;&lt;P&gt;set yyy;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;array num(*) _numeric_;&lt;/P&gt;&lt;P&gt;array char(*) $100 _character_;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do i=1 to dim(num(i));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if num(i)=-9999 then call missing(num(i));&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;do j=1 to dim(char(j));&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; if char(j)=-9999 then call missing(char(j));&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I get error:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;21&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do i=1 to dim(num(i));&lt;/P&gt;&lt;P&gt;ERROR: The DIM, LBOUND, and HBOUND functions require an array name for the first argument.&lt;/P&gt;&lt;P&gt;22&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; if num(i)=-999997 then call missing(num(i));&lt;/P&gt;&lt;P&gt;23&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;24&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do j=1 to dim(char(j));&lt;/P&gt;&lt;P&gt;ERROR: The DIM, LBOUND, and HBOUND functions require an array name for the first argument.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What should be corrected here? Should num(*) and char(*) be written like that or there have to be variable names inside the brackets?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Oct 2013 08:26:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Replace-value-in-the-whole-table/m-p/128359#M10558</guid>
      <dc:creator>Dataminer</dc:creator>
      <dc:date>2013-10-30T08:26:17Z</dc:date>
    </item>
    <item>
      <title>Re: Replace value in the whole table</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Replace-value-in-the-whole-table/m-p/128360#M10559</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;pls try my updated code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Oct 2013 08:34:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Replace-value-in-the-whole-table/m-p/128360#M10559</guid>
      <dc:creator>HongqiuGu</dc:creator>
      <dc:date>2013-10-30T08:34:27Z</dc:date>
    </item>
    <item>
      <title>Re: Replace value in the whole table</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Replace-value-in-the-whole-table/m-p/128361#M10560</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much for your time! Now code works and I am happy!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Oct 2013 09:26:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Replace-value-in-the-whole-table/m-p/128361#M10560</guid>
      <dc:creator>Dataminer</dc:creator>
      <dc:date>2013-10-30T09:26:10Z</dc:date>
    </item>
    <item>
      <title>Re: Replace value in the whole table</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Replace-value-in-the-whole-table/m-p/128362#M10561</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 with SAS Guide - it reads data formats incorrectly - numeric data (values from 0 to 9) format is character/string.&lt;/P&gt;&lt;P&gt;Can you suggest any code expression which converts variable format with values from 0 to 9 to numeric in the whole table?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 07:27:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Replace-value-in-the-whole-table/m-p/128362#M10561</guid>
      <dc:creator>Dataminer</dc:creator>
      <dc:date>2014-10-09T07:27:58Z</dc:date>
    </item>
    <item>
      <title>Re: Replace value in the whole table</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Replace-value-in-the-whole-table/m-p/677345#M36763</link>
      <description>&lt;P&gt;data work.example;&amp;nbsp; &amp;nbsp;#Table Name and where you will save&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;set work.example_2;&amp;nbsp; #The table where you read the data&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;array change _numeric_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; do over change;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if change = -9999 then change =. ; # You put the value that you want in this case&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;</description>
      <pubDate>Mon, 17 Aug 2020 20:24:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Replace-value-in-the-whole-table/m-p/677345#M36763</guid>
      <dc:creator>Erick1215</dc:creator>
      <dc:date>2020-08-17T20:24:00Z</dc:date>
    </item>
    <item>
      <title>Re: Replace value in the whole table</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Replace-value-in-the-whole-table/m-p/677361#M36765</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/1422"&gt;@Dataminer&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi all&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a problem with SAS Guide - it reads data formats incorrectly - numeric data (values from 0 to 9) format is character/string.&lt;/P&gt;
&lt;P&gt;Can you suggest any code expression which converts variable format with values from 0 to 9 to numeric in the whole table?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Many thanks&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Do you mean Enterprise Guide?&amp;nbsp; That is a tool for running SAS code.&lt;/P&gt;
&lt;P&gt;SAS has two variable types, floating point numbers and fixed length character strings. The format attached to a variable is just instructions for how to display to values as text.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are reading an existing SAS dataset then it will NOT change the type of the variable (or the format attached to it either).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Did you convert some other file type into a SAS dateset?&amp;nbsp; If so what type of file?&amp;nbsp; If you asked EG to import a text file it will guess how to define each variable based on what it sees in that field of the text file.&amp;nbsp; If you asked EG to import a spreadsheet then any character value in any cell in the column will force SAS to treat that variable as text.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Aug 2020 22:02:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Replace-value-in-the-whole-table/m-p/677361#M36765</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-08-17T22:02:34Z</dc:date>
    </item>
  </channel>
</rss>

