<?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 Transpose Columns into Rows and vice versa with an array in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Transpose-Columns-into-Rows-and-vice-versa-with-an-array/m-p/615350#M179984</link>
    <description>&lt;P&gt;&lt;SPAN&gt;I have the following data.&amp;nbsp; Table1 which is symetric and the number of rows is equal to the numbers of columns.&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;BR /&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="table1.PNG" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/35166i91EC223BEA2FEBC6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="table1.PNG" alt="table1.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to make a transpose, so columns become rows and vice versa without using the Transpose function since I don't have IML Licence.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you help me please ?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 06 Jan 2020 14:39:15 GMT</pubDate>
    <dc:creator>KarimaTouati</dc:creator>
    <dc:date>2020-01-06T14:39:15Z</dc:date>
    <item>
      <title>Transpose Columns into Rows and vice versa with an array</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Transpose-Columns-into-Rows-and-vice-versa-with-an-array/m-p/615350#M179984</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I have the following data.&amp;nbsp; Table1 which is symetric and the number of rows is equal to the numbers of columns.&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;BR /&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="table1.PNG" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/35166i91EC223BEA2FEBC6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="table1.PNG" alt="table1.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to make a transpose, so columns become rows and vice versa without using the Transpose function since I don't have IML Licence.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you help me please ?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jan 2020 14:39:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Transpose-Columns-into-Rows-and-vice-versa-with-an-array/m-p/615350#M179984</guid>
      <dc:creator>KarimaTouati</dc:creator>
      <dc:date>2020-01-06T14:39:15Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose Columns into Rows and vice versa with an array</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Transpose-Columns-into-Rows-and-vice-versa-with-an-array/m-p/615358#M179989</link>
      <description>&lt;P&gt;Here is the conversion from "wide format" (many columns) to "long format":&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Have;
input Annee Annee1-Annee7;
datalines;
1995 1 2 3 4 5 6 7
1996 1 2 3 4 5 6 .
1997 1 2 3 4 5 . .
1998 1 2 3 4 . . .
1999 1 2 3 . . . .
2000 1 2 . . . . .
2001 1 . . . . . .
;

data Want;
set Have;
array Y[7] Annee1-Annee7;
i = _N_;
do j = 1 to dim(Y) - i + 1;
   Value = Y[j];
   output;
end;
keep Annee i j Value;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I'll bet that if you think about it you will be able to go the other way without help. Give it a try!&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jan 2020 14:49:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Transpose-Columns-into-Rows-and-vice-versa-with-an-array/m-p/615358#M179989</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2020-01-06T14:49:30Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose Columns into Rows and vice versa with an array</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Transpose-Columns-into-Rows-and-vice-versa-with-an-array/m-p/615359#M179990</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/271744"&gt;@KarimaTouati&lt;/a&gt;&amp;nbsp;and welcome to the SAS Support Communities!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The &lt;A href="https://documentation.sas.com/?docsetId=proc&amp;amp;docsetTarget=n1xno5xgs39b70n0zydov0owajj8.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank" rel="noopener"&gt;TRANSPOSE &lt;EM&gt;procedure&lt;/EM&gt;&lt;/A&gt; does exactly what you describe:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc transpose data=have out=want;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 06 Jan 2020 14:49:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Transpose-Columns-into-Rows-and-vice-versa-with-an-array/m-p/615359#M179990</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2020-01-06T14:49:32Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose Columns into Rows and vice versa with an array</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Transpose-Columns-into-Rows-and-vice-versa-with-an-array/m-p/615362#M179993</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/271744"&gt;@KarimaTouati&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In addition to&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733"&gt;@FreelanceReinh&lt;/a&gt;'s answer, I would also add a COPY statement not to transpose the "annee" column:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
	infile datalines truncover;
	input annee annee1-annee7;
	datalines;
1995 23758 49114 68582 79840 86298 90566 92878
1996 31245 63741 90775 106439 115054 120210
1997 26312 57779 82451 95506 101664
1998 30470 65482 90973 103562
1999 49756 101587 136854
2000 50420 102735
2001 56762
;
run;
proc transpose data=have out=want (drop=_name_);
copy annee;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jan 2020 14:54:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Transpose-Columns-into-Rows-and-vice-versa-with-an-array/m-p/615362#M179993</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2020-01-06T14:54:48Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose Columns into Rows and vice versa with an array</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Transpose-Columns-into-Rows-and-vice-versa-with-an-array/m-p/615369#M179998</link>
      <description>&lt;P&gt;Hi Karima,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I do not know if you are aware of this, but there is a university version of SAS available for free, that will give you the transpose functionality. Here is the link.&lt;/P&gt;&lt;P&gt;&amp;nbsp;Good Luck&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sas.com/en_us/software/university-edition.html" target="_blank"&gt;https://www.sas.com/en_us/software/university-edition.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jan 2020 15:32:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Transpose-Columns-into-Rows-and-vice-versa-with-an-array/m-p/615369#M179998</guid>
      <dc:creator>jhammouda</dc:creator>
      <dc:date>2020-01-06T15:32:05Z</dc:date>
    </item>
  </channel>
</rss>

