<?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: Reorganizing Data in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Reorganizing-Data/m-p/572435#M17577</link>
    <description>&lt;P&gt;here is a new version of the file&lt;/P&gt;</description>
    <pubDate>Wed, 10 Jul 2019 17:22:40 GMT</pubDate>
    <dc:creator>NickA1</dc:creator>
    <dc:date>2019-07-10T17:22:40Z</dc:date>
    <item>
      <title>Reorganizing Data</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Reorganizing-Data/m-p/572398#M17571</link>
      <description>&lt;P&gt;Hi, I'm a new user and I am trying to do some data restructuring. I am ultimately putting data in Power BI to create some charts. My data is in excel, but the file is so massive that it takes a very long time to do anything because it spends so much time buffering. Basically what I want to do is take matrix style data, and stack each column on top of the others.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, I have a date column, and then columns for different stocks that contain the prices of each of those stocks on each of the days in the date column. To be able to use this is Power BI, I need to have all of the prices stacked on top of each other, and then I need to add another column that has what the stock is. So, all in all I need three columns: Date, Stock Identifier, and Prices.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone have any idea on how I can do this in SAS?&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 15:11:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Reorganizing-Data/m-p/572398#M17571</guid>
      <dc:creator>NickA1</dc:creator>
      <dc:date>2019-07-10T15:11:19Z</dc:date>
    </item>
    <item>
      <title>Re: Reorganizing Data</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Reorganizing-Data/m-p/572402#M17572</link>
      <description>&lt;P&gt;Please show us a portion of your Excel file, so we have a better idea of what the data looks like.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I show example SAS code in which there are only three stocks, and the data is re-arranged as I think you have asked:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data a;
    input date :date7. ford chevy gm;
	cards;
01JAN18 203 209 18
02JAN18 204 210 19
;
data want;
	set a;
	array stocks ford--gm;
	do i=1 to dim(stocks);
	    value=stocks(i);
		stockname=vname(stocks(i));
		output;
	end;
	keep date value stockname;
	format date date7.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;In your case, your input data set would be from Excel and not from data set A.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 15:34:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Reorganizing-Data/m-p/572402#M17572</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-07-10T15:34:00Z</dc:date>
    </item>
    <item>
      <title>Re: Reorganizing Data</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Reorganizing-Data/m-p/572404#M17573</link>
      <description>PROC TRANSPOSE most likely.</description>
      <pubDate>Wed, 10 Jul 2019 15:22:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Reorganizing-Data/m-p/572404#M17573</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-07-10T15:22:00Z</dc:date>
    </item>
    <item>
      <title>Re: Reorganizing Data</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Reorganizing-Data/m-p/572416#M17574</link>
      <description>&lt;P&gt;Here is some of the data&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 15:42:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Reorganizing-Data/m-p/572416#M17574</guid>
      <dc:creator>NickA1</dc:creator>
      <dc:date>2019-07-10T15:42:14Z</dc:date>
    </item>
    <item>
      <title>Re: Reorganizing Data</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Reorganizing-Data/m-p/572420#M17575</link>
      <description>&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;</description>
      <pubDate>Wed, 10 Jul 2019 15:57:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Reorganizing-Data/m-p/572420#M17575</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-07-10T15:57:42Z</dc:date>
    </item>
    <item>
      <title>Re: Reorganizing Data</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Reorganizing-Data/m-p/572424#M17576</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/281094"&gt;@NickA1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Here is some of the data&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;The file you posted is too large for the web site to show us:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;Sheet "Sheet2" is too large to be previewed. Please download the file to view this sheet.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Post just a subset of the rows and columns so we get an idea of how the data is structured.&amp;nbsp; Even better post a simple SAS data step that creates a small sample of what you get after importing the XLSX file into SAS.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 16:29:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Reorganizing-Data/m-p/572424#M17576</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-07-10T16:29:30Z</dc:date>
    </item>
    <item>
      <title>Re: Reorganizing Data</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Reorganizing-Data/m-p/572435#M17577</link>
      <description>&lt;P&gt;here is a new version of the file&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 17:22:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Reorganizing-Data/m-p/572435#M17577</guid>
      <dc:creator>NickA1</dc:creator>
      <dc:date>2019-07-10T17:22:40Z</dc:date>
    </item>
    <item>
      <title>Re: Reorganizing Data</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Reorganizing-Data/m-p/572436#M17578</link>
      <description>Did you check the link I posted, it has the solution you need in there? If you tried and it didn't work, post your code.</description>
      <pubDate>Wed, 10 Jul 2019 17:24:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Reorganizing-Data/m-p/572436#M17578</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-07-10T17:24:52Z</dc:date>
    </item>
    <item>
      <title>Re: Reorganizing Data</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Reorganizing-Data/m-p/572440#M17579</link>
      <description>&lt;P&gt;SAS should be able to read in the Excel file using PROC IMPORT or XLSX libname engine.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since it looks like you just have numeric variables your code to transform it could be as simple as:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc transpose data=HAVE out=WANT;
  by date;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;since by default it will transpose all of the numeric variables.&lt;/P&gt;
&lt;P&gt;You will then get a dataset with DATE, _NAME_ and COL1.&amp;nbsp; You might also have _LABEL_ if the any of the variables had a label attached.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 17:28:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Reorganizing-Data/m-p/572440#M17579</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-07-10T17:28:40Z</dc:date>
    </item>
  </channel>
</rss>

