<?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: Create a new dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Create-a-new-dataset/m-p/834132#M329795</link>
    <description>&lt;P&gt;May I suggest you not do this, and leave the data as in your first data set. Data is much easier to work with in a long data set rather than a wide data set. What is the purpose and goal of making the second data set? What will you do with the 2nd data set that you can't do with the first data set? Do you want a report that looks like this? Do you want to perform some statistical or graphical analysis on this data?&lt;/P&gt;</description>
    <pubDate>Mon, 19 Sep 2022 17:27:10 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2022-09-19T17:27:10Z</dc:date>
    <item>
      <title>Create a new dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-new-dataset/m-p/834128#M329791</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am working on data cleaning/management, and getting stuck in some points..&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have dataset as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;id name type score1&amp;nbsp;&lt;/P&gt;&lt;P&gt;1&amp;nbsp; apple&amp;nbsp; &amp;nbsp;A&amp;nbsp; &amp;nbsp; &amp;nbsp; 15&lt;/P&gt;&lt;P&gt;1&amp;nbsp; apple&amp;nbsp; &amp;nbsp;B&amp;nbsp; &amp;nbsp; &amp;nbsp; 18&amp;nbsp;&lt;/P&gt;&lt;P&gt;2&amp;nbsp; pear&amp;nbsp; &amp;nbsp; &amp;nbsp;A&amp;nbsp; &amp;nbsp; &amp;nbsp; 17&lt;/P&gt;&lt;P&gt;2&amp;nbsp; pear&amp;nbsp; &amp;nbsp; &amp;nbsp;B&amp;nbsp; &amp;nbsp; &amp;nbsp; 20&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to create new dataset in this order:&lt;/P&gt;&lt;P&gt;id name typeA_score typeB_score&lt;/P&gt;&lt;P&gt;1 apple&amp;nbsp; &amp;nbsp; &amp;nbsp; 15&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;18&amp;nbsp;&lt;/P&gt;&lt;P&gt;2 pear&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 17&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;20&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could anyone please let me know how I create the new dataset?&lt;/P&gt;&lt;P&gt;Many thanks!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Sep 2022 17:01:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-new-dataset/m-p/834128#M329791</guid>
      <dc:creator>walker105</dc:creator>
      <dc:date>2022-09-19T17:01:33Z</dc:date>
    </item>
    <item>
      <title>Re: Create a new dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-new-dataset/m-p/834132#M329795</link>
      <description>&lt;P&gt;May I suggest you not do this, and leave the data as in your first data set. Data is much easier to work with in a long data set rather than a wide data set. What is the purpose and goal of making the second data set? What will you do with the 2nd data set that you can't do with the first data set? Do you want a report that looks like this? Do you want to perform some statistical or graphical analysis on this data?&lt;/P&gt;</description>
      <pubDate>Mon, 19 Sep 2022 17:27:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-new-dataset/m-p/834132#M329795</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-09-19T17:27:10Z</dc:date>
    </item>
    <item>
      <title>Re: Create a new dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-new-dataset/m-p/834147#M329807</link>
      <description>&lt;P&gt;I agree with&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;it's not a good idea to reshape your actual data.&amp;nbsp; If all you want is a report the just use Proc Report.&amp;nbsp; As a bonus, the output dataset (want) will provide you with the dataset you requested, just rename the variables _C3_ and _C4_ as required.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc report nowd out=want;
  columns id name type,score1;
  define id /group;
  define name /group;
  define type /across;
  define score1/analysis;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ghosh_0-1663611342097.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/75376i9C1762948AE13D0A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ghosh_0-1663611342097.png" alt="ghosh_0-1663611342097.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Sep 2022 18:17:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-new-dataset/m-p/834147#M329807</guid>
      <dc:creator>ghosh</dc:creator>
      <dc:date>2022-09-19T18:17:39Z</dc:date>
    </item>
    <item>
      <title>Re: Create a new dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-new-dataset/m-p/834156#M329808</link>
      <description>&lt;P&gt;Easy enough to do with PROC TRANSPOSE using the ID statement and the PREFIX= and SUFFIX= options.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have ;
  input id name $ type $ score1 ;
cards;
1  apple   A      15
1  apple   B      18 
2  pear    A      17
2  pear    B      20
;

proc transpose data=have out=want prefix=type suffix=_score;
  by id name;
  id type;
  var score1;
run;

proc print data=want;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;                                typeA_    typeB_
Obs    id    name     _NAME_     score     score

 1      1    apple    score1      15        18
 2      2    pear     score1      17        20
&lt;/PRE&gt;</description>
      <pubDate>Mon, 19 Sep 2022 19:03:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-new-dataset/m-p/834156#M329808</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-09-19T19:03:31Z</dc:date>
    </item>
    <item>
      <title>Re: Create a new dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-new-dataset/m-p/834350#M329883</link>
      <description>&lt;P&gt;Thanks for your suggestions!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Sep 2022 18:25:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-new-dataset/m-p/834350#M329883</guid>
      <dc:creator>walker105</dc:creator>
      <dc:date>2022-09-20T18:25:38Z</dc:date>
    </item>
  </channel>
</rss>

