<?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 divide the variable into rows in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-divide-the-variable-into-rows/m-p/233628#M42688</link>
    <description>&lt;P&gt;Try this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have(rename=(description=d));
length description $1; /* If your real items are not single characters, specify a sufficiently large length! */
do i=1 to countw(d, ',');
  description=scan(d, i, ',');
  output;
end;
drop d i;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 07 Nov 2015 13:19:04 GMT</pubDate>
    <dc:creator>FreelanceReinh</dc:creator>
    <dc:date>2015-11-07T13:19:04Z</dc:date>
    <item>
      <title>How to divide the variable into rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-divide-the-variable-into-rows/m-p/233614#M42681</link>
      <description>&lt;P&gt;Hii all,&lt;/P&gt;
&lt;P&gt;i have a data like&amp;nbsp;&lt;/P&gt;
&lt;TABLE width="175"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="64"&gt;Empid&lt;/TD&gt;
&lt;TD width="111"&gt;Description&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="64"&gt;101&lt;/TD&gt;
&lt;TD width="111"&gt;A,B,C,D&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="64"&gt;102&lt;/TD&gt;
&lt;TD width="111"&gt;E&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;103&lt;/TD&gt;
&lt;TD width="111"&gt;D,E,F&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="64"&gt;104&lt;/TD&gt;
&lt;TD width="111"&gt;K&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="64"&gt;105&lt;/TD&gt;
&lt;TD width="111"&gt;X,Y,Z&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;and I want the output like&lt;/P&gt;
&lt;TABLE width="175"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="64"&gt;Empid&lt;/TD&gt;
&lt;TD width="111"&gt;Description&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="64"&gt;101&lt;/TD&gt;
&lt;TD width="111"&gt;A&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="64"&gt;101&lt;/TD&gt;
&lt;TD width="111"&gt;B&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;101&lt;/TD&gt;
&lt;TD width="111"&gt;C&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="64"&gt;101&lt;/TD&gt;
&lt;TD width="111"&gt;D&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="64"&gt;102&lt;/TD&gt;
&lt;TD width="111"&gt;E&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="64"&gt;103&lt;/TD&gt;
&lt;TD width="111"&gt;D&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="64"&gt;103&lt;/TD&gt;
&lt;TD width="111"&gt;E&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="64"&gt;103&lt;/TD&gt;
&lt;TD width="111"&gt;F&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="64"&gt;104&lt;/TD&gt;
&lt;TD width="111"&gt;K&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="64"&gt;105&lt;/TD&gt;
&lt;TD width="111"&gt;X&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="64"&gt;105&lt;/TD&gt;
&lt;TD width="111"&gt;Y&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="64"&gt;105&lt;/TD&gt;
&lt;TD width="111"&gt;Z&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;The description is having any "," then devide that row into multiple(if comma is there between the text).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help would be greatly appreciated.&lt;/P&gt;</description>
      <pubDate>Sat, 07 Nov 2015 10:15:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-divide-the-variable-into-rows/m-p/233614#M42681</guid>
      <dc:creator>Ravikumarkummari</dc:creator>
      <dc:date>2015-11-07T10:15:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to divide the variable into rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-divide-the-variable-into-rows/m-p/233628#M42688</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have(rename=(description=d));
length description $1; /* If your real items are not single characters, specify a sufficiently large length! */
do i=1 to countw(d, ',');
  description=scan(d, i, ',');
  output;
end;
drop d i;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 07 Nov 2015 13:19:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-divide-the-variable-into-rows/m-p/233628#M42688</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2015-11-07T13:19:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to divide the variable into rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-divide-the-variable-into-rows/m-p/233629#M42689</link>
      <description>&lt;P&gt;Could you suggest me if description column is having special characters then&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ex; &amp;nbsp;A,B,C,D&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;B&amp;amp;C&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;E,F;C&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Nov 2015 13:23:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-divide-the-variable-into-rows/m-p/233629#M42689</guid>
      <dc:creator>Ravikumarkummari</dc:creator>
      <dc:date>2015-11-07T13:23:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to divide the variable into rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-divide-the-variable-into-rows/m-p/233630#M42690</link>
      <description>&lt;P&gt;&lt;BR /&gt;data have;&lt;BR /&gt;x="A,B,C,D";output;&lt;BR /&gt;x="B&amp;amp;C"; output;&lt;BR /&gt;x="E,F;C";output;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data want;&lt;BR /&gt;set have;&lt;BR /&gt;do i=1 by 1;&lt;BR /&gt;_x=scan(x,i);&lt;BR /&gt;if missing(_x) then return;&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;drop x;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Nov 2015 13:39:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-divide-the-variable-into-rows/m-p/233630#M42690</guid>
      <dc:creator>slchen</dc:creator>
      <dc:date>2015-11-07T13:39:35Z</dc:date>
    </item>
  </channel>
</rss>

