<?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 particular columns in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Transpose-particular-columns/m-p/880662#M43159</link>
    <description>Hey! Deleting unwanted rows is fine. But how would I transpose keeping the ID same &amp;amp; creating a new column for this transpose? Basically the dataset of Want</description>
    <pubDate>Wed, 14 Jun 2023 13:27:41 GMT</pubDate>
    <dc:creator>shubham_d</dc:creator>
    <dc:date>2023-06-14T13:27:41Z</dc:date>
    <item>
      <title>Transpose particular columns</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Transpose-particular-columns/m-p/880636#M43153</link>
      <description>&lt;P&gt;Have -&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;id&lt;/TD&gt;&lt;TD&gt;num1&lt;/TD&gt;&lt;TD&gt;num2&lt;/TD&gt;&lt;TD&gt;num3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;101&lt;/TD&gt;&lt;TD&gt;102&lt;/TD&gt;&lt;TD&gt;103&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data d1;&lt;/P&gt;&lt;P&gt;input id num1 num2 num3;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;1 101 102 103&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Want -&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;id&lt;/TD&gt;&lt;TD&gt;num_list&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;101&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;102&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;103&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;BR /&gt;Incase either of num1, num2, num3 is null then I don't want their entries in the dataset. For example - If num3 is null then dataset should be -&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;id&lt;/TD&gt;&lt;TD&gt;num_list&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;101&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;102&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;BR /&gt;Thanks in advance &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jun 2023 12:35:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Transpose-particular-columns/m-p/880636#M43153</guid>
      <dc:creator>shubham_d</dc:creator>
      <dc:date>2023-06-14T12:35:31Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose particular columns</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Transpose-particular-columns/m-p/880637#M43154</link>
      <description>&lt;P&gt;Easiest thing to do is simply delete the unwanted rows from the output.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jun 2023 12:32:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Transpose-particular-columns/m-p/880637#M43154</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-06-14T12:32:33Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose particular columns</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Transpose-particular-columns/m-p/880662#M43159</link>
      <description>Hey! Deleting unwanted rows is fine. But how would I transpose keeping the ID same &amp;amp; creating a new column for this transpose? Basically the dataset of Want</description>
      <pubDate>Wed, 14 Jun 2023 13:27:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Transpose-particular-columns/m-p/880662#M43159</guid>
      <dc:creator>shubham_d</dc:creator>
      <dc:date>2023-06-14T13:27:41Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose particular columns</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Transpose-particular-columns/m-p/880669#M43163</link>
      <description>&lt;P&gt;Run PROC TRANSPOSE with the following in the code&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;by id;&lt;/CODE&gt;&lt;/PRE&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;</description>
      <pubDate>Wed, 14 Jun 2023 13:57:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Transpose-particular-columns/m-p/880669#M43163</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-06-14T13:57:20Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose particular columns</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Transpose-particular-columns/m-p/880670#M43164</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/438962"&gt;@shubham_d&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Hey! Deleting unwanted rows is fine. But how would I transpose keeping the ID same &amp;amp; creating a new column for this transpose? Basically the dataset of Want&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You probably need to make more test data that actually demonstrates the issues you are having (or are worried about).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want the re-transposed data to end up in the same variable names then you need to either keep the _NAME_ variable that PROC TRANSPOSE generates (or something that can be used to re-create it) to use in the ID statement of PROC TRANSPOSE.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc transpose data=have out=TALL(where=(not missing(col1)) ;
   by id;
   var var1-var3 ;
run;
proc tranpose data=TALL out=WIDE(drop=_name_);
  by id;
  id _name_;
  var col1;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Jun 2023 14:04:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Transpose-particular-columns/m-p/880670#M43164</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-06-14T14:04:20Z</dc:date>
    </item>
  </channel>
</rss>

