<?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 Create a dataset splitting the column of another dataset. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Create-a-dataset-splitting-the-column-of-another-dataset/m-p/27469#M5038</link>
    <description>Hi all, &lt;BR /&gt;
I’d like to create a dataset with two columns splitting the column of another dataset.&lt;BR /&gt;
I have a dataset like this:&lt;BR /&gt;
&lt;BR /&gt;
data A;&lt;BR /&gt;
length report $15;&lt;BR /&gt;
input report;&lt;BR /&gt;
datalines;&lt;BR /&gt;
Germany_1&lt;BR /&gt;
Italy_1&lt;BR /&gt;
Italy_2&lt;BR /&gt;
Italy_3&lt;BR /&gt;
Germany_2&lt;BR /&gt;
Italy_4&lt;BR /&gt;
Germany_3&lt;BR /&gt;
Italy_5&lt;BR /&gt;
Italy_6&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
And I need to create a new dataset based in the other one. It should be like this:&lt;BR /&gt;
&lt;BR /&gt;
Germany_1 Italy_1&lt;BR /&gt;
Germany_1 Italy_2&lt;BR /&gt;
Germany_1 Italy_3&lt;BR /&gt;
Germany_2 Italy_4&lt;BR /&gt;
Germany_3 Italy_5&lt;BR /&gt;
Germany_3 Italy_6&lt;BR /&gt;
&lt;BR /&gt;
I can use the condition that the variable begins with Germany or Italy, but I don’t know how.&lt;BR /&gt;
&lt;BR /&gt;
Can anybody help me?&lt;BR /&gt;
&lt;BR /&gt;
Thanks!&lt;BR /&gt;
Elena</description>
    <pubDate>Wed, 26 May 2010 13:56:40 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2010-05-26T13:56:40Z</dc:date>
    <item>
      <title>Create a dataset splitting the column of another dataset.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-dataset-splitting-the-column-of-another-dataset/m-p/27469#M5038</link>
      <description>Hi all, &lt;BR /&gt;
I’d like to create a dataset with two columns splitting the column of another dataset.&lt;BR /&gt;
I have a dataset like this:&lt;BR /&gt;
&lt;BR /&gt;
data A;&lt;BR /&gt;
length report $15;&lt;BR /&gt;
input report;&lt;BR /&gt;
datalines;&lt;BR /&gt;
Germany_1&lt;BR /&gt;
Italy_1&lt;BR /&gt;
Italy_2&lt;BR /&gt;
Italy_3&lt;BR /&gt;
Germany_2&lt;BR /&gt;
Italy_4&lt;BR /&gt;
Germany_3&lt;BR /&gt;
Italy_5&lt;BR /&gt;
Italy_6&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
And I need to create a new dataset based in the other one. It should be like this:&lt;BR /&gt;
&lt;BR /&gt;
Germany_1 Italy_1&lt;BR /&gt;
Germany_1 Italy_2&lt;BR /&gt;
Germany_1 Italy_3&lt;BR /&gt;
Germany_2 Italy_4&lt;BR /&gt;
Germany_3 Italy_5&lt;BR /&gt;
Germany_3 Italy_6&lt;BR /&gt;
&lt;BR /&gt;
I can use the condition that the variable begins with Germany or Italy, but I don’t know how.&lt;BR /&gt;
&lt;BR /&gt;
Can anybody help me?&lt;BR /&gt;
&lt;BR /&gt;
Thanks!&lt;BR /&gt;
Elena</description>
      <pubDate>Wed, 26 May 2010 13:56:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-dataset-splitting-the-column-of-another-dataset/m-p/27469#M5038</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-05-26T13:56:40Z</dc:date>
    </item>
    <item>
      <title>Re: Create a dataset splitting the column of another dataset.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-dataset-splitting-the-column-of-another-dataset/m-p/27470#M5039</link>
      <description>use following code:&lt;BR /&gt;
&lt;BR /&gt;
data b;&lt;BR /&gt;
set a;&lt;BR /&gt;
retain temp;&lt;BR /&gt;
if _n_ = 1 then temp = report;       &lt;BR /&gt;
if index(scan(temp,1,'_'),scan(report,1,'_')) then temp = report;   &lt;BR /&gt;
if temp = report then delete; &lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
GL.</description>
      <pubDate>Wed, 26 May 2010 14:11:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-dataset-splitting-the-column-of-another-dataset/m-p/27470#M5039</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-05-26T14:11:28Z</dc:date>
    </item>
    <item>
      <title>Re: Create a dataset splitting the column of another dataset.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-dataset-splitting-the-column-of-another-dataset/m-p/27471#M5040</link>
      <description>Perfect!&lt;BR /&gt;
Thank you!!!</description>
      <pubDate>Wed, 26 May 2010 14:46:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-dataset-splitting-the-column-of-another-dataset/m-p/27471#M5040</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-05-26T14:46:01Z</dc:date>
    </item>
  </channel>
</rss>

