<?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: Expanding Excel Cell into Rows and Filling in Other Columns in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Expanding-Excel-Cell-into-Rows-and-Filling-in-Other-Columns/m-p/501540#M133728</link>
    <description>&lt;P&gt;Aah ok,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
infile cards dlm=', ';
input (t1-t2) ($) t3- t12;
cards;
Test1 Test1.1 123, 124, 125, 521, 324, 432, 632, 992, 214, 215
;

data want;
set have;
array j t3-t12;
do over j;
want=j;
output;
end;
keep t1 t2 want;
run;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 04 Oct 2018 15:36:46 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2018-10-04T15:36:46Z</dc:date>
    <item>
      <title>Expanding Excel Cell into Rows and Filling in Other Columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Expanding-Excel-Cell-into-Rows-and-Filling-in-Other-Columns/m-p/501513#M133714</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do you Convert this Excel row:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Test1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Test1.1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;123, 124, 125, 521, 324, 432, 632, 992, 214, 215&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&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.1&lt;/TD&gt;&lt;TD&gt;215&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Thu, 04 Oct 2018 14:54:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Expanding-Excel-Cell-into-Rows-and-Filling-in-Other-Columns/m-p/501513#M133714</guid>
      <dc:creator>alexjaco</dc:creator>
      <dc:date>2018-10-04T14:54:45Z</dc:date>
    </item>
    <item>
      <title>Re: Expanding Excel Cell into Rows and Filling in Other Columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Expanding-Excel-Cell-into-Rows-and-Filling-in-Other-Columns/m-p/501520#M133718</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
infile cards dlm=', ';
input (t1-t2) ($) t3- t12;
cards;
Test1 Test1.1 123, 124, 125, 521, 324, 432, 632, 992, 214, 215
;

proc transpose data=have out=want(drop=_name_);
by t1 t2;
var t3-t12;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PS I am assuming you want to do that in SAS and you are posting accordingly in the right forum and not MS Excel forum?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Oct 2018 15:09:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Expanding-Excel-Cell-into-Rows-and-Filling-in-Other-Columns/m-p/501520#M133718</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-10-04T15:09:32Z</dc:date>
    </item>
    <item>
      <title>Re: Expanding Excel Cell into Rows and Filling in Other Columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Expanding-Excel-Cell-into-Rows-and-Filling-in-Other-Columns/m-p/501533#M133723</link>
      <description>&lt;P&gt;Yes done within SAS. Can you show me how it's done within&amp;nbsp;importing an excel data. It's a large file.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Oct 2018 15:22:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Expanding-Excel-Cell-into-Rows-and-Filling-in-Other-Columns/m-p/501533#M133723</guid>
      <dc:creator>alexjaco</dc:creator>
      <dc:date>2018-10-04T15:22:19Z</dc:date>
    </item>
    <item>
      <title>Re: Expanding Excel Cell into Rows and Filling in Other Columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Expanding-Excel-Cell-into-Rows-and-Filling-in-Other-Columns/m-p/501535#M133724</link>
      <description>&lt;P&gt;Are you asking how to import an excel file to SAS?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If yes, have you looked into&lt;/P&gt;
&lt;P&gt;1.proc import&lt;/P&gt;
&lt;P&gt;2. using import wizard point and click interface&lt;/P&gt;
&lt;P&gt;3. libname engiine xls&lt;/P&gt;
&lt;P&gt;and so on.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may have to search online quite a bit and do some reading&lt;/P&gt;</description>
      <pubDate>Thu, 04 Oct 2018 15:29:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Expanding-Excel-Cell-into-Rows-and-Filling-in-Other-Columns/m-p/501535#M133724</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-10-04T15:29:07Z</dc:date>
    </item>
    <item>
      <title>Re: Expanding Excel Cell into Rows and Filling in Other Columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Expanding-Excel-Cell-into-Rows-and-Filling-in-Other-Columns/m-p/501537#M133726</link>
      <description>&lt;P&gt;No I have the data imported and I'm wondering how to manipulate the data within the data step to expand the excel cell.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Oct 2018 15:34:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Expanding-Excel-Cell-into-Rows-and-Filling-in-Other-Columns/m-p/501537#M133726</guid>
      <dc:creator>alexjaco</dc:creator>
      <dc:date>2018-10-04T15:34:12Z</dc:date>
    </item>
    <item>
      <title>Re: Expanding Excel Cell into Rows and Filling in Other Columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Expanding-Excel-Cell-into-Rows-and-Filling-in-Other-Columns/m-p/501540#M133728</link>
      <description>&lt;P&gt;Aah ok,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
infile cards dlm=', ';
input (t1-t2) ($) t3- t12;
cards;
Test1 Test1.1 123, 124, 125, 521, 324, 432, 632, 992, 214, 215
;

data want;
set have;
array j t3-t12;
do over j;
want=j;
output;
end;
keep t1 t2 want;
run;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 04 Oct 2018 15:36:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Expanding-Excel-Cell-into-Rows-and-Filling-in-Other-Columns/m-p/501540#M133728</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-10-04T15:36:46Z</dc:date>
    </item>
    <item>
      <title>Re: Expanding Excel Cell into Rows and Filling in Other Columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Expanding-Excel-Cell-into-Rows-and-Filling-in-Other-Columns/m-p/501542#M133729</link>
      <description>&lt;P&gt;The data is more complicated than that. Here's a better sample of the data. This goes on for 40,000+ excel lines.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Name1&lt;/TD&gt;&lt;TD&gt;Name1.1&lt;/TD&gt;&lt;TD&gt;99201, 99202, 99203, 99204, 99205, 97813, 97814, 97810, 97811&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Name1&lt;/TD&gt;&lt;TD&gt;Name1.2&lt;/TD&gt;&lt;TD&gt;99205, 99211, 97813, 97814, 97810, 97811&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Name2&lt;/TD&gt;&lt;TD&gt;Name2.1&lt;/TD&gt;&lt;TD&gt;S5101, S5102, S5105&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Thu, 04 Oct 2018 15:42:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Expanding-Excel-Cell-into-Rows-and-Filling-in-Other-Columns/m-p/501542#M133729</guid>
      <dc:creator>alexjaco</dc:creator>
      <dc:date>2018-10-04T15:42:08Z</dc:date>
    </item>
    <item>
      <title>Re: Expanding Excel Cell into Rows and Filling in Other Columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Expanding-Excel-Cell-into-Rows-and-Filling-in-Other-Columns/m-p/501550#M133732</link>
      <description>&lt;P&gt;Oh well, i see your num values are all in a one variable seperated by comma as delimiter&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Alll you need to do is scan one by one in a loop&amp;nbsp; &amp;nbsp;and output for each scan.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
infile cards truncover;
input t1 $ t2 $ num  $100.;
cards;
Name1	Name1.1	99201, 99202, 99203, 99204, 99205, 97813, 97814, 97810, 97811
Name1	Name1.2	99205, 99211, 97813, 97814, 97810, 97811
Name2	Name2.1	S5101, S5102, S5105
;

data want;
set have;
k=countw(num,',');
do i=1 to k;
want=scan(num,i,',');
output;
end;
keep t: want;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Oct 2018 15:48:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Expanding-Excel-Cell-into-Rows-and-Filling-in-Other-Columns/m-p/501550#M133732</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-10-04T15:48:43Z</dc:date>
    </item>
    <item>
      <title>Re: Expanding Excel Cell into Rows and Filling in Other Columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Expanding-Excel-Cell-into-Rows-and-Filling-in-Other-Columns/m-p/501556#M133735</link>
      <description>&lt;P&gt;Didn't work.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Oct 2018 15:55:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Expanding-Excel-Cell-into-Rows-and-Filling-in-Other-Columns/m-p/501556#M133735</guid>
      <dc:creator>alexjaco</dc:creator>
      <dc:date>2018-10-04T15:55:53Z</dc:date>
    </item>
    <item>
      <title>Re: Expanding Excel Cell into Rows and Filling in Other Columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Expanding-Excel-Cell-into-Rows-and-Filling-in-Other-Columns/m-p/501557#M133736</link>
      <description>&lt;P&gt;I can only test with the sample you post. So you may have to adjust to your real data accordingly.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Oct 2018 15:57:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Expanding-Excel-Cell-into-Rows-and-Filling-in-Other-Columns/m-p/501557#M133736</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-10-04T15:57:02Z</dc:date>
    </item>
    <item>
      <title>Re: Expanding Excel Cell into Rows and Filling in Other Columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Expanding-Excel-Cell-into-Rows-and-Filling-in-Other-Columns/m-p/501558#M133737</link>
      <description>&lt;P&gt;I figured it out! Thanks for your help!&lt;/P&gt;</description>
      <pubDate>Thu, 04 Oct 2018 16:06:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Expanding-Excel-Cell-into-Rows-and-Filling-in-Other-Columns/m-p/501558#M133737</guid>
      <dc:creator>alexjaco</dc:creator>
      <dc:date>2018-10-04T16:06:06Z</dc:date>
    </item>
  </channel>
</rss>

