<?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 split a column based on delimiter with no fixed number of columns or width of phrases? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-split-a-column-based-on-delimiter-with-no-fixed-number-of/m-p/553957#M154084</link>
    <description>&lt;P&gt;Removed Output, still no difference.&lt;/P&gt;</description>
    <pubDate>Thu, 25 Apr 2019 13:42:48 GMT</pubDate>
    <dc:creator>Anurag_Kumar</dc:creator>
    <dc:date>2019-04-25T13:42:48Z</dc:date>
    <item>
      <title>How to split a column based on delimiter with no fixed number of columns or width of phrases?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-split-a-column-based-on-delimiter-with-no-fixed-number-of/m-p/553950#M154079</link>
      <description>&lt;P&gt;I have a dataset with a variable animal type(example). There are 30 animals overall and any row might have any number of animals:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Big cat; Tiny strong dog; White pony&lt;/P&gt;&lt;P&gt;Big cat;&lt;/P&gt;&lt;P&gt;White pony; Small rabbit;&lt;/P&gt;&lt;P&gt;Tiny strong dog; White pony&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to separate these into as many columns as required for a particular row. There is no restriction of keeping one column for one animal type. I am using the below code but there are multiple rows being generated along with multiple columns and these columns are empty.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data want;&lt;BR /&gt;set have;&lt;/P&gt;&lt;P&gt;array var(30);&lt;/P&gt;&lt;P&gt;do i=1 to 30;&lt;BR /&gt;var(i)=scan(Animal,i,";");&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please advise.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SAS EG version: 7.15&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2019 13:35:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-split-a-column-based-on-delimiter-with-no-fixed-number-of/m-p/553950#M154079</guid>
      <dc:creator>Anurag_Kumar</dc:creator>
      <dc:date>2019-04-25T13:35:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a column based on delimiter with no fixed number of columns or width of phrases?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-split-a-column-based-on-delimiter-with-no-fixed-number-of/m-p/553954#M154081</link>
      <description>&lt;P&gt;Remove &lt;FONT face="courier new,courier"&gt;OUTPUT;&lt;/FONT&gt; from your code.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2019 13:36:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-split-a-column-based-on-delimiter-with-no-fixed-number-of/m-p/553954#M154081</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-04-25T13:36:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a column based on delimiter with no fixed number of columns or width of phrases?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-split-a-column-based-on-delimiter-with-no-fixed-number-of/m-p/553957#M154084</link>
      <description>&lt;P&gt;Removed Output, still no difference.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2019 13:42:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-split-a-column-based-on-delimiter-with-no-fixed-number-of/m-p/553957#M154084</guid>
      <dc:creator>Anurag_Kumar</dc:creator>
      <dc:date>2019-04-25T13:42:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a column based on delimiter with no fixed number of columns or width of phrases?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-split-a-column-based-on-delimiter-with-no-fixed-number-of/m-p/553961#M154087</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/198798"&gt;@Anurag_Kumar&lt;/a&gt;&amp;nbsp; Welcome to SAS communities as I see your tag as New contributor. Can you please post a sample of the OUTPUT you want for the input? Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2019 13:47:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-split-a-column-based-on-delimiter-with-no-fixed-number-of/m-p/553961#M154087</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-04-25T13:47:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a column based on delimiter with no fixed number of columns or width of phrases?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-split-a-column-based-on-delimiter-with-no-fixed-number-of/m-p/553966#M154090</link>
      <description>&lt;P&gt;Perhaps you have read the data into your SAS data set improperly?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, are there ERRORs, WARNINGs or NOTEs in your SAS log? Please show us the ENTIRE SAS log.&lt;BR /&gt;&lt;BR /&gt;At this point, we need the SAS code that reads this data, the LOG, and you also need to show us the desired output.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2019 14:11:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-split-a-column-based-on-delimiter-with-no-fixed-number-of/m-p/553966#M154090</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-04-25T14:11:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a column based on delimiter with no fixed number of columns or width of phrases?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-split-a-column-based-on-delimiter-with-no-fixed-number-of/m-p/553971#M154092</link>
      <description>&lt;P&gt;Okay, I can get this to work, does this meet your needs?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
    input animal &amp;amp;$200.;
    cards4;
    Big cat; Tiny strong dog; White pony
    Big cat; guinea pig
    White pony; Small rabbit;
    Tiny strong dog; White pony
    ;;;;
run; 

data want;
    set have;
    array var(30) $ 40;
    do i=1 to 30;
        var(i)=scan(animal,i,";");
    end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 25 Apr 2019 14:16:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-split-a-column-based-on-delimiter-with-no-fixed-number-of/m-p/553971#M154092</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-04-25T14:16:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a column based on delimiter with no fixed number of columns or width of phrases?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-split-a-column-based-on-delimiter-with-no-fixed-number-of/m-p/553980#M154094</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/198798"&gt;@Anurag_Kumar&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have a dataset with a variable animal type(example). There are 30 animals overall and any row might have any number of animals:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Big cat; Tiny strong dog; White pony&lt;/P&gt;
&lt;P&gt;Big cat;&lt;/P&gt;
&lt;P&gt;White pony; Small rabbit;&lt;/P&gt;
&lt;P&gt;Tiny strong dog; White pony&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need to separate these into as many columns as required for a particular row. There is no restriction of keeping one column for one animal type. I am using the below code but there are multiple rows being generated along with multiple columns and these columns are empty.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;BR /&gt;set have;&lt;/P&gt;
&lt;P&gt;array var(30);&amp;nbsp; &lt;STRONG&gt;&lt;FONT color="#ff0000"&gt;&amp;lt;= this defines an array of numeric values so of course a number cannot be "Big cat"&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;do i=1 to 30;&lt;BR /&gt;var(i)=scan(Animal,i,";");&lt;BR /&gt;end;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please advise.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS EG version: 7.15&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Array var(30) $ 25; to create an array of character values able to hold up&amp;nbsp; to 25 characters per value. Set the length as seems appropriate.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2019 14:36:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-split-a-column-based-on-delimiter-with-no-fixed-number-of/m-p/553980#M154094</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-04-25T14:36:38Z</dc:date>
    </item>
  </channel>
</rss>

