<?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 question about variable containing both numbers and letters in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/question-about-variable-containing-both-numbers-and-letters/m-p/606713#M17428</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using SAS 9.4. I have a variable that contains both numbers and letters (example below). When I run proc contents, SAS is recognizing it as a character variable. However, when I go to make a new variable from this variable in a data step, I keep getting errors regardless of whether I put quotes around it or not. Any ideas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;99.2 Intubation&lt;/P&gt;&lt;P&gt;99.3 Bronchoscopy&lt;/P&gt;&lt;P&gt;99.4 Thoracentesis&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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>Sat, 23 Nov 2019 21:12:42 GMT</pubDate>
    <dc:creator>lmyers2</dc:creator>
    <dc:date>2019-11-23T21:12:42Z</dc:date>
    <item>
      <title>question about variable containing both numbers and letters</title>
      <link>https://communities.sas.com/t5/New-SAS-User/question-about-variable-containing-both-numbers-and-letters/m-p/606713#M17428</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using SAS 9.4. I have a variable that contains both numbers and letters (example below). When I run proc contents, SAS is recognizing it as a character variable. However, when I go to make a new variable from this variable in a data step, I keep getting errors regardless of whether I put quotes around it or not. Any ideas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;99.2 Intubation&lt;/P&gt;&lt;P&gt;99.3 Bronchoscopy&lt;/P&gt;&lt;P&gt;99.4 Thoracentesis&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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>Sat, 23 Nov 2019 21:12:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/question-about-variable-containing-both-numbers-and-letters/m-p/606713#M17428</guid>
      <dc:creator>lmyers2</dc:creator>
      <dc:date>2019-11-23T21:12:42Z</dc:date>
    </item>
    <item>
      <title>Re: question about variable containing both numbers and letters</title>
      <link>https://communities.sas.com/t5/New-SAS-User/question-about-variable-containing-both-numbers-and-letters/m-p/606717#M17429</link>
      <description>&lt;P&gt;Please show the log&lt;/P&gt;</description>
      <pubDate>Sat, 23 Nov 2019 21:41:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/question-about-variable-containing-both-numbers-and-letters/m-p/606717#M17429</guid>
      <dc:creator>r_behata</dc:creator>
      <dc:date>2019-11-23T21:41:10Z</dc:date>
    </item>
    <item>
      <title>Re: question about variable containing both numbers and letters</title>
      <link>https://communities.sas.com/t5/New-SAS-User/question-about-variable-containing-both-numbers-and-letters/m-p/606724#M17430</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/165633"&gt;@lmyers2&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;However, when I go to make a new variable from this variable in a data step, I keep getting errors regardless of whether I put quotes around it or not. Any ideas?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Your variable name is without quotes but the value must be in quotes and match exactly.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Post your code and error so we can help you figure out what to change.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if varName in ('99.2 Intubation', '99.3 Bronchoscopy') then category = 1;
else category = 2;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/165633"&gt;@lmyers2&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm using SAS 9.4. I have a variable that contains both numbers and letters (example below). When I run proc contents, SAS is recognizing it as a character variable. However, when I go to make a new variable from this variable in a data step, I keep getting errors regardless of whether I put quotes around it or not. Any ideas?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;99.2 Intubation&lt;/P&gt;
&lt;P&gt;99.3 Bronchoscopy&lt;/P&gt;
&lt;P&gt;99.4 Thoracentesis&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 23 Nov 2019 22:19:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/question-about-variable-containing-both-numbers-and-letters/m-p/606724#M17430</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-11-23T22:19:18Z</dc:date>
    </item>
    <item>
      <title>Re: question about variable containing both numbers and letters</title>
      <link>https://communities.sas.com/t5/New-SAS-User/question-about-variable-containing-both-numbers-and-letters/m-p/606731#M17431</link>
      <description>&lt;P&gt;You're right - it works if the variable is in quotes!&amp;nbsp; thanks!&lt;/P&gt;</description>
      <pubDate>Sat, 23 Nov 2019 23:22:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/question-about-variable-containing-both-numbers-and-letters/m-p/606731#M17431</guid>
      <dc:creator>lmyers2</dc:creator>
      <dc:date>2019-11-23T23:22:38Z</dc:date>
    </item>
  </channel>
</rss>

