<?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: Changing values in a large dataset but keeping others in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Changing-values-in-a-large-dataset-but-keeping-others/m-p/399688#M25696</link>
    <description>&lt;P&gt;Assuming you have a dataset called YesNames of names for which you want to change Is_valid to Yes, you could use a SQL UPDATE query to change the values in your table without creating a new table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;proc sql;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;update myTable&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;set is_valid = "Yes" where name in (select name from YesNames);&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;quit;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 29 Sep 2017 03:21:57 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2017-09-29T03:21:57Z</dc:date>
    <item>
      <title>Changing values in a large dataset but keeping others</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Changing-values-in-a-large-dataset-but-keeping-others/m-p/399664#M25691</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a dataset of names and information for a 5 month period. &amp;nbsp;The names in the dataset have one row of information per month. For example, John Smith has 5 rows of information: Jan, Feb, March, April, and May data. &amp;nbsp;One column is "Is_Valid". &amp;nbsp;Looking at all of the records there are different "Is_Valid" values depending on the month. &amp;nbsp;John Smith, for example, has "Is_Valid" values of "Yes" and "No" depending on the month. &amp;nbsp;I want to change John Smith's "Is_Valid" value to "Yes" for all 5 months but keep other individual records as is.&lt;/P&gt;&lt;P&gt;Is there a way to do this so that going forward if I want to change another individauls "Is_Valid" value, for example, Tom Smith to "Yes" for all 5 months I can do that as well?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;My thought was to have an excel document where I can enter names of people to import into SAS so that it can be easily updated. I'm not sure how I would be able to change the information while keeping the other data the same.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Hopefully this makes sense.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 29 Sep 2017 00:25:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Changing-values-in-a-large-dataset-but-keeping-others/m-p/399664#M25691</guid>
      <dc:creator>mmagnuson</dc:creator>
      <dc:date>2017-09-29T00:25:30Z</dc:date>
    </item>
    <item>
      <title>Re: Changing values in a large dataset but keeping others</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Changing-values-in-a-large-dataset-but-keeping-others/m-p/399667#M25692</link>
      <description>&lt;P&gt;Try ths.....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
  create table want as
  select id, month, is_valid, max(is_valid) as is_valid_now
from HAVE
group by id;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Note that i created a new variable is_valid_now for you to see what happened.&amp;nbsp; You can change this to&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; select id, month, max(is_valid) as is_valid&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps, kabayan?&lt;/P&gt;</description>
      <pubDate>Fri, 29 Sep 2017 00:58:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Changing-values-in-a-large-dataset-but-keeping-others/m-p/399667#M25692</guid>
      <dc:creator>ShiroAmada</dc:creator>
      <dc:date>2017-09-29T00:58:01Z</dc:date>
    </item>
    <item>
      <title>Re: Changing values in a large dataset but keeping others</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Changing-values-in-a-large-dataset-but-keeping-others/m-p/399688#M25696</link>
      <description>&lt;P&gt;Assuming you have a dataset called YesNames of names for which you want to change Is_valid to Yes, you could use a SQL UPDATE query to change the values in your table without creating a new table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;proc sql;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;update myTable&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;set is_valid = "Yes" where name in (select name from YesNames);&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;quit;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Sep 2017 03:21:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Changing-values-in-a-large-dataset-but-keeping-others/m-p/399688#M25696</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2017-09-29T03:21:57Z</dc:date>
    </item>
    <item>
      <title>Re: Changing values in a large dataset but keeping others</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Changing-values-in-a-large-dataset-but-keeping-others/m-p/399743#M25700</link>
      <description>&lt;P&gt;Is there a way to update the table like that using the query builder?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Sep 2017 11:40:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Changing-values-in-a-large-dataset-but-keeping-others/m-p/399743#M25700</guid>
      <dc:creator>mmagnuson</dc:creator>
      <dc:date>2017-09-29T11:40:12Z</dc:date>
    </item>
    <item>
      <title>Re: Changing values in a large dataset but keeping others</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Changing-values-in-a-large-dataset-but-keeping-others/m-p/399811#M25707</link>
      <description>&lt;P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data class;
 set sashelp.class;
run;
data class;
 modify class;
 if age=14 then name='xx';
 run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR data-mce-bogus="1" /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Sep 2017 14:40:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Changing-values-in-a-large-dataset-but-keeping-others/m-p/399811#M25707</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-09-29T14:40:43Z</dc:date>
    </item>
    <item>
      <title>Re: Changing values in a large dataset but keeping others</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Changing-values-in-a-large-dataset-but-keeping-others/m-p/399825#M25712</link>
      <description>&lt;P&gt;So I imported an excel sheet that had the names of individuals and created a computed column of "Is_Valid" and had a case statement for t1 Name = t2Name show "YES" else "t2.IS_Valid"&amp;nbsp; and it worked.&amp;nbsp; So I renamed the computed column to "Is_Valid" and took out the original "Is_Valid" column from the new dataste.&amp;nbsp;&amp;nbsp;I then&amp;nbsp;edited my&amp;nbsp;program so that it&amp;nbsp;is "FROM New.Dataset isntead of "Dataset" but now&amp;nbsp;my program errors because it says that there is no "Is_Valid" column....is it because the old column was a categorical variable and this one is a computed column? Is there a way to fix this easily? Or did I do something wrong?&lt;/P&gt;</description>
      <pubDate>Fri, 29 Sep 2017 15:11:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Changing-values-in-a-large-dataset-but-keeping-others/m-p/399825#M25712</guid>
      <dc:creator>mmagnuson</dc:creator>
      <dc:date>2017-09-29T15:11:26Z</dc:date>
    </item>
    <item>
      <title>Re: Changing values in a large dataset but keeping others</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Changing-values-in-a-large-dataset-but-keeping-others/m-p/399835#M25713</link>
      <description>&lt;P&gt;Nevermind. I had one letter capitalized that was supposed to be lowercased..... gotta love SAS not letting you get away with anything.&lt;/P&gt;&lt;P&gt;Thanks for your help everyone!&lt;/P&gt;</description>
      <pubDate>Fri, 29 Sep 2017 15:40:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Changing-values-in-a-large-dataset-but-keeping-others/m-p/399835#M25713</guid>
      <dc:creator>mmagnuson</dc:creator>
      <dc:date>2017-09-29T15:40:39Z</dc:date>
    </item>
  </channel>
</rss>

