<?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 remove percentage from certain rows in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-remove-percentage-from-certain-rows/m-p/925187#M364124</link>
    <description>&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":grinning_face_with_sweat:"&gt;😅&lt;/span&gt; COL1 is just col1. I can update cols one by one. I only listed COL1. sorry for that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I was wondering whether we could use do loop to update the variable values. If so, how?&lt;/P&gt;</description>
    <pubDate>Mon, 22 Apr 2024 03:53:14 GMT</pubDate>
    <dc:creator>stataq</dc:creator>
    <dc:date>2024-04-22T03:53:14Z</dc:date>
    <item>
      <title>how to remove percentage from certain rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-remove-percentage-from-certain-rows/m-p/925182#M364120</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I have a data/table like below:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="stataq_0-1713753703871.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/95736iC77A590BF5238B32/image-size/medium?v=v2&amp;amp;px=400" role="button" title="stataq_0-1713753703871.png" alt="stataq_0-1713753703871.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;If I would like to remove (XX) when rowlbl='All' for col1:col3, how can I do it using do loop?&lt;/P&gt;
&lt;P&gt;I can do it one by one, but when I try to use do loop, I failed. Could anyone guide me on this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;*do it one by one;
data _ds;
set ds;
if rowlbl='All' then do;
col1=scan(col1, 1, ' (');
end;
run;

*try to use do loop;
data _ds;
set ds;
if rowlbl='All' then do;
do i=1 to 3;
coli=scan(coli, 1, ' (');
end;
end;
run;&lt;/PRE&gt;
&lt;P&gt;My way of removing '(XX)' might be too silly. Any better suggestion?&lt;/P&gt;</description>
      <pubDate>Mon, 22 Apr 2024 02:47:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-remove-percentage-from-certain-rows/m-p/925182#M364120</guid>
      <dc:creator>stataq</dc:creator>
      <dc:date>2024-04-22T02:47:54Z</dc:date>
    </item>
    <item>
      <title>Re: how to remove percentage from certain rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-remove-percentage-from-certain-rows/m-p/925184#M364121</link>
      <description>&lt;P&gt;What variable is COLI?&lt;/P&gt;
&lt;P&gt;Did you mean to create an array?&amp;nbsp; if so you need addition syntax, brackets, to reference a member of the array.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _ds;
  set ds;
  array columns col: ;
  if rowlbl='All' then do index=1 to dim(columns);
    columns[index]=scan(columns[index], 1, ' (');
  end;
  drop index;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 Apr 2024 03:31:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-remove-percentage-from-certain-rows/m-p/925184#M364121</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-04-22T03:31:31Z</dc:date>
    </item>
    <item>
      <title>Re: how to remove percentage from certain rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-remove-percentage-from-certain-rows/m-p/925187#M364124</link>
      <description>&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":grinning_face_with_sweat:"&gt;😅&lt;/span&gt; COL1 is just col1. I can update cols one by one. I only listed COL1. sorry for that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I was wondering whether we could use do loop to update the variable values. If so, how?&lt;/P&gt;</description>
      <pubDate>Mon, 22 Apr 2024 03:53:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-remove-percentage-from-certain-rows/m-p/925187#M364124</guid>
      <dc:creator>stataq</dc:creator>
      <dc:date>2024-04-22T03:53:14Z</dc:date>
    </item>
    <item>
      <title>Re: how to remove percentage from certain rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-remove-percentage-from-certain-rows/m-p/925188#M364125</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/448857"&gt;@stataq&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":grinning_face_with_sweat:"&gt;😅&lt;/span&gt; COL1 is just col1. I can update cols one by one. I only listed COL1. sorry for that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I was wondering whether we could use do loop to update the variable values. If so, how?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;??&amp;nbsp; Read the code I posted.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Apr 2024 04:00:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-remove-percentage-from-certain-rows/m-p/925188#M364125</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-04-22T04:00:41Z</dc:date>
    </item>
  </channel>
</rss>

