<?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: What is the most efficient way to extract the percent out of parentheses? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/What-is-the-most-efficient-way-to-extract-the-percent-out-of/m-p/834400#M329893</link>
    <description>&lt;P&gt;Slight variation on&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;solution which converts it to an actual percentage.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
   set have1;
   num = input(scan(number,1,'()'),f5.);
   pct = input(scan(number,2,'()'),f5.)/100;
   format pct percent12.1;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 20 Sep 2022 22:22:27 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2022-09-20T22:22:27Z</dc:date>
    <item>
      <title>What is the most efficient way to extract the percent out of parentheses?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/What-is-the-most-efficient-way-to-extract-the-percent-out-of/m-p/834395#M329890</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have1;
infile datalines dsd dlm=",";
	input number $;
datalines;
5 (31.4),
3 (12.4),
38 (71.3)
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hi, i'm trying to extract then numbers out of the percent and turn them into&amp;nbsp;&lt;/P&gt;
&lt;P&gt;numerical values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The desired result should be:&lt;/P&gt;
&lt;P&gt;31.4&lt;/P&gt;
&lt;P&gt;12.4&lt;/P&gt;
&lt;P&gt;71.3&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 20 Sep 2022 22:10:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/What-is-the-most-efficient-way-to-extract-the-percent-out-of/m-p/834395#M329890</guid>
      <dc:creator>Hello_there</dc:creator>
      <dc:date>2022-09-20T22:10:57Z</dc:date>
    </item>
    <item>
      <title>Re: What is the most efficient way to extract the percent out of parentheses?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/What-is-the-most-efficient-way-to-extract-the-percent-out-of/m-p/834396#M329891</link>
      <description>&lt;P&gt;One way:&lt;/P&gt;
&lt;PRE&gt;data want;
   set have1;
   num = input(scan(number,2,'()'),f5.);
run;&lt;/PRE&gt;
&lt;P&gt;Scan function allows setting what is the delimiter between values of interest so ( and ) seem likely&amp;nbsp; candidates. The second word would start after the ( and end at the ). Input is the function to turn the value in numeric value with an appropriate informat.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/252358"&gt;@Hello_there&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have1;
infile datalines dsd dlm=",";
	input number $;
datalines;
5 (31.4),
3 (12.4),
38 (71.3)
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hi, i'm trying to extract then numbers out of the percent and turn them into&amp;nbsp;&lt;/P&gt;
&lt;P&gt;numerical values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The desired result should be:&lt;/P&gt;
&lt;P&gt;31.4&lt;/P&gt;
&lt;P&gt;12.4&lt;/P&gt;
&lt;P&gt;71.3&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Sep 2022 22:17:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/What-is-the-most-efficient-way-to-extract-the-percent-out-of/m-p/834396#M329891</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-09-20T22:17:36Z</dc:date>
    </item>
    <item>
      <title>Re: What is the most efficient way to extract the percent out of parentheses?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/What-is-the-most-efficient-way-to-extract-the-percent-out-of/m-p/834397#M329892</link>
      <description>data want; set have;&lt;BR /&gt;Newvar = substr(oldvar, 1, 1);&lt;BR /&gt;Newvar2 = .;&lt;BR /&gt;Newvar2 = Newvar;&lt;BR /&gt;run;</description>
      <pubDate>Tue, 20 Sep 2022 22:18:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/What-is-the-most-efficient-way-to-extract-the-percent-out-of/m-p/834397#M329892</guid>
      <dc:creator>awesome_opossum</dc:creator>
      <dc:date>2022-09-20T22:18:21Z</dc:date>
    </item>
    <item>
      <title>Re: What is the most efficient way to extract the percent out of parentheses?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/What-is-the-most-efficient-way-to-extract-the-percent-out-of/m-p/834400#M329893</link>
      <description>&lt;P&gt;Slight variation on&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;solution which converts it to an actual percentage.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
   set have1;
   num = input(scan(number,1,'()'),f5.);
   pct = input(scan(number,2,'()'),f5.)/100;
   format pct percent12.1;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 20 Sep 2022 22:22:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/What-is-the-most-efficient-way-to-extract-the-percent-out-of/m-p/834400#M329893</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-09-20T22:22:27Z</dc:date>
    </item>
    <item>
      <title>Re: What is the most efficient way to extract the percent out of parentheses?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/What-is-the-most-efficient-way-to-extract-the-percent-out-of/m-p/834407#M329894</link>
      <description>Thank you for the explanation!</description>
      <pubDate>Tue, 20 Sep 2022 23:13:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/What-is-the-most-efficient-way-to-extract-the-percent-out-of/m-p/834407#M329894</guid>
      <dc:creator>Hello_there</dc:creator>
      <dc:date>2022-09-20T23:13:03Z</dc:date>
    </item>
    <item>
      <title>Re: What is the most efficient way to extract the percent out of parentheses?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/What-is-the-most-efficient-way-to-extract-the-percent-out-of/m-p/912058#M359604</link>
      <description>&lt;P&gt;Many thanks. This use of scan function has saved lot of my time. It is very useful where substr is not useful because substr is position specific.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- Dr. Abhijeet Safai&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jan 2024 05:20:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/What-is-the-most-efficient-way-to-extract-the-percent-out-of/m-p/912058#M359604</guid>
      <dc:creator>DrAbhijeetSafai</dc:creator>
      <dc:date>2024-01-19T05:20:27Z</dc:date>
    </item>
  </channel>
</rss>

