<?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 Seprate Character Variable and Numeric Variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-To-Seprate-Character-Variable-and-Numeric-Variable/m-p/84230#M288833</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The code is in my reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to add a data statement, a set statement, and a run statement at the end.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Richard&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 22 Mar 2013 09:52:43 GMT</pubDate>
    <dc:creator>RichardinOz</dc:creator>
    <dc:date>2013-03-22T09:52:43Z</dc:date>
    <item>
      <title>How To Seprate Character Variable and Numeric Variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-To-Seprate-Character-Variable-and-Numeric-Variable/m-p/84223#M288826</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Times New Roman', serif;"&gt;Hi &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Times New Roman', serif;"&gt;I Created a Dataset In a Character Variable it contains character and Numeric Value,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Times New Roman', serif;"&gt;I want to Split character and Numeric Value&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Times New Roman', serif;"&gt;I Have a dataset which is subject and result are character variable&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" jive-data-cell="{&amp;quot;color&amp;quot;:&amp;quot;#000000&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;left&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;2&amp;quot;}" jive-data-header="{&amp;quot;color&amp;quot;:&amp;quot;#FFFFFF&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;#6690BC&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;center&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;2&amp;quot;,&amp;quot;fontFamily&amp;quot;:&amp;quot;arial,helvetica,sans-serif&amp;quot;}" style="border: 1px solid #000000; width: 18%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px; font-family: arial, helvetica, sans-serif;"&gt;&lt;STRONG&gt;subject&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px; font-family: arial, helvetica, sans-serif; vertical-align: middle;"&gt;&lt;STRONG&gt;Result&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; color: #000000; text-align: left; background-color: transparent;"&gt;1001&lt;/TD&gt;&lt;TD style="padding: 0px; color: #000000; text-align: left; background-color: transparent;"&gt;20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; color: #000000; text-align: left; background-color: transparent;"&gt;1002&lt;/TD&gt;&lt;TD style="padding: 0px; color: #000000; text-align: left; background-color: transparent;"&gt;&amp;gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; color: #000000; text-align: left; background-color: transparent;"&gt;1003&lt;/TD&gt;&lt;TD style="padding: 0px; color: #000000; text-align: left; background-color: transparent;"&gt;Positive&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; color: #000000; text-align: left; background-color: transparent;"&gt;1004&lt;/TD&gt;&lt;TD style="padding: 0px; color: #000000; text-align: left; background-color: transparent;"&gt;30.5&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Times New Roman', serif;"&gt;I Want the Dataset to be&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" jive-data-cell="{&amp;quot;color&amp;quot;:&amp;quot;#000000&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;left&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;2&amp;quot;}" jive-data-header="{&amp;quot;color&amp;quot;:&amp;quot;#FFFFFF&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;#6690BC&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;center&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;2&amp;quot;,&amp;quot;fontFamily&amp;quot;:&amp;quot;arial,helvetica,sans-serif&amp;quot;}" style="border: 1px solid #000000; width: 32%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px; font-family: arial, helvetica, sans-serif;"&gt;&lt;STRONG&gt;subject&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px; font-family: arial, helvetica, sans-serif;"&gt;&lt;STRONG&gt;Result&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px; font-family: arial, helvetica, sans-serif;"&gt;&lt;STRONG&gt;Numeric&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px; font-family: arial, helvetica, sans-serif;"&gt;&lt;STRONG&gt;Character&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; color: #000000; text-align: left; background-color: transparent;"&gt;&lt;P&gt;1001&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 2px; color: #000000; text-align: left; background-color: transparent;"&gt;20&lt;/TD&gt;&lt;TD style="padding: 2px; color: #000000; text-align: left; background-color: transparent;"&gt;20&lt;/TD&gt;&lt;TD style="padding: 2px; color: #000000; text-align: left; background-color: transparent;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; color: #000000; text-align: left; background-color: transparent;"&gt;&lt;SPAN style="color: #000000;"&gt;1002&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px; color: #000000; text-align: left; background-color: transparent;"&gt;&lt;SPAN style="color: #000000;"&gt;&amp;gt;50&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px; color: #000000; text-align: left; background-color: transparent;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px; color: #000000; text-align: left; background-color: transparent;"&gt;&amp;gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; color: #000000; text-align: left; background-color: transparent;"&gt;&lt;SPAN style="color: #000000;"&gt;1003&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px; color: #000000; text-align: left; background-color: transparent;"&gt;&lt;SPAN style="color: #000000;"&gt;Positive&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px; color: #000000; text-align: left; background-color: transparent;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px; color: #000000; text-align: left; background-color: transparent;"&gt;Positive&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; color: #000000; text-align: left; background-color: transparent;"&gt;&lt;SPAN style="color: #000000;"&gt;1004&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px; color: #000000; text-align: left; background-color: transparent;"&gt;&lt;SPAN style="color: #000000;"&gt;30.5&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px; color: #000000; text-align: left; background-color: transparent;"&gt;30.5&lt;/TD&gt;&lt;TD style="padding: 2px; color: #000000; text-align: left; background-color: transparent;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Times New Roman', serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Times New Roman', serif;"&gt;Could Any one Help Me&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Mar 2013 06:50:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-To-Seprate-Character-Variable-and-Numeric-Variable/m-p/84223#M288826</guid>
      <dc:creator>SushilKumar</dc:creator>
      <dc:date>2013-03-21T06:50:16Z</dc:date>
    </item>
    <item>
      <title>Re: How To Seprate Character Variable and Numeric Variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-To-Seprate-Character-Variable-and-Numeric-Variable/m-p/84224#M288827</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The easiest way (I think) is to input the value to the numeric column using best. format. If the result is missing, store the value in the character column.&lt;/P&gt;&lt;P&gt;You'll have some notes in the log about invalid arguments to the input function, but that is expected.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Mar 2013 08:30:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-To-Seprate-Character-Variable-and-Numeric-Variable/m-p/84224#M288827</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2013-03-21T08:30:31Z</dc:date>
    </item>
    <item>
      <title>Re: How To Seprate Character Variable and Numeric Variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-To-Seprate-Character-Variable-and-Numeric-Variable/m-p/84225#M288828</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Warning messages can be suppressed using ??&lt;/P&gt;&lt;P&gt;Numeric = input(result, ?? best.) ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If numeric = . then character = result ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Richard&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Mar 2013 08:39:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-To-Seprate-Character-Variable-and-Numeric-Variable/m-p/84225#M288828</guid>
      <dc:creator>RichardinOz</dc:creator>
      <dc:date>2013-03-21T08:39:47Z</dc:date>
    </item>
    <item>
      <title>Re: How To Seprate Character Variable and Numeric Variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-To-Seprate-Character-Variable-and-Numeric-Variable/m-p/84226#M288829</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Forgot that:smileyblush:.&lt;/P&gt;&lt;P&gt;Works only if you are using the data step, not in SQL.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Mar 2013 08:47:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-To-Seprate-Character-Variable-and-Numeric-Variable/m-p/84226#M288829</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2013-03-21T08:47:38Z</dc:date>
    </item>
    <item>
      <title>Re: How To Seprate Character Variable and Numeric Variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-To-Seprate-Character-Variable-and-Numeric-Variable/m-p/84227#M288830</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear&lt;/P&gt;&lt;P&gt;I very simple way&lt;/P&gt;&lt;P&gt;data x;&amp;nbsp; length Result$ 20;&lt;BR /&gt; Result='20';output;&lt;BR /&gt; Result='&amp;gt;50';output;&lt;BR /&gt; Result='123Position';output;&lt;BR /&gt; Result='.';output;&lt;BR /&gt; Result='.23';output;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data x; set x; v=(verify(Result,'1234567890.'))-1;l=length(trim(result));&lt;BR /&gt; length Numeric 8. CHARACTER $20;&lt;BR /&gt; if v=l then NUMERIC=result; &lt;BR /&gt;&amp;nbsp; else CHARACTER=result;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also investigaute into Regular expression, if you have some experience.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Mar 2013 09:43:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-To-Seprate-Character-Variable-and-Numeric-Variable/m-p/84227#M288830</guid>
      <dc:creator>FabienLACREUSE</dc:creator>
      <dc:date>2013-03-21T09:43:50Z</dc:date>
    </item>
    <item>
      <title>Re: How To Seprate Character Variable and Numeric Variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-To-Seprate-Character-Variable-and-Numeric-Variable/m-p/84228#M288831</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A __default_attr="119192" __jive_macro_name="user" class="jive_macro jive_macro_user" data-objecttype="3" href="https://communities.sas.com/"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;In my recollection proc SQL the input function does not generate warning messages in this situation, so the ?? is not necessary anyway.&amp;nbsp; The OP can use SQL to achieve the same result but in this instance a data step is the simplest solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Richard&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Mar 2013 13:18:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-To-Seprate-Character-Variable-and-Numeric-Variable/m-p/84228#M288831</guid>
      <dc:creator>RichardinOz</dc:creator>
      <dc:date>2013-03-21T13:18:39Z</dc:date>
    </item>
    <item>
      <title>Re: How To Seprate Character Variable and Numeric Variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-To-Seprate-Character-Variable-and-Numeric-Variable/m-p/84229#M288832</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could You write the Code&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Mar 2013 07:53:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-To-Seprate-Character-Variable-and-Numeric-Variable/m-p/84229#M288832</guid>
      <dc:creator>SushilKumar</dc:creator>
      <dc:date>2013-03-22T07:53:27Z</dc:date>
    </item>
    <item>
      <title>Re: How To Seprate Character Variable and Numeric Variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-To-Seprate-Character-Variable-and-Numeric-Variable/m-p/84230#M288833</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The code is in my reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to add a data statement, a set statement, and a run statement at the end.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Richard&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Mar 2013 09:52:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-To-Seprate-Character-Variable-and-Numeric-Variable/m-p/84230#M288833</guid>
      <dc:creator>RichardinOz</dc:creator>
      <dc:date>2013-03-22T09:52:43Z</dc:date>
    </item>
    <item>
      <title>Re: How To Seprate Character Variable and Numeric Variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-To-Seprate-Character-Variable-and-Numeric-Variable/m-p/84231#M288834</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A __default_attr="3471" __jive_macro_name="user" class="jive_macro jive_macro_user" href="https://communities.sas.com/" modifiedtitle="true" title="Fabienlacreuse"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your method works if there is no other special scenarios, such as scientific notations, for example "12E4".&amp;nbsp; You maybe able to exhaust all of the possibilities, but the best practice is to let SAS to worry about it. I vote for Richard's solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Haikuo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Mar 2013 15:31:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-To-Seprate-Character-Variable-and-Numeric-Variable/m-p/84231#M288834</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2013-03-22T15:31:11Z</dc:date>
    </item>
  </channel>
</rss>

