<?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: How to change a specific string value in the entire data set? in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-change-a-specific-string-value-in-the-entire-data-set/m-p/387517#M24977</link>
    <description>&lt;P&gt;I thought it might be easier solution in PROC SQL, I will try yours next week. Thanks.&lt;/P&gt;</description>
    <pubDate>Fri, 11 Aug 2017 22:56:49 GMT</pubDate>
    <dc:creator>KubiK888</dc:creator>
    <dc:date>2017-08-11T22:56:49Z</dc:date>
    <item>
      <title>How to change a specific string value in the entire data set?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-change-a-specific-string-value-in-the-entire-data-set/m-p/387504#M24969</link>
      <description>&lt;P&gt;Say, I want to change string "missing" into acutal missing "". I know how to do it for a single variable, but how can I do it for an entire working dataset?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;.........................................&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;BR /&gt;CREATE TABLE WORK.SOME_DATA_01 AS&lt;BR /&gt;SELECT t1.someid,&lt;/P&gt;&lt;P&gt;(CASE&lt;BR /&gt;WHEN 'missing' = t1.postal_code THEN ''&lt;BR /&gt;ELSE t1.postal_code)&lt;BR /&gt;END) LABEL="Postal_code" AS postal_code_v2&lt;/P&gt;&lt;P&gt;etc&lt;/P&gt;&lt;P&gt;FROM WORK.TABLE t1;&lt;/P&gt;&lt;P&gt;QUIT;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Aug 2017 22:29:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-change-a-specific-string-value-in-the-entire-data-set/m-p/387504#M24969</guid>
      <dc:creator>KubiK888</dc:creator>
      <dc:date>2017-08-11T22:29:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to change a specific string value in the entire data set?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-change-a-specific-string-value-in-the-entire-data-set/m-p/387505#M24970</link>
      <description>&lt;P&gt;Do you mean something like this is what you are after?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data&lt;/STRONG&gt; want;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;array s _char_;&lt;/P&gt;&lt;P&gt;do _n_=&lt;STRONG&gt;1&lt;/STRONG&gt; to dim(s);&lt;/P&gt;&lt;P&gt;if s(_n_)="missing" then call missing(s(_n_));&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Aug 2017 21:58:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-change-a-specific-string-value-in-the-entire-data-set/m-p/387505#M24970</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2017-08-11T21:58:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to change a specific string value in the entire data set?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-change-a-specific-string-value-in-the-entire-data-set/m-p/387506#M24971</link>
      <description>Sorry, forgot to mention, can it be done within the PROC SQL statement?</description>
      <pubDate>Fri, 11 Aug 2017 22:01:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-change-a-specific-string-value-in-the-entire-data-set/m-p/387506#M24971</guid>
      <dc:creator>KubiK888</dc:creator>
      <dc:date>2017-08-11T22:01:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to change a specific string value in the entire data set?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-change-a-specific-string-value-in-the-entire-data-set/m-p/387507#M24972</link>
      <description>&lt;P&gt;How about without even changing the data? You can set a format to display just about any value you have in a desired form without modifying data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Proc format library=work;
value $missing (default=25)
"missing"=' '

;
run;

data example;
   input text $;
datalines;
Some
words
are 
missing
how
about
that
;
run;

proc print data=example noobs;
   format text $missing.;
run;
   &lt;/PRE&gt;
&lt;P&gt;the default setting should be large enough to display other expected values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Aug 2017 22:07:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-change-a-specific-string-value-in-the-entire-data-set/m-p/387507#M24972</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-08-11T22:07:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to change a specific string value in the entire data set?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-change-a-specific-string-value-in-the-entire-data-set/m-p/387509#M24973</link>
      <description>I want to change the value within the dataset. I have updated my code in original post.</description>
      <pubDate>Fri, 11 Aug 2017 22:10:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-change-a-specific-string-value-in-the-entire-data-set/m-p/387509#M24973</guid>
      <dc:creator>KubiK888</dc:creator>
      <dc:date>2017-08-11T22:10:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to change a specific string value in the entire data set?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-change-a-specific-string-value-in-the-entire-data-set/m-p/387511#M24974</link>
      <description>&lt;P&gt;Can you share the sql code of yours that you did for one variable please?&lt;/P&gt;</description>
      <pubDate>Fri, 11 Aug 2017 22:23:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-change-a-specific-string-value-in-the-entire-data-set/m-p/387511#M24974</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2017-08-11T22:23:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to change a specific string value in the entire data set?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-change-a-specific-string-value-in-the-entire-data-set/m-p/387512#M24975</link>
      <description>Please see updated codes above.</description>
      <pubDate>Fri, 11 Aug 2017 22:30:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-change-a-specific-string-value-in-the-entire-data-set/m-p/387512#M24975</guid>
      <dc:creator>KubiK888</dc:creator>
      <dc:date>2017-08-11T22:30:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to change a specific string value in the entire data set?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-change-a-specific-string-value-in-the-entire-data-set/m-p/387516#M24976</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/149300"&gt;@KubiK888&lt;/a&gt; wrote:&lt;BR /&gt;I want to change the value within the dataset. I have updated my code in original post.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;With your question "Say, I want to change string "missing" into acutal missing "". I know how to do it for a single variable, but how can I do it for an entire working dataset?"&lt;/P&gt;
&lt;P&gt;Are you actually asking how to do this to many different varaibles within a data set?&lt;/P&gt;
&lt;P&gt;This is really much easier in a data step with an Array, the basic tool for doing the same thing to mulitple variables:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; array _m_ textvar1 textvar3 othertextvar;&amp;nbsp; /* list of variables to modify after the array name "_m_". If you have a variable named _m_ use something else*/&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; do i = 1 to dim(_m_);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if _m_[i] = 'missing' then call missing( _m_[i] );&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; drop i;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Other wise you will have either type out all the case statments or wander into macro language and add complexity to a simple task.&lt;/P&gt;
&lt;P&gt;And to make the above even simpler if you want to do this to every single character varaible in the dataset then define the array as:&lt;/P&gt;
&lt;P&gt;array _m_&amp;nbsp; _character_;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Aug 2017 22:52:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-change-a-specific-string-value-in-the-entire-data-set/m-p/387516#M24976</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-08-11T22:52:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to change a specific string value in the entire data set?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-change-a-specific-string-value-in-the-entire-data-set/m-p/387517#M24977</link>
      <description>&lt;P&gt;I thought it might be easier solution in PROC SQL, I will try yours next week. Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Aug 2017 22:56:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-change-a-specific-string-value-in-the-entire-data-set/m-p/387517#M24977</guid>
      <dc:creator>KubiK888</dc:creator>
      <dc:date>2017-08-11T22:56:49Z</dc:date>
    </item>
  </channel>
</rss>

