<?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 delete values from different variables from one dataset in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/How-to-delete-values-from-different-variables-from-one-dataset/m-p/515437#M2918</link>
    <description>You'll likely want to switch to arrays as well:&lt;BR /&gt;&lt;A href="https://stats.idre.ucla.edu/sas/seminars/sas-arrays/" target="_blank"&gt;https://stats.idre.ucla.edu/sas/seminars/sas-arrays/&lt;/A&gt;</description>
    <pubDate>Thu, 22 Nov 2018 20:51:52 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-11-22T20:51:52Z</dc:date>
    <item>
      <title>How to delete values from different variables from one dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-delete-values-from-different-variables-from-one-dataset/m-p/515430#M2915</link>
      <description>&lt;P&gt;Let me begin by saying I am just starting to learn how to program.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a good size dataset with 14017 observations and 375 variables.&lt;/P&gt;&lt;P&gt;There are 10 variables of interest where I want to delete different values (they are characters)&lt;/P&gt;&lt;P&gt;Variables are CONCPT1, CONCPT2, ans so forth until CONCPT10 and values are hundreds of different values (i.e. 32551, 32160, 38746, 21620 and so on).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried the IF then delete statement with success if I include one value such as:&lt;/P&gt;&lt;P&gt;data pd6; set pd5;&lt;/P&gt;&lt;P&gt;if CONCPT1 = '32551' then delete;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I want to delete hundreds of values from different variables (CONCPT1 - CONCPT10) and when I try to include more I receive an error (missing an operator or an incorrect answer)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried including more values to the IF statement but the result is not accurate.&amp;nbsp; For example:&lt;/P&gt;&lt;P&gt;data pd6; set pd5;&lt;/P&gt;&lt;P&gt;if CONCPT1 = '32551' '32160' '38746' then delete;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please let me know if I can be of any help with more information.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;JG&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Nov 2018 20:33:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-delete-values-from-different-variables-from-one-dataset/m-p/515430#M2915</guid>
      <dc:creator>Jarot741</dc:creator>
      <dc:date>2018-11-22T20:33:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to delete values from different variables from one dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-delete-values-from-different-variables-from-one-dataset/m-p/515434#M2916</link>
      <description>&lt;P&gt;You need an "IN" operator with comma in between.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data pd6; set pd5;&lt;/P&gt;
&lt;P&gt;if CONCPT1 in ( '32551', '32160', '38746') then delete;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Nov 2018 20:48:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-delete-values-from-different-variables-from-one-dataset/m-p/515434#M2916</guid>
      <dc:creator>saslove</dc:creator>
      <dc:date>2018-11-22T20:48:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to delete values from different variables from one dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-delete-values-from-different-variables-from-one-dataset/m-p/515437#M2918</link>
      <description>You'll likely want to switch to arrays as well:&lt;BR /&gt;&lt;A href="https://stats.idre.ucla.edu/sas/seminars/sas-arrays/" target="_blank"&gt;https://stats.idre.ucla.edu/sas/seminars/sas-arrays/&lt;/A&gt;</description>
      <pubDate>Thu, 22 Nov 2018 20:51:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-delete-values-from-different-variables-from-one-dataset/m-p/515437#M2918</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-11-22T20:51:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to delete values from different variables from one dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-delete-values-from-different-variables-from-one-dataset/m-p/515486#M2933</link>
      <description>&lt;P&gt;Thank you so much!&lt;/P&gt;</description>
      <pubDate>Fri, 23 Nov 2018 05:26:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-delete-values-from-different-variables-from-one-dataset/m-p/515486#M2933</guid>
      <dc:creator>Jarot741</dc:creator>
      <dc:date>2018-11-23T05:26:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to delete values from different variables from one dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-delete-values-from-different-variables-from-one-dataset/m-p/515487#M2934</link>
      <description>&lt;P&gt;Thank you so much! I will look into it!&lt;/P&gt;</description>
      <pubDate>Fri, 23 Nov 2018 05:26:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-delete-values-from-different-variables-from-one-dataset/m-p/515487#M2934</guid>
      <dc:creator>Jarot741</dc:creator>
      <dc:date>2018-11-23T05:26:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to delete values from different variables from one dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-delete-values-from-different-variables-from-one-dataset/m-p/515511#M2938</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/1717"&gt;@saslove&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;You need an "IN" operator with comma in between.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data pd6; set pd5;&lt;/P&gt;
&lt;P&gt;if CONCPT1 in ( '32551', '32160', '38746') then delete;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Commas are not required, blanks are sufficient.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Nov 2018 09:33:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-delete-values-from-different-variables-from-one-dataset/m-p/515511#M2938</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2018-11-23T09:33:09Z</dc:date>
    </item>
  </channel>
</rss>

