<?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: Wanting to Only Keep Response that could be in Multiple Columns in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Wanting-to-Only-Keep-Response-that-could-be-in-Multiple-Columns/m-p/914868#M40957</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input Person $1. (_1st _2nd _3rd) (:$10.); /* _ added because variable can't atar with a number*/
cards;
A Pizza. Chicken. Fruit.
B Chicken. Pizza. Fruit.
C Fruit. Chicken. Fish.
;
run;
proc print;
run;

data want;
  set have;
  array food[*] _1st--_3rd;
  if "Pizza." in food;
run;
proc print;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 07 Feb 2024 14:58:56 GMT</pubDate>
    <dc:creator>yabwon</dc:creator>
    <dc:date>2024-02-07T14:58:56Z</dc:date>
    <item>
      <title>Wanting to Only Keep Response that could be in Multiple Columns</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Wanting-to-Only-Keep-Response-that-could-be-in-Multiple-Columns/m-p/914865#M40956</link>
      <description>Hello,&lt;BR /&gt;I want to only keep observations with a specific value that could be found in multiple columns. Example:&lt;BR /&gt;Person 1st 2nd 3rd&lt;BR /&gt;A Pizza. Chicken. Fruit&lt;BR /&gt;B. Chicken. Pizza. Fruit&lt;BR /&gt;C. Fruit. Chicken. Fish&lt;BR /&gt;&lt;BR /&gt;I want to only keep observations where pizza is a listed option regardless of what column it is in. There are 10+ columns so I didn’t want to do an if then for all those columns. Thank you so much!</description>
      <pubDate>Wed, 07 Feb 2024 14:51:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Wanting-to-Only-Keep-Response-that-could-be-in-Multiple-Columns/m-p/914865#M40956</guid>
      <dc:creator>Pauliet123</dc:creator>
      <dc:date>2024-02-07T14:51:32Z</dc:date>
    </item>
    <item>
      <title>Re: Wanting to Only Keep Response that could be in Multiple Columns</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Wanting-to-Only-Keep-Response-that-could-be-in-Multiple-Columns/m-p/914868#M40957</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input Person $1. (_1st _2nd _3rd) (:$10.); /* _ added because variable can't atar with a number*/
cards;
A Pizza. Chicken. Fruit.
B Chicken. Pizza. Fruit.
C Fruit. Chicken. Fish.
;
run;
proc print;
run;

data want;
  set have;
  array food[*] _1st--_3rd;
  if "Pizza." in food;
run;
proc print;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 07 Feb 2024 14:58:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Wanting-to-Only-Keep-Response-that-could-be-in-Multiple-Columns/m-p/914868#M40957</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2024-02-07T14:58:56Z</dc:date>
    </item>
    <item>
      <title>Re: Wanting to Only Keep Response that could be in Multiple Columns</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Wanting-to-Only-Keep-Response-that-could-be-in-Multiple-Columns/m-p/914874#M40958</link>
      <description>&lt;P&gt;Having a period after the value in columns 1 and 2, but not in column 3, seems to complicate this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/463579"&gt;@Pauliet123&lt;/a&gt;&amp;nbsp;&amp;nbsp;Is that really representative of the actual data? Or is that something you&amp;nbsp;just put in there while typing your original question and doesn't represent the actual data?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the actual data has periods in columns 1 and 2 but not in column 3, then the solution from&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/35763"&gt;@yabwon&lt;/a&gt;&amp;nbsp;fails if "Pizza" (with no period) appears in column 3.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;As always, good data layouts with repeatable formatting of the data makes programming easier. Unusual data layouts and/or inconsistent formatting of the data make programming harder.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2024 16:11:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Wanting-to-Only-Keep-Response-that-could-be-in-Multiple-Columns/m-p/914874#M40958</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-02-07T16:11:03Z</dc:date>
    </item>
  </channel>
</rss>

