<?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 scan a value in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-scan-a-value/m-p/710064#M218503</link>
    <description>&lt;P&gt;You identified the proper tool for the job.&amp;nbsp; Try:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;column_2 = scan(column_1, 1, '(' );&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 07 Jan 2021 22:23:10 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2021-01-07T22:23:10Z</dc:date>
    <item>
      <title>how to scan a value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-scan-a-value/m-p/710061#M218501</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;new to SAS&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have data where i need to extract the % without the "%"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Data (character values):&lt;/STRONG&gt;&lt;BR /&gt;&lt;U&gt;&lt;STRONG&gt;column 1&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;11(21.2%)&lt;/P&gt;&lt;P&gt;0(0.0%)&lt;/P&gt;&lt;P&gt;9(17.3%)&lt;/P&gt;&lt;P&gt;5.(9.6%)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;want (in numeric values):&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;column2&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;21.2&lt;/P&gt;&lt;P&gt;0.0&lt;/P&gt;&lt;P&gt;17.3&lt;/P&gt;&lt;P&gt;9.6&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jan 2021 21:57:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-scan-a-value/m-p/710061#M218501</guid>
      <dc:creator>HitmonTran</dc:creator>
      <dc:date>2021-01-07T21:57:22Z</dc:date>
    </item>
    <item>
      <title>Re: how to scan a value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-scan-a-value/m-p/710064#M218503</link>
      <description>&lt;P&gt;You identified the proper tool for the job.&amp;nbsp; Try:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;column_2 = scan(column_1, 1, '(' );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 07 Jan 2021 22:23:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-scan-a-value/m-p/710064#M218503</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2021-01-07T22:23:10Z</dc:date>
    </item>
    <item>
      <title>Re: how to scan a value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-scan-a-value/m-p/710075#M218512</link>
      <description>&lt;P&gt;Scan will return the Character value, so you will need to use an input.&lt;/P&gt;
&lt;P&gt;The question, since you are starting with a percent is do you actually want a Percent value: i.e. 21.2% = 0.212 as decimal or 100*0.212 or 21.2&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Either of the Y or Z yields 21.2 for the first.&lt;/P&gt;
&lt;PRE&gt;data junk;
  x="11(21.2%)";
  y= input(scan(x,2,'(%)'),6.);
  z= input(scan(x,2,'()'),comma6.);
run;&lt;/PRE&gt;</description>
      <pubDate>Thu, 07 Jan 2021 22:47:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-scan-a-value/m-p/710075#M218512</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-01-07T22:47:44Z</dc:date>
    </item>
  </channel>
</rss>

