<?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: Extract numeric value from a string in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Extract-numeric-value-from-a-string/m-p/848599#M37069</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;: I think the reason for the focus on alternative approaches (like using _NUMERIC_) was that the actual problem had already been solved in a &lt;A href="https://communities.sas.com/t5/New-SAS-User/Extract-a-numeric-value-from-a-string/td-p/848478" target="_blank" rel="noopener"&gt;parallel thread with almost the same subject line&lt;/A&gt;. Just the follow-up question about _NUMERIC_ was (and is) still open there.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/430763"&gt;@animesh123&lt;/a&gt;: Please don't double-post. As you see, it leads to unnecessary confusion and wastes resources.&lt;/P&gt;</description>
    <pubDate>Thu, 08 Dec 2022 18:25:04 GMT</pubDate>
    <dc:creator>FreelanceReinh</dc:creator>
    <dc:date>2022-12-08T18:25:04Z</dc:date>
    <item>
      <title>Extract numeric value from a string</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Extract-numeric-value-from-a-string/m-p/848473#M37031</link>
      <description>&lt;P&gt;Extract numeric value from a string&lt;/P&gt;&lt;P&gt;String=a1b2c3df456&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2022 07:29:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Extract-numeric-value-from-a-string/m-p/848473#M37031</guid>
      <dc:creator>animesh123</dc:creator>
      <dc:date>2022-12-08T07:29:49Z</dc:date>
    </item>
    <item>
      <title>Re: Extract numeric value from a string</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Extract-numeric-value-from-a-string/m-p/848513#M37047</link>
      <description>&lt;P&gt;What numeric value do you want to extract? What are the rules to do this extraction?&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Can you give us a few more examples of strings where you want to extract the numeric values?&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2022 11:25:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Extract-numeric-value-from-a-string/m-p/848513#M37047</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-12-08T11:25:59Z</dc:date>
    </item>
    <item>
      <title>Re: Extract numeric value from a string</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Extract-numeric-value-from-a-string/m-p/848518#M37049</link>
      <description>Hey &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt; the output I am expecting here is - 123456,&lt;BR /&gt;I think we can do it using compress function.&lt;BR /&gt;but could you please tell me if its even possible to try the same using _numeric_?</description>
      <pubDate>Thu, 08 Dec 2022 11:40:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Extract-numeric-value-from-a-string/m-p/848518#M37049</guid>
      <dc:creator>animesh123</dc:creator>
      <dc:date>2022-12-08T11:40:44Z</dc:date>
    </item>
    <item>
      <title>Re: Extract numeric value from a string</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Extract-numeric-value-from-a-string/m-p/848526#M37052</link>
      <description>&lt;P&gt;So what are the rules for extracting? You didn't say&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;I think we can do it using compress function.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;but could you please tell me if its even possible to try the same using _numeric_?&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;I don't understand the second part of the question.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2022 12:28:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Extract-numeric-value-from-a-string/m-p/848526#M37052</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-12-08T12:28:04Z</dc:date>
    </item>
    <item>
      <title>Re: Extract numeric value from a string</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Extract-numeric-value-from-a-string/m-p/848532#M37054</link>
      <description>String=a1b2c3df456&lt;BR /&gt;I need the output as - 123456&lt;BR /&gt;Also , I was just wondering if we can pull the numeric variable from string using _NUMERIC_(I am not sure if this is possible or not using _numeric_)</description>
      <pubDate>Thu, 08 Dec 2022 13:55:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Extract-numeric-value-from-a-string/m-p/848532#M37054</guid>
      <dc:creator>animesh123</dc:creator>
      <dc:date>2022-12-08T13:55:58Z</dc:date>
    </item>
    <item>
      <title>Re: Extract numeric value from a string</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Extract-numeric-value-from-a-string/m-p/848533#M37055</link>
      <description>&lt;P&gt;You can use COMPRESS&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;numbers = compress(string,,'dk');
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm still not sure what you mean when you refer to _NUMERIC_, you can't use _NUMERIC_ in the COMPRESS function, and this variable in SAS would not be a numeric variable anyway, it has to be a character variable. Do you mean that you have a lot of variables and you want to do this for all of them?&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2022 14:17:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Extract-numeric-value-from-a-string/m-p/848533#M37055</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-12-08T14:17:38Z</dc:date>
    </item>
    <item>
      <title>Re: Extract numeric value from a string</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Extract-numeric-value-from-a-string/m-p/848560#M37056</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/430763"&gt;@animesh123&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Hey &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt; the output I am expecting here is - 123456,&lt;BR /&gt;I think we can do it using compress function.&lt;BR /&gt;but could you please tell me if its even possible to try the same using _numeric_?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;_Numeric_ refers to the list of &lt;STRONG&gt;variables&lt;/STRONG&gt; that are of numeric type in a data set. Since your value starts with non-digit characters it must be character an in no way would respond to the places where _numeric_ may be used.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2022 16:41:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Extract-numeric-value-from-a-string/m-p/848560#M37056</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-12-08T16:41:53Z</dc:date>
    </item>
    <item>
      <title>Re: Extract numeric value from a string</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Extract-numeric-value-from-a-string/m-p/848570#M37057</link>
      <description>Thanks &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt; for explaining, Just a request could you show me some example where we could use _numeric_ function&lt;BR /&gt;</description>
      <pubDate>Thu, 08 Dec 2022 17:14:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Extract-numeric-value-from-a-string/m-p/848570#M37057</guid>
      <dc:creator>animesh123</dc:creator>
      <dc:date>2022-12-08T17:14:10Z</dc:date>
    </item>
    <item>
      <title>Re: Extract numeric value from a string</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Extract-numeric-value-from-a-string/m-p/848571#M37058</link>
      <description>Thanks &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt; .For the _NUMERIC_ function I was hoping we could use only this function (_NUMERIC_ ) to extract numeric variable from string.</description>
      <pubDate>Thu, 08 Dec 2022 17:17:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Extract-numeric-value-from-a-string/m-p/848571#M37058</guid>
      <dc:creator>animesh123</dc:creator>
      <dc:date>2022-12-08T17:17:32Z</dc:date>
    </item>
    <item>
      <title>Re: Extract numeric value from a string</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Extract-numeric-value-from-a-string/m-p/848578#M37059</link>
      <description>&lt;P&gt;But these are character variables, not numeric.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am going to give you some advice, since you have not explained what you want to do here, but you keep mentioning _NUMERIC_ as something to do. ADVICE: don't tell use what object of SAS code you want to use (like _NUMERIC_) and then stop and give no further explanation why you want it. Tell us what you want to do, rather than the SAS code object that you want to use. You have not told us what you want to do. And without that, we can't advise, we can't move forward, we can't get you closer to achieving the goal.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2022 17:48:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Extract-numeric-value-from-a-string/m-p/848578#M37059</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-12-08T17:48:07Z</dc:date>
    </item>
    <item>
      <title>Re: Extract numeric value from a string</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Extract-numeric-value-from-a-string/m-p/848579#M37060</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/430763"&gt;@animesh123&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Thanks &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt; for explaining, Just a request could you show me some example where we could use _numeric_ function&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;PRE&gt;Proc print data=sashelp.class;
   var _numeric_;
run;&lt;/PRE&gt;
&lt;P&gt;In a data step you could do, not that this makes logical sense in most cases (adding age, height and weight doesn't mean much first as each uses different units):&lt;/P&gt;
&lt;PRE&gt;data junk;   
    set sashelp.class;
    newvar = sum( of _numeric_);
run;
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2022 17:48:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Extract-numeric-value-from-a-string/m-p/848579#M37060</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-12-08T17:48:09Z</dc:date>
    </item>
    <item>
      <title>Re: Extract numeric value from a string</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Extract-numeric-value-from-a-string/m-p/848581#M37061</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/430763"&gt;@animesh123&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Thanks &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt; .For the _NUMERIC_ function I was hoping we could use only this function (_NUMERIC_ ) to extract numeric variable from string.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;There is no _NUMERIC_ function.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The keyword _NUMERIC_ can be used where you could enter a list of variable names.&amp;nbsp; For example in an ARRAY definition. Or a VAR or other statement that needs a list of variable names.&amp;nbsp; Or it can be used with the OF keyword in function call to a function that can accept a variable number of arguments.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;array nums _numeric_;
var _numeric_;
nmiss = nmiss(of _numeric_);
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 08 Dec 2022 17:50:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Extract-numeric-value-from-a-string/m-p/848581#M37061</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-12-08T17:50:28Z</dc:date>
    </item>
    <item>
      <title>Re: Extract numeric value from a string</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Extract-numeric-value-from-a-string/m-p/848588#M37064</link>
      <description>Hey &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13573"&gt;@Paige&lt;/a&gt; Miller Appreciate your advice , but I am just learning I was wondering if  we could do the extract using _numeric_ but ideally we can't as explained below.&lt;BR /&gt;But yeah Thank you very much for helping out really appreciate</description>
      <pubDate>Thu, 08 Dec 2022 18:00:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Extract-numeric-value-from-a-string/m-p/848588#M37064</guid>
      <dc:creator>animesh123</dc:creator>
      <dc:date>2022-12-08T18:00:40Z</dc:date>
    </item>
    <item>
      <title>Re: Extract numeric value from a string</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Extract-numeric-value-from-a-string/m-p/848592#M37065</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/430763"&gt;@animesh123&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Hey &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13573"&gt;@Paige&lt;/a&gt; Miller Appreciate your advice , but I am just learning I was wondering if we could do the extract using _numeric_ but ideally we can't as explained below.&lt;BR /&gt;But yeah Thank you very much for helping out really appreciate&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I keep asking you to explain what you are trying to do ... but you don't explain, you just keep saying you want to use _NUMERIC_. There may be other ways to do what you want to do that don't use _NUMERIC_, but without an explanation of what you are trying to do ...&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2022 18:05:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Extract-numeric-value-from-a-string/m-p/848592#M37065</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-12-08T18:05:27Z</dc:date>
    </item>
    <item>
      <title>Re: Extract numeric value from a string</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Extract-numeric-value-from-a-string/m-p/848596#M37068</link>
      <description>Got it ,  If there are any other ways we can do the same , could you please let me know .How we can do the same?</description>
      <pubDate>Thu, 08 Dec 2022 18:15:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Extract-numeric-value-from-a-string/m-p/848596#M37068</guid>
      <dc:creator>animesh123</dc:creator>
      <dc:date>2022-12-08T18:15:04Z</dc:date>
    </item>
    <item>
      <title>Re: Extract numeric value from a string</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Extract-numeric-value-from-a-string/m-p/848599#M37069</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;: I think the reason for the focus on alternative approaches (like using _NUMERIC_) was that the actual problem had already been solved in a &lt;A href="https://communities.sas.com/t5/New-SAS-User/Extract-a-numeric-value-from-a-string/td-p/848478" target="_blank" rel="noopener"&gt;parallel thread with almost the same subject line&lt;/A&gt;. Just the follow-up question about _NUMERIC_ was (and is) still open there.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/430763"&gt;@animesh123&lt;/a&gt;: Please don't double-post. As you see, it leads to unnecessary confusion and wastes resources.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2022 18:25:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Extract-numeric-value-from-a-string/m-p/848599#M37069</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2022-12-08T18:25:04Z</dc:date>
    </item>
  </channel>
</rss>

