<?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: Proc Transpose in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose/m-p/507457#M136224</link>
    <description>&lt;P&gt;This can also happen when the ID variable is also in the BY statement and can be useful if you want to create a diagonal matrix.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc transpose data=sashelp.class out=agematrix;
   by name;
   id name;
   var age;
   run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/24386iC09075D971030F05/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 25 Oct 2018 11:47:35 GMT</pubDate>
    <dc:creator>data_null__</dc:creator>
    <dc:date>2018-10-25T11:47:35Z</dc:date>
    <item>
      <title>Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose/m-p/507389#M136187</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is my Proc Transpose logic however some of the records in my output is showing&amp;nbsp; blank. How can I remove the blank and have the output show on the same row?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;Proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;transpose&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=Acct_Prod&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;out&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=Accts3 ( drop=_NAME_ _LABEL_);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;by&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; accno bsb Branch Openmth L3;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;id&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; month;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;var&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; accbal;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;run&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;Output as per below:&lt;/FONT&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;AccNo&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;bsb&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Branch&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;OpenMth&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;L3&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;June&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;July&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;August&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;123456&lt;/TD&gt;&lt;TD&gt;123&lt;/TD&gt;&lt;TD&gt;DW&lt;/TD&gt;&lt;TD&gt;31-Aug-18&lt;/TD&gt;&lt;TD&gt;S&lt;/TD&gt;&lt;TD&gt;5000.23&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;123456&lt;/TD&gt;&lt;TD&gt;123&lt;/TD&gt;&lt;TD&gt;DW&lt;/TD&gt;&lt;TD&gt;31-Aug-18&lt;/TD&gt;&lt;TD&gt;S&lt;/TD&gt;&lt;TD&gt;.&lt;/TD&gt;&lt;TD&gt;5000.23&lt;/TD&gt;&lt;TD&gt;5000.23&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;Appreciate your help.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Oct 2018 03:10:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose/m-p/507389#M136187</guid>
      <dc:creator>Timbim</dc:creator>
      <dc:date>2018-10-25T03:10:50Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose/m-p/507392#M136190</link>
      <description>&lt;P&gt;have you tried to set prefix=month&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Oct 2018 03:28:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose/m-p/507392#M136190</guid>
      <dc:creator>VDD</dc:creator>
      <dc:date>2018-10-25T03:28:50Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose/m-p/507393#M136191</link>
      <description>&lt;P&gt;Can you illustrate this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;nbsp;"How can I remove the blank and have the output show on the same row?"&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Oct 2018 03:37:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose/m-p/507393#M136191</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-10-25T03:37:49Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose/m-p/507396#M136193</link>
      <description>This actually implies that your BY variables are not exactly the same for some reason. Or at least SAS doesn't think so for some reason. Not sure why, you may need to remove any leading or trailings. And if there's a different in case, ie Dw is not equal to DW then that's one thing that definitely needs to be fixed.</description>
      <pubDate>Thu, 25 Oct 2018 03:50:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose/m-p/507396#M136193</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-10-25T03:50:21Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose/m-p/507399#M136195</link>
      <description>&lt;P&gt;I would want my result to be like the following. That's what I mean by removing the blank.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;AccNo&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;bsb&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Branch&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;OpenMth&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;L3&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;June&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;July&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;August&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;123456&lt;/TD&gt;&lt;TD&gt;123&lt;/TD&gt;&lt;TD&gt;DW&lt;/TD&gt;&lt;TD&gt;31-Aug-18&lt;/TD&gt;&lt;TD&gt;S&lt;/TD&gt;&lt;TD&gt;5000.23&lt;/TD&gt;&lt;TD&gt;5000.23&lt;/TD&gt;&lt;TD&gt;5000.23&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks kindly&lt;/P&gt;</description>
      <pubDate>Thu, 25 Oct 2018 04:33:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose/m-p/507399#M136195</guid>
      <dc:creator>Timbim</dc:creator>
      <dc:date>2018-10-25T04:33:31Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose/m-p/507401#M136197</link>
      <description>&lt;P&gt;Perhaps a data model crux. A temporary solution could be another pass of the transposed dataset and update:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data have;
input (AccNo	bsb	Branch	OpenMth	L3	June	July	August) ($) ;
cards;
123456	123	DW	31-Aug-18	S	5000.23	 	 . .
123456	123	DW	31-Aug-18	S	.	5000.23	5000.23
;

data want;
update have(obs=0) have;
by accno bsb branch ;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 25 Oct 2018 04:43:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose/m-p/507401#M136197</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-10-25T04:43:25Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose/m-p/507402#M136198</link>
      <description>&lt;P&gt;Thanks Reeza,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've test the by variables and one of them was different for some reason.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for that.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Oct 2018 05:17:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose/m-p/507402#M136198</guid>
      <dc:creator>Timbim</dc:creator>
      <dc:date>2018-10-25T05:17:05Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose/m-p/507457#M136224</link>
      <description>&lt;P&gt;This can also happen when the ID variable is also in the BY statement and can be useful if you want to create a diagonal matrix.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc transpose data=sashelp.class out=agematrix;
   by name;
   id name;
   var age;
   run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/24386iC09075D971030F05/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Oct 2018 11:47:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose/m-p/507457#M136224</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2018-10-25T11:47:35Z</dc:date>
    </item>
  </channel>
</rss>

