<?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: Transpose in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Transpose/m-p/878407#M347048</link>
    <description>&lt;P&gt;Please explain the logic (Step-by-step, leaving nothing out) behind this re-arranging of the data.&lt;/P&gt;</description>
    <pubDate>Wed, 31 May 2023 13:12:03 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2023-05-31T13:12:03Z</dc:date>
    <item>
      <title>Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Transpose/m-p/878406#M347047</link>
      <description>&lt;P&gt;Hallo to everyone,&lt;/P&gt;
&lt;P&gt;I have this problem to overcome. I have a data set which their information from some columns are repeated. For example like:&lt;BR /&gt;&lt;SPAN&gt;DATA Input; INPUT Col1 $ Col2 $ Col3 $ Col4 $ Col5 $ Col6 $ Col7; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;DATALINES; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;A X X S F 1&amp;nbsp; 10 &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;A X X S F 2 20 &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;A X X S F 3 30 &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;B Y R S Z 1 20 &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;B Y R S Z 2 40 ;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;RUN;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;and i want to hold all the info in one row like&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;DATA Input; INPUT Col1 $ Col2 $ Col3 $ Col4 $ 1 $ 2 $ 3; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;DATALINES; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;A X X S F&amp;nbsp; 10 20 30&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;B Y R S Z&amp;nbsp; 20 30&amp;nbsp; -&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;RUN;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;what should i do?&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 May 2023 13:01:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Transpose/m-p/878406#M347047</guid>
      <dc:creator>Barney1998</dc:creator>
      <dc:date>2023-05-31T13:01:53Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Transpose/m-p/878407#M347048</link>
      <description>&lt;P&gt;Please explain the logic (Step-by-step, leaving nothing out) behind this re-arranging of the data.&lt;/P&gt;</description>
      <pubDate>Wed, 31 May 2023 13:12:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Transpose/m-p/878407#M347048</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-05-31T13:12:03Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Transpose/m-p/878414#M347052</link>
      <description>&lt;P&gt;Hallo&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/425371"&gt;@Barney1998&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input (col1-col5) ($) col6 col7;
datalines;
A X X S F 1 10
A X X S F 2 20
A X X S F 3 30
B Y R S Z 1 20
B Y R S Z 2 40
A B C D E 3 13
A B C D E 2 22
;

proc transpose data=have out=want(drop=_name_) prefix=somename;
by col1 col2 col3 col4 col5 notsorted; /* shorter: col1-col5 */
id col6;
var col7;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If your real HAVE dataset is sorted (rather than only grouped) by COL1-COL5, you can omit the NOTSORTED keyword in the BY statement. COL6 may also be a character variable, but must not contain duplicate values within a BY group.&lt;/P&gt;</description>
      <pubDate>Wed, 31 May 2023 13:35:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Transpose/m-p/878414#M347052</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2023-05-31T13:35:51Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Transpose/m-p/878468#M347073</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/425371"&gt;@Barney1998&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hallo to everyone,&lt;/P&gt;
&lt;P&gt;I have this problem to overcome. I have a data set which their information from some columns are repeated. For example like:&lt;BR /&gt;&lt;SPAN&gt;DATA Input; INPUT Col1 $ Col2 $ Col3 $ Col4 $ Col5 $ Col6 $ Col7; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;DATALINES; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;A X X S F 1&amp;nbsp; 10 &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;A X X S F 2 20 &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;A X X S F 3 30 &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;B Y R S Z 1 20 &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;B Y R S Z 2 40 ;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;RUN;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;and i want to hold all the info in one row like&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;DATA Input; INPUT Col1 $ Col2 $ Col3 $ Col4 $ 1 $ 2 $ 3; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;DATALINES; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;A X X S F&amp;nbsp; 10 20 30&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;B Y R S Z&amp;nbsp; 20 &lt;FONT color="#008000"&gt;&lt;STRONG&gt;30&lt;/STRONG&gt;&lt;/FONT&gt;&amp;nbsp; -&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;RUN;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;what should i do?&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Where does the 30 on the row starting with B in your Want data come from. There isn't any 30 in the starting data.&lt;/P&gt;</description>
      <pubDate>Wed, 31 May 2023 15:23:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Transpose/m-p/878468#M347073</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-05-31T15:23:35Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Transpose/m-p/878638#M347156</link>
      <description>&lt;P&gt;Thank you so much!&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jun 2023 10:45:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Transpose/m-p/878638#M347156</guid>
      <dc:creator>Barney1998</dc:creator>
      <dc:date>2023-06-01T10:45:08Z</dc:date>
    </item>
  </channel>
</rss>

