<?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: USING TRANSPOSE in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/USING-TRANSPOSE/m-p/872190#M38665</link>
    <description>&lt;P&gt;This is no task for TRANSPOSE, but rather for PROC REPORT, where you can summarize multiple entries fot the same loan type.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc report data=NAS_QR.SUMBB2;
column member_reference count_f,account_type;
define member_reference / group;
define count_f / "" analysis sum;
define account_type / "" across;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 26 Apr 2023 10:00:25 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2023-04-26T10:00:25Z</dc:date>
    <item>
      <title>USING TRANSPOSE</title>
      <link>https://communities.sas.com/t5/New-SAS-User/USING-TRANSPOSE/m-p/872166#M38650</link>
      <description>&lt;P&gt;I was working on a data as below:&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 457pt;" width="609"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD width="125" height="20" style="width: 94pt; height: 15.0pt;"&gt;MemberReference&lt;/TD&gt;
&lt;TD width="303" style="width: 227pt;"&gt;AccountType&lt;/TD&gt;
&lt;TD width="67" style="width: 50pt;"&gt;COUNT_F&lt;/TD&gt;
&lt;TD width="114" style="width: 86pt;"&gt;TOTAL_AMOUNT&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;21121609&lt;/TD&gt;
&lt;TD&gt;Business Loan - General&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;TD align="right"&gt;256953&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;21122059&lt;/TD&gt;
&lt;TD&gt;Gold Loan&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;TD align="right"&gt;218399&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;21122566&lt;/TD&gt;
&lt;TD&gt;Business Loan - General&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;TD align="right"&gt;289160&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;21122975&lt;/TD&gt;
&lt;TD&gt;Property Loan&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;TD align="right"&gt;819621&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;21123078&lt;/TD&gt;
&lt;TD&gt;Gold Loan&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;TD align="right"&gt;426088&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;21123230&lt;/TD&gt;
&lt;TD&gt;Loan Against Bank Deposits&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;TD align="right"&gt;632405&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;21123300&lt;/TD&gt;
&lt;TD&gt;Business Loan - Priority Sector - Agriculture&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;TD align="right"&gt;466791&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;21123300&lt;/TD&gt;
&lt;TD&gt;Business Loan - Secured&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;TD align="right"&gt;288177&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;21123922&lt;/TD&gt;
&lt;TD&gt;Property Loan&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;TD align="right"&gt;575040&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;21125025&lt;/TD&gt;
&lt;TD&gt;Property Loan&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;TD align="right"&gt;722551&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;21125826&lt;/TD&gt;
&lt;TD&gt;Property Loan&lt;/TD&gt;
&lt;TD align="right"&gt;2&lt;/TD&gt;
&lt;TD align="right"&gt;2242058&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;21126364&lt;/TD&gt;
&lt;TD&gt;Overdraft&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;TD align="right"&gt;1625360&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;21126372&lt;/TD&gt;
&lt;TD&gt;Overdraft&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;TD align="right"&gt;689969&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;21126801&lt;/TD&gt;
&lt;TD&gt;Property Loan&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;TD align="right"&gt;480000&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;21126826&lt;/TD&gt;
&lt;TD&gt;Business Loan - Priority Sector - Agriculture&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;TD align="right"&gt;464286&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;21127646&lt;/TD&gt;
&lt;TD&gt;Property Loan&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;TD align="right"&gt;736105&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;I need the following results as below(Sample Screenshot):&lt;/P&gt;
&lt;TABLE width="1126"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="126"&gt;MemberReference&lt;/TD&gt;
&lt;TD width="156"&gt;Business Loan - General&lt;/TD&gt;
&lt;TD width="68"&gt;Gold Loan&lt;/TD&gt;
&lt;TD width="94"&gt;Property Loan&lt;/TD&gt;
&lt;TD width="179"&gt;Loan Against Bank Deposits&lt;/TD&gt;
&lt;TD width="279"&gt;Business Loan - Priority Sector - Agriculture&lt;/TD&gt;
&lt;TD width="157"&gt;Business Loan - Secured&lt;/TD&gt;
&lt;TD width="67"&gt;Overdraft&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;MemberReference with their respective Count under it.&lt;/P&gt;
&lt;P&gt;So for that I was doing the following SAS code.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary Data = NAS_QR.SUMBB2 NWAY;
class MemberReference AccountType;
VAR COUNT CurrentBalance;
output out = TT1(drop = _TYPE_ _FREQ_)
SUM(COUNT) = COUNT_F SUM(CurrentBalance) = TOTAL_AMOUNT;
run;

proc transpose data = TT1 out= TT2;
by MemberReference;
id AccountType;
var COUNT_F;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But it is showing error as below:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Kirito1_0-1682499742540.png" style="width: 539px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/83256i563EBC32EE687CED/image-dimensions/539x209?v=v2" width="539" height="209" role="button" title="Kirito1_0-1682499742540.png" alt="Kirito1_0-1682499742540.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ERROR: The ID value "'Business Loan - Priority Sector'n" occurs twice in the same BY group.
NOTE: The above message was for the following BY group:
      MemberReference=21168838
ERROR: The ID value "'Business Loan - Priority Sector'n" occurs twice in the same BY group.
NOTE: The above message was for the following BY group:
      MemberReference=21191289
ERROR: The ID value "'Business Loan - Priority Sector'n" occurs twice in the same BY group.
NOTE: The above message was for the following BY group:
      MemberReference=21277591
ERROR: The ID value "'Business Loan - Priority Sector'n" occurs twice in the same BY group.
NOTE: The above message was for the following BY group:
      MemberReference=21428025
ERROR: The ID value "'Business Loan - Priority Sector'n" occurs twice in the same BY group.
NOTE: The above message was for the following BY group:
      MemberReference=21877507
ERROR: The ID value "'Business Loan - Priority Sector'n" occurs twice in the same BY group.
NOTE: The above message was for the following BY group:
      MemberReference=21886501
ERROR: The ID value "'Business Loan - Priority Sector'n" occurs twice in the same BY group.
NOTE: The above message was for the following BY group:
      MemberReference=22118825
ERROR: The ID value "'Business Loan - Priority Sector'n" occurs twice in the same BY group.
NOTE: The above message was for the following BY group:
      MemberReference=22121316
ERROR: The ID value "'Business Loan - Priority Sector'n" occurs twice in the same BY group.
NOTE: The above message was for the following BY group:
      MemberReference=22135069
ERROR: The ID value "'Business Loan - Priority Sector'n" occurs twice in the same BY group.
NOTE: The above message was for the following BY group:
      MemberReference=22150184
ERROR: The ID value "'Business Loan - Priority Sector'n" occurs twice in the same BY group.
ERROR: Too many bad BY groups.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: There were 7004 observations read from the data set WORK.TT1.
WARNING: The data set WORK.TT2 may be incomplete.  When this step was stopped there were 0 observations and 0 variables.
WARNING: Data set WORK.TT2 was not replaced because this step was stopped.
NOTE: PROCEDURE TRANSPOSE used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds
      
81    
82    OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
95    &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;What should I do to achieve the desired output?&lt;/P&gt;
&lt;P&gt;Please, help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2023 09:08:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/USING-TRANSPOSE/m-p/872166#M38650</guid>
      <dc:creator>Kirito1</dc:creator>
      <dc:date>2023-04-26T09:08:54Z</dc:date>
    </item>
    <item>
      <title>Re: USING TRANSPOSE</title>
      <link>https://communities.sas.com/t5/New-SAS-User/USING-TRANSPOSE/m-p/872190#M38665</link>
      <description>&lt;P&gt;This is no task for TRANSPOSE, but rather for PROC REPORT, where you can summarize multiple entries fot the same loan type.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc report data=NAS_QR.SUMBB2;
column member_reference count_f,account_type;
define member_reference / group;
define count_f / "" analysis sum;
define account_type / "" across;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 26 Apr 2023 10:00:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/USING-TRANSPOSE/m-p/872190#M38665</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-04-26T10:00:25Z</dc:date>
    </item>
    <item>
      <title>Re: USING TRANSPOSE</title>
      <link>https://communities.sas.com/t5/New-SAS-User/USING-TRANSPOSE/m-p/872196#M38671</link>
      <description>&lt;P&gt;And by using PROC REPORT, you can wind up with header names that don't require the rather difficult to type&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;"'Business Loan - Priority Sector'n"&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;in fact you don't have to do anything special to get a header name of&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Business Loan - Priority Sector&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;without the quotes and without the N at the end. You could also easily get a header name of &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Business Loan
Priority Sector&lt;/PRE&gt;
&lt;P&gt;on two lines. So don't use PROC TRANSPOSE here, that's not what PROC TRANSPOSE is for.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2023 10:16:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/USING-TRANSPOSE/m-p/872196#M38671</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-04-26T10:16:46Z</dc:date>
    </item>
    <item>
      <title>Re: USING TRANSPOSE</title>
      <link>https://communities.sas.com/t5/New-SAS-User/USING-TRANSPOSE/m-p/872197#M38672</link>
      <description>But what if I want to use the report result as table for further things.</description>
      <pubDate>Wed, 26 Apr 2023 10:18:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/USING-TRANSPOSE/m-p/872197#M38672</guid>
      <dc:creator>Kirito1</dc:creator>
      <dc:date>2023-04-26T10:18:05Z</dc:date>
    </item>
    <item>
      <title>Re: USING TRANSPOSE</title>
      <link>https://communities.sas.com/t5/New-SAS-User/USING-TRANSPOSE/m-p/872206#M38673</link>
      <description>&lt;P&gt;While I was finding out what should I use to do this type of task&amp;nbsp; on listendata.com&amp;nbsp; where it was giving an example of student, marks and subject. So I relate that Example with my task where Student is MemberReference, Marks are COUNT_F and Subject is AccountType.&lt;/P&gt;
&lt;P&gt;Kindly, refer the link This is how I want to approach this problem.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.listendata.com/2015/08/sas-proc-transpose-explained.html" target="_self"&gt;Transpose&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2023 11:15:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/USING-TRANSPOSE/m-p/872206#M38673</guid>
      <dc:creator>Kirito1</dc:creator>
      <dc:date>2023-04-26T11:15:02Z</dc:date>
    </item>
    <item>
      <title>Re: USING TRANSPOSE</title>
      <link>https://communities.sas.com/t5/New-SAS-User/USING-TRANSPOSE/m-p/872208#M38674</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/437885"&gt;@Kirito1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;But what if I want to use the report result as table for further things.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Be specific. What other things would require a TRANSPOSE but not a REPORT? What is the future step and/or analysis which requires the data to be transposed? We would need to know this to give you the best advice.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2023 12:28:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/USING-TRANSPOSE/m-p/872208#M38674</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-04-26T12:28:19Z</dc:date>
    </item>
    <item>
      <title>Re: USING TRANSPOSE</title>
      <link>https://communities.sas.com/t5/New-SAS-User/USING-TRANSPOSE/m-p/872212#M38675</link>
      <description>&lt;P&gt;With rare exceptions (regression), the long layout is better for analysis. A wide layout, combined with non-standard column names, is mostly a PITA.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2023 11:33:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/USING-TRANSPOSE/m-p/872212#M38675</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-04-26T11:33:48Z</dc:date>
    </item>
  </channel>
</rss>

