<?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 Upcase(group) in ('A','B') in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Upcase-group-in-A-B/m-p/707086#M26444</link>
    <description>&lt;P&gt;&lt;SPAN&gt;The question is:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI&gt;create a temporary data set,&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;cleandata36&lt;/STRONG&gt;.&lt;/LI&gt;&lt;LI&gt;In this data set, convert all&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;group&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;values to upper case.&lt;/LI&gt;&lt;LI&gt;Then keep only observations with&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;group&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;equal to 'A' or 'B'.&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;The answer is:&lt;/P&gt;&lt;P&gt;data work.cleandata36;&lt;BR /&gt;set cert.input36;&lt;BR /&gt;if upcase(group) in ('A','B');&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't understand since there is no 'then do' or anything after if upcase(group)in ('A', 'B'). Could you explain why? Thanks.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 18 Dec 2020 21:19:19 GMT</pubDate>
    <dc:creator>dooheekim01</dc:creator>
    <dc:date>2020-12-18T21:19:19Z</dc:date>
    <item>
      <title>Upcase(group) in ('A','B')</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Upcase-group-in-A-B/m-p/707086#M26444</link>
      <description>&lt;P&gt;&lt;SPAN&gt;The question is:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI&gt;create a temporary data set,&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;cleandata36&lt;/STRONG&gt;.&lt;/LI&gt;&lt;LI&gt;In this data set, convert all&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;group&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;values to upper case.&lt;/LI&gt;&lt;LI&gt;Then keep only observations with&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;group&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;equal to 'A' or 'B'.&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;The answer is:&lt;/P&gt;&lt;P&gt;data work.cleandata36;&lt;BR /&gt;set cert.input36;&lt;BR /&gt;if upcase(group) in ('A','B');&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't understand since there is no 'then do' or anything after if upcase(group)in ('A', 'B'). Could you explain why? Thanks.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Dec 2020 21:19:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Upcase-group-in-A-B/m-p/707086#M26444</guid>
      <dc:creator>dooheekim01</dc:creator>
      <dc:date>2020-12-18T21:19:19Z</dc:date>
    </item>
    <item>
      <title>Re: Upcase(group) in ('A','B')</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Upcase-group-in-A-B/m-p/707091#M26445</link>
      <description>&lt;P&gt;This is called&lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.5&amp;amp;docsetId=lestmtsref&amp;amp;docsetTarget=p1cxl8ifdt8u0gn12wqbji8o5fq1.htm&amp;amp;locale=en" target="_self"&gt; the "subsetting IF statement".&lt;/A&gt; It does not use a THEN clause. Think of it like a filter: Only observations that satisfy the IF condition are output to the data set.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Dec 2020 21:24:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Upcase-group-in-A-B/m-p/707091#M26445</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2020-12-18T21:24:29Z</dc:date>
    </item>
    <item>
      <title>Re: Upcase(group) in ('A','B')</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Upcase-group-in-A-B/m-p/707094#M26447</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/344418"&gt;@dooheekim01&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;SPAN&gt;The question is:&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;UL&gt;
&lt;LI&gt;create a temporary data set,&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;cleandata36&lt;/STRONG&gt;.&lt;/LI&gt;
&lt;LI&gt;In this data set, convert all&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;group&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;values to upper case.&lt;/LI&gt;
&lt;LI&gt;Then keep only observations with&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;group&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;equal to 'A' or 'B'.&lt;/LI&gt;
&lt;/UL&gt;
&lt;/UL&gt;
&lt;P&gt;The answer is:&lt;/P&gt;
&lt;P&gt;data work.cleandata36;&lt;BR /&gt;set cert.input36;&lt;BR /&gt;if upcase(group) in ('A','B');&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't understand since there is no 'then do' or anything after if upcase(group)in ('A', 'B'). Could you explain why? Thanks.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The code would work, except that it does not do this part of the question: "convert all&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;group&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;values to upper case", so the output data set could contain lowercase 'a' or lowercase 'b'. You need one more statement to make all the values uppercase.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Dec 2020 21:31:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Upcase-group-in-A-B/m-p/707094#M26447</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-12-18T21:31:04Z</dc:date>
    </item>
    <item>
      <title>Re: Upcase(group) in ('A','B')</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Upcase-group-in-A-B/m-p/707096#M26448</link>
      <description>&lt;P&gt;The IF without a then is called a subsetting IF. It means "only keep records if the condition is true".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BTW that is not actually a correct answer. There is nothing that makes the values upper case to keep.&lt;/P&gt;
&lt;P&gt;If the values are lower case they will still be so in the output.&lt;/P&gt;
&lt;PRE&gt;data junk;
  input group $;
datalines;
a
b
c
d
e
g
junk
;

data want;
   set junk;
   if upcase(group) in ('A','B');
run;&lt;/PRE&gt;
&lt;P&gt;Note that group = "a" and "b" are in the output.&lt;/P&gt;
&lt;P&gt;there should be a statement like:&lt;/P&gt;
&lt;PRE&gt;   group = upcase(group);&lt;/PRE&gt;
&lt;P&gt;if the values in the output set are supposed to be upper case.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Dec 2020 21:34:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Upcase-group-in-A-B/m-p/707096#M26448</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-12-18T21:34:32Z</dc:date>
    </item>
    <item>
      <title>Re: Upcase(group) in ('A','B')</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Upcase-group-in-A-B/m-p/707230#M26471</link>
      <description>&lt;P&gt;Thank you so much!&lt;/P&gt;</description>
      <pubDate>Sun, 20 Dec 2020 00:56:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Upcase-group-in-A-B/m-p/707230#M26471</guid>
      <dc:creator>dooheekim01</dc:creator>
      <dc:date>2020-12-20T00:56:37Z</dc:date>
    </item>
    <item>
      <title>Re: Upcase(group) in ('A','B')</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Upcase-group-in-A-B/m-p/707276#M26485</link>
      <description>&lt;P&gt;the similar omissions can be found in the following cases;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc sort data = scoredata_p;&lt;BR /&gt;by stu_id;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc sort data = scoredata;&lt;BR /&gt;by stu_id;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;data MMA;&lt;BR /&gt;merge scoredata_p(in = A) scoredata (in = B);&lt;BR /&gt;by stu_id;&lt;BR /&gt;if A and B;&lt;BR /&gt;run;&lt;/PRE&gt;
&lt;P&gt;in selected variable merge (stu_id), you can omit A=1 and B=1 in 'if' statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 20 Dec 2020 18:13:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Upcase-group-in-A-B/m-p/707276#M26485</guid>
      <dc:creator>anming</dc:creator>
      <dc:date>2020-12-20T18:13:41Z</dc:date>
    </item>
    <item>
      <title>Re: Upcase(group) in ('A','B')</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Upcase-group-in-A-B/m-p/760484#M30293</link>
      <description>&lt;P&gt;why it gives different answer if i use where statement instead of if statement.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Aug 2021 22:00:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Upcase-group-in-A-B/m-p/760484#M30293</guid>
      <dc:creator>TS4</dc:creator>
      <dc:date>2021-08-09T22:00:32Z</dc:date>
    </item>
    <item>
      <title>Re: Upcase(group) in ('A','B')</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Upcase-group-in-A-B/m-p/867015#M38350</link>
      <description>&lt;P&gt;I have another question for the upcase function and the in operator.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used:&lt;/P&gt;&lt;P&gt;Upcase(group) in (upcase('a'), upcase('b'));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But it does NOT work, showing error message.&lt;/P&gt;&lt;P&gt;Please help.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2023 14:28:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Upcase-group-in-A-B/m-p/867015#M38350</guid>
      <dc:creator>wwwz</dc:creator>
      <dc:date>2023-03-29T14:28:22Z</dc:date>
    </item>
    <item>
      <title>Re: Upcase(group) in ('A','B')</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Upcase-group-in-A-B/m-p/867023#M38351</link>
      <description>&lt;P&gt;As stated in &lt;A href="https://go.documentation.sas.com/doc/en/lrcon/9.4/p00iah2thp63bmn1lt20esag14lh.htm#p0xgxvo2we2mqrn1kteecpv1opx0" target="_self"&gt;the documentation for the IN operator&lt;/A&gt;, the list of values on the right side must be CONSTANT values, not expressions.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2023 14:36:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Upcase-group-in-A-B/m-p/867023#M38351</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2023-03-29T14:36:20Z</dc:date>
    </item>
    <item>
      <title>Re: Upcase(group) in ('A','B')</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Upcase-group-in-A-B/m-p/867034#M38353</link>
      <description>&lt;P&gt;Thanks, I see.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2023 14:43:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Upcase-group-in-A-B/m-p/867034#M38353</guid>
      <dc:creator>wwwz</dc:creator>
      <dc:date>2023-03-29T14:43:03Z</dc:date>
    </item>
  </channel>
</rss>

