<?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: selecting observations with value of interest appearing in more than one variable in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/selecting-observations-with-value-of-interest-appearing-in-more/m-p/839261#M36343</link>
    <description>You should mark Tom's solution as the correct one, not your own response. You can unselect yours and then select his I believe.</description>
    <pubDate>Tue, 18 Oct 2022 18:58:56 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2022-10-18T18:58:56Z</dc:date>
    <item>
      <title>selecting observations with value of interest appearing in more than one variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/selecting-observations-with-value-of-interest-appearing-in-more/m-p/839240#M36338</link>
      <description>&lt;P&gt;The G codes&amp;nbsp;('G11','G111','G1110') are potential values in each of three variables/columns:&amp;nbsp; primary, secondary, and tertiary.&amp;nbsp;The 3 columns (primary, secondary, tertiary) in csv file are separate.&amp;nbsp; I want to create a new dataset by selecting observations with these G codes in variables: primary, secondary, and tertiary.&amp;nbsp; The code below with the use "OR"&amp;nbsp; does not work. How do I go about this? Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data tricolumns;&lt;BR /&gt;set EDPh;&lt;BR /&gt;if Primary Diagnosis in ('G11','G111','G1110') OR secondary&amp;nbsp;Diagnosis in ('G11','G111','G1110') OR tertiary&amp;nbsp;Diagnosis in ('G11','G111','G1110') ;&lt;/P&gt;&lt;P&gt;run;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2022 16:53:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/selecting-observations-with-value-of-interest-appearing-in-more/m-p/839240#M36338</guid>
      <dc:creator>femiajumobi1</dc:creator>
      <dc:date>2022-10-18T16:53:39Z</dc:date>
    </item>
    <item>
      <title>Re: selecting observations with value of interest appearing in more than one variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/selecting-observations-with-value-of-interest-appearing-in-more/m-p/839241#M36339</link>
      <description>&lt;P&gt;That code would work if you used valid variable names.&lt;/P&gt;
&lt;P&gt;So either use variable names that follow the rules (only contain digits letters or undescore and do not start with a digit).&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if PrimaryDiagnosis in ('G11','G111','G1110')
 OR secondaryDiagnosis in ('G11','G111','G1110')
 OR tertiaryDiagnosis in ('G11','G111','G1110') 
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Of if you have the VALIDVARNAME option set to ANY then use a name literal to reference those non-standard names.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if 'Primary Diagnosis'n in ('G11','G111','G1110')
 OR 'secondary Diagnosis'n in ('G11','G111','G1110')
 OR 'tertiary Diagnosis'n in ('G11','G111','G1110') 
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 18 Oct 2022 16:58:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/selecting-observations-with-value-of-interest-appearing-in-more/m-p/839241#M36339</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-10-18T16:58:25Z</dc:date>
    </item>
    <item>
      <title>Re: selecting observations with value of interest appearing in more than one variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/selecting-observations-with-value-of-interest-appearing-in-more/m-p/839244#M36340</link>
      <description>&lt;P&gt;Hi Tom, it worked, thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2022 17:35:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/selecting-observations-with-value-of-interest-appearing-in-more/m-p/839244#M36340</guid>
      <dc:creator>femiajumobi1</dc:creator>
      <dc:date>2022-10-18T17:35:11Z</dc:date>
    </item>
    <item>
      <title>Re: selecting observations with value of interest appearing in more than one variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/selecting-observations-with-value-of-interest-appearing-in-more/m-p/839245#M36341</link>
      <description>&lt;P&gt;If you require the G codes in any of the three diagnoses then the OR is correct.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you require all three diagnosis to have a G value then the condition should be AND&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2022 17:40:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/selecting-observations-with-value-of-interest-appearing-in-more/m-p/839245#M36341</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-10-18T17:40:42Z</dc:date>
    </item>
    <item>
      <title>Re: selecting observations with value of interest appearing in more than one variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/selecting-observations-with-value-of-interest-appearing-in-more/m-p/839248#M36342</link>
      <description>&lt;P&gt;Thanks, Reeza. I require the G codes in any of the three diagnoses.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2022 18:12:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/selecting-observations-with-value-of-interest-appearing-in-more/m-p/839248#M36342</guid>
      <dc:creator>femiajumobi1</dc:creator>
      <dc:date>2022-10-18T18:12:57Z</dc:date>
    </item>
    <item>
      <title>Re: selecting observations with value of interest appearing in more than one variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/selecting-observations-with-value-of-interest-appearing-in-more/m-p/839261#M36343</link>
      <description>You should mark Tom's solution as the correct one, not your own response. You can unselect yours and then select his I believe.</description>
      <pubDate>Tue, 18 Oct 2022 18:58:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/selecting-observations-with-value-of-interest-appearing-in-more/m-p/839261#M36343</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-10-18T18:58:56Z</dc:date>
    </item>
  </channel>
</rss>

