<?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 extract only character values from a mixed variable list(num+char) in sas in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-extract-only-numeric-observations-from-a-mixed-variable/m-p/632350#M187475</link>
    <description>the second one is the case and I want to extract only character values.</description>
    <pubDate>Mon, 16 Mar 2020 07:44:15 GMT</pubDate>
    <dc:creator>annypanny</dc:creator>
    <dc:date>2020-03-16T07:44:15Z</dc:date>
    <item>
      <title>How to extract only numeric observations from a mixed variable list(num+char) in sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-extract-only-numeric-observations-from-a-mixed-variable/m-p/632336#M187465</link>
      <description>&lt;P&gt;In a dataset there is a varible list where numeric as well as character values are there, how can I get only numeric observations from it in sas. example dataline are here:in only one variable list VAR1 there are values e.g:&lt;/P&gt;
&lt;P&gt;variable name:&lt;/P&gt;
&lt;P&gt;VAR&lt;/P&gt;
&lt;P&gt;................&lt;/P&gt;
&lt;P&gt;observations:&lt;/P&gt;
&lt;P&gt;123_854&lt;/P&gt;
&lt;P&gt;xyz&lt;/P&gt;
&lt;P&gt;456_672&lt;/P&gt;
&lt;P&gt;abc&lt;/P&gt;
&lt;P&gt;789_458&lt;/P&gt;
&lt;P&gt;frf&lt;/P&gt;
&lt;P&gt;233_562&lt;/P&gt;
&lt;P&gt;gth&lt;/P&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;P&gt;qxd&lt;/P&gt;
&lt;P&gt;345_672&lt;/P&gt;
&lt;P&gt;I have to extract only that numeric values e.g(233_562 etc) from that whole dataline, How can I get that.&lt;/P&gt;
&lt;P&gt;edited.&amp;nbsp; Previously it was solved&lt;/P&gt;</description>
      <pubDate>Mon, 27 Apr 2020 11:01:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-extract-only-numeric-observations-from-a-mixed-variable/m-p/632336#M187465</guid>
      <dc:creator>annypanny</dc:creator>
      <dc:date>2020-04-27T11:01:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract only character values from a mixed variable list(num+char) in sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-extract-only-numeric-observations-from-a-mixed-variable/m-p/632338#M187466</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/316738"&gt;@annypanny&lt;/a&gt;&amp;nbsp;Welcome to the SAS Community &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Are these eight separate variables or one variable with eight values in it?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Mar 2020 07:13:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-extract-only-numeric-observations-from-a-mixed-variable/m-p/632338#M187466</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-03-16T07:13:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract only character values from a mixed variable list(num+char) in sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-extract-only-numeric-observations-from-a-mixed-variable/m-p/632339#M187467</link>
      <description>&lt;P&gt;Are these values stored in a single variable, or in separate variables within a given observation?&lt;/P&gt;</description>
      <pubDate>Mon, 16 Mar 2020 07:14:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-extract-only-numeric-observations-from-a-mixed-variable/m-p/632339#M187467</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-03-16T07:14:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract only character values from a mixed variable list(num+char) in sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-extract-only-numeric-observations-from-a-mixed-variable/m-p/632340#M187468</link>
      <description>&lt;P&gt;there is one variable and there are many values, I have just written eight values here. Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 16 Mar 2020 07:16:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-extract-only-numeric-observations-from-a-mixed-variable/m-p/632340#M187468</guid>
      <dc:creator>annypanny</dc:creator>
      <dc:date>2020-03-16T07:16:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract only character values from a mixed variable list(num+char) in sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-extract-only-numeric-observations-from-a-mixed-variable/m-p/632341#M187469</link>
      <description>there is one variable and there are many values, I have just written eight values here. Thanks</description>
      <pubDate>Mon, 16 Mar 2020 07:16:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-extract-only-numeric-observations-from-a-mixed-variable/m-p/632341#M187469</guid>
      <dc:creator>annypanny</dc:creator>
      <dc:date>2020-03-16T07:16:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract only character values from a mixed variable list(num+char) in sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-extract-only-numeric-observations-from-a-mixed-variable/m-p/632343#M187470</link>
      <description>&lt;P&gt;Does that mean you want to get rid of the commas as well? If so&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
    var1 = '123, xyz, 456, abc, 789, frf, 233, gth';
    var2 = compbl(compress(var1, '', 'ka'));
    put var2=;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 16 Mar 2020 07:34:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-extract-only-numeric-observations-from-a-mixed-variable/m-p/632343#M187470</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-03-16T07:34:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract only character values from a mixed variable list(num+char) in sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-extract-only-numeric-observations-from-a-mixed-variable/m-p/632346#M187472</link>
      <description>what if VAR1 has more than thousand values not eight values, then what can I do? Thanks in advance</description>
      <pubDate>Mon, 16 Mar 2020 07:37:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-extract-only-numeric-observations-from-a-mixed-variable/m-p/632346#M187472</guid>
      <dc:creator>annypanny</dc:creator>
      <dc:date>2020-03-16T07:37:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract only character values from a mixed variable list(num+char) in sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-extract-only-numeric-observations-from-a-mixed-variable/m-p/632347#M187473</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/316738"&gt;@annypanny&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am a bit confused:&lt;/P&gt;
&lt;P&gt;are our input data like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
    var1 = '123, xyz, 456, abc, 789, frf, 233, gth';
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or like this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
	input VAR1 $;
	datalines;
123
xyz
456
abc
789
frf
233
gth
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;In the second case, you can use the following code to output only observation containing numbers:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
	set have;
	if prxmatch('/\d+\s*$/',VAR1)&amp;gt;0 then output;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Best,&lt;/P&gt;</description>
      <pubDate>Mon, 16 Mar 2020 07:41:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-extract-only-numeric-observations-from-a-mixed-variable/m-p/632347#M187473</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2020-03-16T07:41:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract only character values from a mixed variable list(num+char) in sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-extract-only-numeric-observations-from-a-mixed-variable/m-p/632348#M187474</link>
      <description>&lt;P&gt;The number of values does not matter. See this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
    var1 = '123, xyz, 456, abc, 789, frf, 233, gth,
            123, xyz, 456, abc, 789, frf, 233, gth,
            123, xyz, 456, abc, 789, frf, 233, gth,
            123, xyz, 456, abc, 789, frf, 233, gth,
            123, xyz, 456, abc, 789, frf, 233, gth';
    var2 = compbl(compress(var1, '', 'ka'));
    put var2;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 16 Mar 2020 07:39:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-extract-only-numeric-observations-from-a-mixed-variable/m-p/632348#M187474</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-03-16T07:39:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract only character values from a mixed variable list(num+char) in sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-extract-only-numeric-observations-from-a-mixed-variable/m-p/632350#M187475</link>
      <description>the second one is the case and I want to extract only character values.</description>
      <pubDate>Mon, 16 Mar 2020 07:44:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-extract-only-numeric-observations-from-a-mixed-variable/m-p/632350#M187475</guid>
      <dc:creator>annypanny</dc:creator>
      <dc:date>2020-03-16T07:44:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract only character values from a mixed variable list(num+char) in sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-extract-only-numeric-observations-from-a-mixed-variable/m-p/632351#M187476</link>
      <description>there is no commas in that dataset, sorry for my previous mistake</description>
      <pubDate>Mon, 16 Mar 2020 07:44:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-extract-only-numeric-observations-from-a-mixed-variable/m-p/632351#M187476</guid>
      <dc:creator>annypanny</dc:creator>
      <dc:date>2020-03-16T07:44:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract only character values from a mixed variable list(num+char) in sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-extract-only-numeric-observations-from-a-mixed-variable/m-p/632352#M187477</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/316738"&gt;@annypanny&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So you can do this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
	set have;
	if prxmatch('/\d+\s*$/',VAR1)&amp;gt;0 then delete;
run;
proc print;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Best,&lt;/P&gt;</description>
      <pubDate>Mon, 16 Mar 2020 07:45:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-extract-only-numeric-observations-from-a-mixed-variable/m-p/632352#M187477</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2020-03-16T07:45:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract only character values from a mixed variable list(num+char) in sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-extract-only-numeric-observations-from-a-mixed-variable/m-p/632353#M187478</link>
      <description>&lt;P&gt;Does not matter either. My code returns the same result, commas or not.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Mar 2020 07:45:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-extract-only-numeric-observations-from-a-mixed-variable/m-p/632353#M187478</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-03-16T07:45:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract only character values from a mixed variable list(num+char) in sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-extract-only-numeric-observations-from-a-mixed-variable/m-p/632354#M187479</link>
      <description>thanks, It is working now</description>
      <pubDate>Mon, 16 Mar 2020 07:52:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-extract-only-numeric-observations-from-a-mixed-variable/m-p/632354#M187479</guid>
      <dc:creator>annypanny</dc:creator>
      <dc:date>2020-03-16T07:52:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract only character values from a mixed variable list(num+char) in sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-extract-only-numeric-observations-from-a-mixed-variable/m-p/632355#M187480</link>
      <description>&lt;P&gt;Awesome!&lt;/P&gt;
&lt;P&gt;You're welcome&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/316738"&gt;@annypanny&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Mar 2020 07:53:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-extract-only-numeric-observations-from-a-mixed-variable/m-p/632355#M187480</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2020-03-16T07:53:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract only character values from a mixed variable list(num+char) in sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-extract-only-numeric-observations-from-a-mixed-variable/m-p/643234#M191937</link>
      <description>&lt;P&gt;and how we can do the vice versa i.e., how to extract a only numeric character which can also contain special characters like "_". example 1234_4567 in the above question&lt;/P&gt;</description>
      <pubDate>Mon, 27 Apr 2020 10:48:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-extract-only-numeric-observations-from-a-mixed-variable/m-p/643234#M191937</guid>
      <dc:creator>annypanny</dc:creator>
      <dc:date>2020-04-27T10:48:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract only character values from a mixed variable list(num+char) in sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-extract-only-numeric-observations-from-a-mixed-variable/m-p/643242#M191941</link>
      <description>&lt;P&gt;this act as a solution for me thanks&lt;/P&gt;</description>
      <pubDate>Mon, 27 Apr 2020 11:06:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-extract-only-numeric-observations-from-a-mixed-variable/m-p/643242#M191941</guid>
      <dc:creator>annypanny</dc:creator>
      <dc:date>2020-04-27T11:06:17Z</dc:date>
    </item>
  </channel>
</rss>

