<?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 How to automatically create dataset with name equal to values of a column in a given dataset? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-automatically-create-dataset-with-name-equal-to-values-of/m-p/546335#M151258</link>
    <description>&lt;P&gt;Starting with a dataset similar to the following (with unknown number of columns / rows, but one of the column's name is ds_name):&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA foo;
INPUT ds_name $ m1 m2 m3;
DATALINES;
ds1 1 2.1 3
ds2 3 4.7 5.3
;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;How to automatically create a generic macro program that creates the following datasets?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA ds1;
INPUT m1 m2 m3;
DATALINES;
1 2.1 3
;
RUN;
DATA ds2;
INPUT m1 m2 m3;
DATALINES;
3 4.7 5.3
;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Tue, 26 Mar 2019 22:41:50 GMT</pubDate>
    <dc:creator>clarkchong1</dc:creator>
    <dc:date>2019-03-26T22:41:50Z</dc:date>
    <item>
      <title>How to automatically create dataset with name equal to values of a column in a given dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-automatically-create-dataset-with-name-equal-to-values-of/m-p/546335#M151258</link>
      <description>&lt;P&gt;Starting with a dataset similar to the following (with unknown number of columns / rows, but one of the column's name is ds_name):&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA foo;
INPUT ds_name $ m1 m2 m3;
DATALINES;
ds1 1 2.1 3
ds2 3 4.7 5.3
;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;How to automatically create a generic macro program that creates the following datasets?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA ds1;
INPUT m1 m2 m3;
DATALINES;
1 2.1 3
;
RUN;
DATA ds2;
INPUT m1 m2 m3;
DATALINES;
3 4.7 5.3
;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2019 22:41:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-automatically-create-dataset-with-name-equal-to-values-of/m-p/546335#M151258</guid>
      <dc:creator>clarkchong1</dc:creator>
      <dc:date>2019-03-26T22:41:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to automatically create dataset with name equal to values of a column in a given dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-automatically-create-dataset-with-name-equal-to-values-of/m-p/546337#M151260</link>
      <description>&lt;P&gt;Is the number of different values of ds_name&amp;nbsp; unknown before the process starts?&lt;/P&gt;
&lt;P&gt;Will ds_name &lt;STRONG&gt;ever&lt;/STRONG&gt; have characters other than letters, digits and _ ?&lt;/P&gt;
&lt;P&gt;Will it ever start with&amp;nbsp;a character other than&amp;nbsp;letter or _?&lt;/P&gt;
&lt;P&gt;Will the length of ds_name ever exceed 32 characters?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the answer to any of the above is Yes you are likely to have issues.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And possibly the most import question: Why do you think that you need to split the data apart in the first place?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2019 22:48:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-automatically-create-dataset-with-name-equal-to-values-of/m-p/546337#M151260</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-03-26T22:48:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to automatically create dataset with name equal to values of a column in a given dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-automatically-create-dataset-with-name-equal-to-values-of/m-p/546343#M151264</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/147980"&gt;@clarkchong1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the data per DS fits into memory then another approach would be to use a hash table instead of generating code. The hash output method allows you to create data sets during execution time of a data step.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2019 22:54:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-automatically-create-dataset-with-name-equal-to-values-of/m-p/546343#M151264</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-03-26T22:54:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to automatically create dataset with name equal to values of a column in a given dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-automatically-create-dataset-with-name-equal-to-values-of/m-p/546344#M151265</link>
      <description>&lt;P&gt;The general concensus is don't do this, because SAS has many ways of processing data by groups. There are some use cases where this is required but if you find yourself later on writing macro loops, this likely isn't one.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's a dynamic approach:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/sasdummy/2015/01/26/how-to-split-one-data-set-into-many/" target="_blank"&gt;https://blogs.sas.com/content/sasdummy/2015/01/26/how-to-split-one-data-set-into-many/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2019 22:55:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-automatically-create-dataset-with-name-equal-to-values-of/m-p/546344#M151265</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-03-26T22:55:41Z</dc:date>
    </item>
  </channel>
</rss>

