<?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: Proc Transpose from wide to long in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose-from-wide-to-long/m-p/601623#M174040</link>
    <description>&lt;P&gt;You can do the renaming like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc transpose data =ttt1 out= ttt12(rename=(_Name_=date));
by ID;
var X1909 X1908 X1907 X1906 X1905;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;As for removing the 'X'.. This is a data manipulation question. Not a job for PROC TRANSPOSE. i would simply add a data step&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data ttt13;
    set ttt12;
    date=compress(date, , 'kd');
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 05 Nov 2019 10:43:36 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2019-11-05T10:43:36Z</dc:date>
    <item>
      <title>Proc Transpose from wide to long</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose-from-wide-to-long/m-p/601622#M174039</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I am using&amp;nbsp;Proc Transpose from wide to long.&lt;/P&gt;
&lt;P&gt;There are 2 things that I want to ask please:&lt;/P&gt;
&lt;P&gt;question 1;&lt;/P&gt;
&lt;P&gt;Why in the data set ttt2&amp;nbsp; column name is "X1"?&lt;/P&gt;
&lt;P&gt;I want to call it "X&lt;/P&gt;
&lt;P&gt;question 2:&lt;/P&gt;
&lt;P&gt;I want to rename&amp;nbsp; Column _Name_ to&amp;nbsp; 'date'&lt;/P&gt;
&lt;P&gt;I want that values will be&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1909&lt;BR /&gt;1908&lt;BR /&gt;1907&lt;BR /&gt;1906&lt;BR /&gt;1905&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and not&amp;nbsp;&lt;/P&gt;
&lt;P&gt;X1909&lt;BR /&gt;X1908&lt;BR /&gt;X1907&lt;BR /&gt;X1906&lt;BR /&gt;X1905&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data ttt1;
Input ID X1909 X1908 X1907 X1906 X1905;
cards;
1 10 25 32 40 51
2 12 14 6 18 20
3 15 22 27 33 22
;
run;

/*ID date X*/
/*1  1909 10*/
/*1  1908 25*/
/*1  1907 32*/
/*1  1906 40*/
/*1  1905 51*/
/*2  1909 12*/
/*2  1908 14*/
/*2  1907 6*/
/*2  1906 18*/
/*2  1905 20*/
/*3  1909 15*/
/*3  1908 22*/
/*3  1907 27*/
/*3  1906 33*/
/*3  1905 22*/
 

proc transpose data =ttt1 out= ttt12  prefix=X;
by ID;
var X1909 X1908 X1907 X1906 X1905;
run;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 05 Nov 2019 10:38:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose-from-wide-to-long/m-p/601622#M174039</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2019-11-05T10:38:17Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Transpose from wide to long</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose-from-wide-to-long/m-p/601623#M174040</link>
      <description>&lt;P&gt;You can do the renaming like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc transpose data =ttt1 out= ttt12(rename=(_Name_=date));
by ID;
var X1909 X1908 X1907 X1906 X1905;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;As for removing the 'X'.. This is a data manipulation question. Not a job for PROC TRANSPOSE. i would simply add a data step&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data ttt13;
    set ttt12;
    date=compress(date, , 'kd');
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 05 Nov 2019 10:43:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose-from-wide-to-long/m-p/601623#M174040</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-11-05T10:43:36Z</dc:date>
    </item>
  </channel>
</rss>

