<?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: tranpose wide to long in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/tranpose-wide-to-long/m-p/645561#M193012</link>
    <description>&lt;P&gt;please try the below code&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc transpose data=have;
by fund_ticker constituent_ticker name detail_holdeing_type;
var 20180102 20180103 20180104 20180105 20180108;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 06 May 2020 12:46:17 GMT</pubDate>
    <dc:creator>Jagadishkatam</dc:creator>
    <dc:date>2020-05-06T12:46:17Z</dc:date>
    <item>
      <title>tranpose wide to long</title>
      <link>https://communities.sas.com/t5/SAS-Programming/tranpose-wide-to-long/m-p/645556#M193008</link>
      <description>&lt;P&gt;I have a dataset of fund holdings as attached. It is currently in a wide format. I would like to change it to a long format where there is one date column and one number_of_share column. Attached is&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried using the following code to transpose but it does not work. It says No variables to tranpose. I tried with a different dataset and it works&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc transpose data=sample2 out=sample_long;
	  by fund_ticker constituent_ticker name Detail_Holding_Type ;
	  run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 May 2020 11:58:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/tranpose-wide-to-long/m-p/645556#M193008</guid>
      <dc:creator>somebody</dc:creator>
      <dc:date>2020-05-06T11:58:42Z</dc:date>
    </item>
    <item>
      <title>Re: tranpose wide to long</title>
      <link>https://communities.sas.com/t5/SAS-Programming/tranpose-wide-to-long/m-p/645561#M193012</link>
      <description>&lt;P&gt;please try the below code&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc transpose data=have;
by fund_ticker constituent_ticker name detail_holdeing_type;
var 20180102 20180103 20180104 20180105 20180108;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 May 2020 12:46:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/tranpose-wide-to-long/m-p/645561#M193012</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2020-05-06T12:46:17Z</dc:date>
    </item>
    <item>
      <title>Re: tranpose wide to long</title>
      <link>https://communities.sas.com/t5/SAS-Programming/tranpose-wide-to-long/m-p/645566#M193013</link>
      <description>&lt;P&gt;You have invalid SAS names in that CSV (numeric), which my University Edition dutifully changed to names with leading underlines on import.&lt;/P&gt;
&lt;P&gt;Then this code worked:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=import;
by fund_ticker constituent_ticker name Detail_Holding_Type;
run;

proc transpose data=import out=sample_long;
by fund_ticker constituent_ticker name Detail_Holding_Type;
var _:;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Note that there are a lot of ambiguous observations in the imported dataset (multiples for the same keys), which leads to more output columns than expected.&lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2020 12:40:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/tranpose-wide-to-long/m-p/645566#M193013</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-05-06T12:40:53Z</dc:date>
    </item>
  </channel>
</rss>

