<?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: melt dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/melt-dataset/m-p/496628#M131388</link>
    <description>Hello Reeza, I appreciate your advice paper which helps me a lot.</description>
    <pubDate>Tue, 18 Sep 2018 16:14:40 GMT</pubDate>
    <dc:creator>France</dc:creator>
    <dc:date>2018-09-18T16:14:40Z</dc:date>
    <item>
      <title>melt dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/melt-dataset/m-p/496556#M131356</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;how could I create a table from&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;psn_name, application200001, application200002, application200003
a,1,2,3
b,2,3,4&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;to&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;psn_name, date, Number_of_applications
a,200001,1
a,200002,2
a,200003,3
b,200001,2
b,200002,3
b,200003,4&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;an example I need is&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="69C51462674E368EF1840C9BE1767F9D.png" style="width: 551px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/23345i9D609D2637761F75/image-size/large?v=v2&amp;amp;px=999" role="button" title="69C51462674E368EF1840C9BE1767F9D.png" alt="69C51462674E368EF1840C9BE1767F9D.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;could you please give me some suggestions?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Sep 2018 13:33:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/melt-dataset/m-p/496556#M131356</guid>
      <dc:creator>France</dc:creator>
      <dc:date>2018-09-18T13:33:45Z</dc:date>
    </item>
    <item>
      <title>Re: melt dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/melt-dataset/m-p/496565#M131363</link>
      <description>&lt;P&gt;This creates an actual date value that represents the first day of the month. Use any date format to display the date that you would like.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data have;
infile datalines dlm=',';
input psn_name $ application200001 application200002 application200003 ;
datalines;
a,1,2,3
b,2,3,4
;
run;

proc transpose data=have out=havetrans;
 by psn_name;
 var  application:;
run;

data want;
   set havetrans;
   date= input(substr(_name_,12,6),yymmn6.);
   format date yymmn.;
   drop _name_;
   rename col1=Number_of_applications;
run;

&lt;/PRE&gt;
&lt;P&gt;If the data is not sorted by psn_name it will need to be sorted before the Proc Transpose step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Sep 2018 14:07:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/melt-dataset/m-p/496565#M131363</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-09-18T14:07:44Z</dc:date>
    </item>
    <item>
      <title>Re: melt dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/melt-dataset/m-p/496567#M131364</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
infile cards dlm=',';
input psn_name $  application200001  application200002  application200003;
cards;
a,1,2,3
b,2,3,4
;
run;
data want;
 set have;
 array x{*} application:;
 do i=1 to dim(x);
  date=compress(vname(x{i}),,'kd');
  number=x{i};
  output;
 end;
keep psn_name date number;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 18 Sep 2018 14:14:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/melt-dataset/m-p/496567#M131364</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2018-09-18T14:14:42Z</dc:date>
    </item>
    <item>
      <title>Re: melt dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/melt-dataset/m-p/496588#M131367</link>
      <description>&lt;P&gt;Melt is the R function, transpose is the actual action of flipping a table and the generic term used in most languages.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC TRANSPOSE transposes both wide to long and long to wide.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or an array method can be used.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC TRANSPOSE&lt;/P&gt;
&lt;P&gt;&lt;A href="https://stats.idre.ucla.edu/sas/modules/how-to-reshape-data-wide-to-long-using-proc-transpose/" target="_blank"&gt;https://stats.idre.ucla.edu/sas/modules/how-to-reshape-data-wide-to-long-using-proc-transpose/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Array&lt;/P&gt;
&lt;P&gt;&lt;A href="https://stats.idre.ucla.edu/sas/modules/reshaping-data-wide-to-long-using-a-data-step/" target="_blank"&gt;https://stats.idre.ucla.edu/sas/modules/reshaping-data-wide-to-long-using-a-data-step/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Sep 2018 15:08:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/melt-dataset/m-p/496588#M131367</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-09-18T15:08:25Z</dc:date>
    </item>
    <item>
      <title>Re: melt dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/melt-dataset/m-p/496628#M131388</link>
      <description>Hello Reeza, I appreciate your advice paper which helps me a lot.</description>
      <pubDate>Tue, 18 Sep 2018 16:14:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/melt-dataset/m-p/496628#M131388</guid>
      <dc:creator>France</dc:creator>
      <dc:date>2018-09-18T16:14:40Z</dc:date>
    </item>
  </channel>
</rss>

