<?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: How to write transpose for such data? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-write-transpose-for-such-data/m-p/8712#M421</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you post some actual records and how you want them transposed?&lt;/P&gt;&lt;P&gt;I think it sounds like you have data where one variable has the variable name (Male or Female) and another variable has the value (Count?).&amp;nbsp; This is perfect for PROC TRANSPOSE. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc transpose data=have out=want ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; by grp var ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; var count ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; name zone;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You probably have data for many variables so that you might get a diagonal matrix.&lt;/P&gt;&lt;P&gt;Some thing like.&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GRP&amp;nbsp; Var&amp;nbsp;&amp;nbsp;&amp;nbsp; Male Female Savings&lt;/P&gt;&lt;P&gt; 1&amp;nbsp; Gender&amp;nbsp;&amp;nbsp; 10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 20&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .&lt;/P&gt;&lt;P&gt; 1&amp;nbsp; Savetype&amp;nbsp; .&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .&amp;nbsp;&amp;nbsp;&amp;nbsp; 1002&lt;/P&gt;&lt;P&gt; 2&amp;nbsp; Gender&amp;nbsp;&amp;nbsp; 12&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 18&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .&lt;/P&gt;&lt;P&gt; 2&amp;nbsp; Savetype&amp;nbsp; .&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .&amp;nbsp;&amp;nbsp;&amp;nbsp; 2345&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You should be able to use the fact that the off terms are all missing to use the UPDATE statement to fix that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data fix;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; update want(obs=0) want ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; by grp ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; drop var;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 Feb 2012 04:59:59 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2012-02-21T04:59:59Z</dc:date>
    <item>
      <title>How to write transpose for such data?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-write-transpose-for-such-data/m-p/8709#M418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="464"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl24" height="20" width="72"&gt;ID&lt;/TD&gt;&lt;TD class="xl25" style="border-left: medium none;" width="166"&gt;Name&lt;/TD&gt;&lt;TD class="xl25" style="border-left: medium none;" width="107"&gt;Type&lt;/TD&gt;&lt;TD class="xl26" style="border-left: medium none;" width="119"&gt;Length&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl27" height="19" style="border-top: medium none;"&gt;1&lt;/TD&gt;&lt;TD class="xl28" style="border-top: medium none; border-left: medium none;"&gt;branch_code&lt;/TD&gt;&lt;TD class="xl28" style="border-top: medium none; border-left: medium none;"&gt;Character&lt;/TD&gt;&lt;TD align="right" class="xl29" style="border-top: medium none; border-left: medium none;"&gt;7&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl27" height="19" style="border-top: medium none;"&gt;2&lt;/TD&gt;&lt;TD class="xl28" style="border-top: medium none; border-left: medium none;"&gt;NationCMP&lt;/TD&gt;&lt;TD class="xl28" style="border-top: medium none; border-left: medium none;"&gt;Character&lt;/TD&gt;&lt;TD align="right" class="xl29" style="border-top: medium none; border-left: medium none;"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl27" height="19" style="border-top: medium none;"&gt;3&lt;/TD&gt;&lt;TD class="xl28" style="border-top: medium none; border-left: medium none;"&gt;Version&lt;/TD&gt;&lt;TD class="xl28" style="border-top: medium none; border-left: medium none;"&gt;Character&lt;/TD&gt;&lt;TD align="right" class="xl29" style="border-top: medium none; border-left: medium none;"&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl27" height="19" style="border-top: medium none;"&gt;4&lt;/TD&gt;&lt;TD class="xl28" style="border-top: medium none; border-left: medium none;"&gt;ZoneCMP&lt;/TD&gt;&lt;TD class="xl28" style="border-top: medium none; border-left: medium none;"&gt;Character&lt;/TD&gt;&lt;TD align="right" class="xl29" style="border-top: medium none; border-left: medium none;"&gt;9&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl27" height="19" style="border-top: medium none;"&gt;5&lt;/TD&gt;&lt;TD class="xl28" style="border-top: medium none; border-left: medium none;"&gt;cmp&lt;/TD&gt;&lt;TD class="xl28" style="border-top: medium none; border-left: medium none;"&gt;Character&lt;/TD&gt;&lt;TD align="right" class="xl29" style="border-top: medium none; border-left: medium none;"&gt;31&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl30" height="20" style="border-top: medium none;"&gt;6&lt;/TD&gt;&lt;TD class="xl31" style="border-top: medium none; border-left: medium none;"&gt;NoCount&lt;/TD&gt;&lt;TD class="xl31" style="border-top: medium none; border-left: medium none;"&gt;Numeric&lt;/TD&gt;&lt;TD align="right" class="xl32" style="border-top: medium none; border-left: medium none;"&gt;8&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;which is designed for excel pivot table, for field 1-4 are already-grouped-by field,&lt;/P&gt;&lt;P&gt;field 5 cmp has a lot of values to be distinguished in Pivot table as Row,&lt;/P&gt;&lt;P&gt;for eg. with value 'Male','Female'&amp;nbsp; as Sex classification and 'Commercial','Production' as Occupation classification,&lt;/P&gt;&lt;P&gt;'saving account','Term deposit' as account type.&lt;/P&gt;&lt;P&gt;and field 6 nocount are the count/sum respective to field cmp, say&lt;/P&gt;&lt;P&gt;cmp=male, nocount=9,&lt;/P&gt;&lt;P&gt;cmp=saving account, nocount=15235.76&lt;/P&gt;&lt;P&gt;This format serves my purpose to generate Excel pivot, but it is vertically duplicated.&lt;/P&gt;&lt;P&gt;I want to use transpose to re-write the format as follows, but with half day try failed, please give a hand.&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="766"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl24" height="21" width="72"&gt;branch_code&lt;/TD&gt;&lt;TD class="xl25" style="border-left: medium none;" width="90"&gt;NationCMP&lt;/TD&gt;&lt;TD class="xl25" style="border-left: medium none;" width="107"&gt;Version&lt;/TD&gt;&lt;TD class="xl25" style="border-left: medium none;" width="65"&gt;ZoneCMP&lt;/TD&gt;&lt;TD class="xl25" style="border-left: medium none;" width="72"&gt;Male&lt;/TD&gt;&lt;TD class="xl25" style="border-left: medium none;" width="72"&gt;Female&lt;/TD&gt;&lt;TD class="xl26" style="border-left: medium none;" width="72"&gt;saving account&lt;/TD&gt;&lt;TD class="xl26" style="border-left: medium none;" width="72"&gt;Term deposit&lt;/TD&gt;&lt;TD class="xl26" style="border-left: medium none;" width="72"&gt;Commercial&lt;/TD&gt;&lt;TD class="xl27" style="border-left: medium none;" width="72"&gt;Production&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;for field 1-4 no transpose, to set values for cmp to the field name, to set respective values for nocount as value under the field.&lt;/P&gt;&lt;P&gt;Thus to avoid duplication.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Feb 2012 03:18:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-write-transpose-for-such-data/m-p/8709#M418</guid>
      <dc:creator>bbb_NG</dc:creator>
      <dc:date>2012-02-21T03:18:27Z</dc:date>
    </item>
    <item>
      <title>How to write transpose for such data?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-write-transpose-for-such-data/m-p/8710#M419</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are those six values, in the mixed cases as shown, the only six values in the variable cmp?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Feb 2012 03:41:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-write-transpose-for-such-data/m-p/8710#M419</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-02-21T03:41:52Z</dc:date>
    </item>
    <item>
      <title>How to write transpose for such data?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-write-transpose-for-such-data/m-p/8711#M420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Dear Art,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; In fact I'm shiftless.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I meant that field1-4 are grouped-by fields, infact there are 10 grouped-by fields.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and in cmp there are about 60 values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; the Descartes made the data so big but with duplicated records in&amp;nbsp; 10 grouped-by fields.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I have 4M records in this format,&amp;nbsp; I suppose after transpose it will shrink to 10k-100k records but with more fields but no duplication.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Feb 2012 03:48:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-write-transpose-for-such-data/m-p/8711#M420</guid>
      <dc:creator>bbb_NG</dc:creator>
      <dc:date>2012-02-21T03:48:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to write transpose for such data?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-write-transpose-for-such-data/m-p/8712#M421</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you post some actual records and how you want them transposed?&lt;/P&gt;&lt;P&gt;I think it sounds like you have data where one variable has the variable name (Male or Female) and another variable has the value (Count?).&amp;nbsp; This is perfect for PROC TRANSPOSE. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc transpose data=have out=want ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; by grp var ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; var count ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; name zone;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You probably have data for many variables so that you might get a diagonal matrix.&lt;/P&gt;&lt;P&gt;Some thing like.&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GRP&amp;nbsp; Var&amp;nbsp;&amp;nbsp;&amp;nbsp; Male Female Savings&lt;/P&gt;&lt;P&gt; 1&amp;nbsp; Gender&amp;nbsp;&amp;nbsp; 10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 20&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .&lt;/P&gt;&lt;P&gt; 1&amp;nbsp; Savetype&amp;nbsp; .&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .&amp;nbsp;&amp;nbsp;&amp;nbsp; 1002&lt;/P&gt;&lt;P&gt; 2&amp;nbsp; Gender&amp;nbsp;&amp;nbsp; 12&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 18&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .&lt;/P&gt;&lt;P&gt; 2&amp;nbsp; Savetype&amp;nbsp; .&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .&amp;nbsp;&amp;nbsp;&amp;nbsp; 2345&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You should be able to use the fact that the off terms are all missing to use the UPDATE statement to fix that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data fix;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; update want(obs=0) want ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; by grp ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; drop var;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Feb 2012 04:59:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-write-transpose-for-such-data/m-p/8712#M421</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2012-02-21T04:59:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to write transpose for such data?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-write-transpose-for-such-data/m-p/8713#M422</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Tom，&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;I'm now digesting it.&lt;/P&gt;&lt;P&gt;For your question ,I have data&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="976"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl24" height="20" width="72"&gt;branch_code&lt;/TD&gt;&lt;TD class="xl25" style="border-left: medium none;" width="90"&gt;PFS Cust Segment Code&lt;/TD&gt;&lt;TD class="xl25" style="border-left: medium none;" width="107"&gt;LoanCMP&lt;/TD&gt;&lt;TD class="xl25" style="border-left: medium none;" width="65"&gt;OutstandingCMP&lt;/TD&gt;&lt;TD class="xl25" style="border-left: medium none;" width="72"&gt;NationCMP&lt;/TD&gt;&lt;TD class="xl25" style="border-left: medium none;" width="72"&gt;Version&lt;/TD&gt;&lt;TD class="xl25" style="border-left: medium none;" width="72"&gt;New Cust Ind&lt;/TD&gt;&lt;TD class="xl25" style="border-left: medium none;" width="72"&gt;OccupationCMP&lt;/TD&gt;&lt;TD class="xl25" style="border-left: medium none;" width="72"&gt;TRBLevel&lt;/TD&gt;&lt;TD class="xl25" style="border-left: medium none;" width="72"&gt;ZoneCMP&lt;/TD&gt;&lt;TD class="xl25" style="border-left: medium none;" width="126"&gt;cmp&lt;/TD&gt;&lt;TD class="xl26" style="border-left: medium none;" width="84"&gt;NoCount&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl27" height="19" style="border-top: medium none;"&gt;AFU&lt;/TD&gt;&lt;TD class="xl28" style="border-top: medium none; border-left: medium none;"&gt;NORMAL&lt;/TD&gt;&lt;TD class="xl28" style="border-top: medium none; border-left: medium none;"&gt;N&lt;/TD&gt;&lt;TD class="xl28" style="border-top: medium none; border-left: medium none;"&gt;N&lt;/TD&gt;&lt;TD class="xl28" style="border-top: medium none; border-left: medium none;"&gt;CN&lt;/TD&gt;&lt;TD align="right" class="xl28" style="border-top: medium none; border-left: medium none;"&gt;201201&lt;/TD&gt;&lt;TD class="xl28" style="border-top: medium none; border-left: medium none;"&gt;N&lt;/TD&gt;&lt;TD class="xl28" style="border-top: medium none; border-left: medium none;"&gt;Commercial&lt;/TD&gt;&lt;TD class="xl28" style="border-top: medium none; border-left: medium none;"&gt;TRB1:0_10K&lt;/TD&gt;&lt;TD class="xl28" style="border-top: medium none; border-left: medium none;"&gt;Zone 1&lt;/TD&gt;&lt;TD class="xl28" style="border-top: medium none; border-left: medium none;"&gt;Male&lt;/TD&gt;&lt;TD align="right" class="xl29" style="border-top: medium none; border-left: medium none;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl27" height="19" style="border-top: medium none;"&gt;AFU&lt;/TD&gt;&lt;TD class="xl28" style="border-top: medium none; border-left: medium none;"&gt;NORMAL&lt;/TD&gt;&lt;TD class="xl28" style="border-top: medium none; border-left: medium none;"&gt;N&lt;/TD&gt;&lt;TD class="xl28" style="border-top: medium none; border-left: medium none;"&gt;N&lt;/TD&gt;&lt;TD class="xl28" style="border-top: medium none; border-left: medium none;"&gt;CN&lt;/TD&gt;&lt;TD align="right" class="xl28" style="border-top: medium none; border-left: medium none;"&gt;201201&lt;/TD&gt;&lt;TD class="xl28" style="border-top: medium none; border-left: medium none;"&gt;N&lt;/TD&gt;&lt;TD class="xl28" style="border-top: medium none; border-left: medium none;"&gt;Commercial&lt;/TD&gt;&lt;TD class="xl28" style="border-top: medium none; border-left: medium none;"&gt;TRB1:0_10K&lt;/TD&gt;&lt;TD class="xl28" style="border-top: medium none; border-left: medium none;"&gt;Zone 2&lt;/TD&gt;&lt;TD class="xl28" style="border-top: medium none; border-left: medium none;"&gt;Female&lt;/TD&gt;&lt;TD align="right" class="xl29" style="border-top: medium none; border-left: medium none;"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl27" height="19" style="border-top: medium none;"&gt;AFU&lt;/TD&gt;&lt;TD class="xl28" style="border-top: medium none; border-left: medium none;"&gt;NORMAL&lt;/TD&gt;&lt;TD class="xl28" style="border-top: medium none; border-left: medium none;"&gt;N&lt;/TD&gt;&lt;TD class="xl28" style="border-top: medium none; border-left: medium none;"&gt;N&lt;/TD&gt;&lt;TD class="xl28" style="border-top: medium none; border-left: medium none;"&gt;CN&lt;/TD&gt;&lt;TD align="right" class="xl28" style="border-top: medium none; border-left: medium none;"&gt;201201&lt;/TD&gt;&lt;TD class="xl28" style="border-top: medium none; border-left: medium none;"&gt;N&lt;/TD&gt;&lt;TD class="xl28" style="border-top: medium none; border-left: medium none;"&gt;Commercial&lt;/TD&gt;&lt;TD class="xl28" style="border-top: medium none; border-left: medium none;"&gt;TRB1:0_10K&lt;/TD&gt;&lt;TD class="xl28" style="border-top: medium none; border-left: medium none;"&gt;Zone 1&lt;/TD&gt;&lt;TD class="xl28" style="border-top: medium none; border-left: medium none;"&gt;Commercial&lt;/TD&gt;&lt;TD align="right" class="xl29" style="border-top: medium none; border-left: medium none;"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl27" height="19" style="border-top: medium none;"&gt;AFU&lt;/TD&gt;&lt;TD class="xl28" style="border-top: medium none; border-left: medium none;"&gt;NORMAL&lt;/TD&gt;&lt;TD class="xl28" style="border-top: medium none; border-left: medium none;"&gt;N&lt;/TD&gt;&lt;TD class="xl28" style="border-top: medium none; border-left: medium none;"&gt;N&lt;/TD&gt;&lt;TD class="xl28" style="border-top: medium none; border-left: medium none;"&gt;CN&lt;/TD&gt;&lt;TD align="right" class="xl28" style="border-top: medium none; border-left: medium none;"&gt;201201&lt;/TD&gt;&lt;TD class="xl28" style="border-top: medium none; border-left: medium none;"&gt;N&lt;/TD&gt;&lt;TD class="xl28" style="border-top: medium none; border-left: medium none;"&gt;Commercial&lt;/TD&gt;&lt;TD class="xl28" style="border-top: medium none; border-left: medium none;"&gt;TRB1:0_10K&lt;/TD&gt;&lt;TD class="xl28" style="border-top: medium none; border-left: medium none;"&gt;Zone 1&lt;/TD&gt;&lt;TD class="xl28" style="border-top: medium none; border-left: medium none;"&gt;Production&lt;/TD&gt;&lt;TD align="right" class="xl29" style="border-top: medium none; border-left: medium none;"&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl30" height="20" style="border-top: medium none;"&gt;AFU&lt;/TD&gt;&lt;TD class="xl31" style="border-top: medium none; border-left: medium none;"&gt;NORMAL&lt;/TD&gt;&lt;TD class="xl31" style="border-top: medium none; border-left: medium none;"&gt;N&lt;/TD&gt;&lt;TD class="xl31" style="border-top: medium none; border-left: medium none;"&gt;N&lt;/TD&gt;&lt;TD class="xl31" style="border-top: medium none; border-left: medium none;"&gt;CN&lt;/TD&gt;&lt;TD align="right" class="xl31" style="border-top: medium none; border-left: medium none;"&gt;201201&lt;/TD&gt;&lt;TD class="xl31" style="border-top: medium none; border-left: medium none;"&gt;N&lt;/TD&gt;&lt;TD class="xl31" style="border-top: medium none; border-left: medium none;"&gt;Commercial&lt;/TD&gt;&lt;TD class="xl31" style="border-top: medium none; border-left: medium none;"&gt;TRB1:0_10K&lt;/TD&gt;&lt;TD class="xl31" style="border-top: medium none; border-left: medium none;"&gt;Zone 1&lt;/TD&gt;&lt;TD class="xl31" style="border-top: medium none; border-left: medium none;"&gt;Saving Account Balance&lt;/TD&gt;&lt;TD align="right" class="xl32" style="border-top: medium none; border-left: medium none;"&gt;15,763.67&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;BR /&gt;field branch_code&amp;nbsp; to ZoneCmp are all grouped already.&lt;/P&gt;&lt;P&gt;and I want the output &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="1150"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl24" height="20" width="72"&gt;branch_code&lt;/TD&gt;&lt;TD class="xl25" style="border-left: medium none;" width="90"&gt;PFS Cust Segment Code&lt;/TD&gt;&lt;TD class="xl25" style="border-left: medium none;" width="107"&gt;LoanCMP&lt;/TD&gt;&lt;TD class="xl25" style="border-left: medium none;" width="65"&gt;OutstandingCMP&lt;/TD&gt;&lt;TD class="xl25" style="border-left: medium none;" width="72"&gt;NationCMP&lt;/TD&gt;&lt;TD class="xl25" style="border-left: medium none;" width="72"&gt;Version&lt;/TD&gt;&lt;TD class="xl25" style="border-left: medium none;" width="72"&gt;New Cust Ind&lt;/TD&gt;&lt;TD class="xl25" style="border-left: medium none;" width="72"&gt;OccupationCMP&lt;/TD&gt;&lt;TD class="xl25" style="border-left: medium none;" width="72"&gt;TRBLevel&lt;/TD&gt;&lt;TD class="xl25" style="border-left: medium none;" width="72"&gt;ZoneCMP&lt;/TD&gt;&lt;TD class="xl25" style="border-left: medium none;" width="68"&gt;Male&lt;/TD&gt;&lt;TD class="xl25" style="border-left: medium none;" width="84"&gt;Female&lt;/TD&gt;&lt;TD class="xl25" style="border-left: medium none;" width="72"&gt;Commercial&lt;/TD&gt;&lt;TD class="xl25" style="border-left: medium none;" width="72"&gt;Production&lt;/TD&gt;&lt;TD class="xl26" style="border-left: medium none;" width="88"&gt;Saving Account Balance&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl27" height="20" style="border-top: medium none;"&gt;AFU&lt;/TD&gt;&lt;TD class="xl28" style="border-top: medium none; border-left: medium none;"&gt;NORMAL&lt;/TD&gt;&lt;TD class="xl28" style="border-top: medium none; border-left: medium none;"&gt;N&lt;/TD&gt;&lt;TD class="xl28" style="border-top: medium none; border-left: medium none;"&gt;N&lt;/TD&gt;&lt;TD class="xl28" style="border-top: medium none; border-left: medium none;"&gt;CN&lt;/TD&gt;&lt;TD align="right" class="xl28" style="border-top: medium none; border-left: medium none;"&gt;201201&lt;/TD&gt;&lt;TD class="xl28" style="border-top: medium none; border-left: medium none;"&gt;N&lt;/TD&gt;&lt;TD class="xl28" style="border-top: medium none; border-left: medium none;"&gt;Commercial&lt;/TD&gt;&lt;TD class="xl28" style="border-top: medium none; border-left: medium none;"&gt;TRB1:0_10K&lt;/TD&gt;&lt;TD class="xl28" style="border-top: medium none; border-left: medium none;"&gt;Zone 1&lt;/TD&gt;&lt;TD align="right" class="xl28" style="border-top: medium none; border-left: medium none;"&gt;1&lt;/TD&gt;&lt;TD align="right" class="xl28" style="border-top: medium none; border-left: medium none;"&gt;2&lt;/TD&gt;&lt;TD align="right" class="xl28" style="border-top: medium none; border-left: medium none;"&gt;3&lt;/TD&gt;&lt;TD align="right" class="xl28" style="border-top: medium none; border-left: medium none;"&gt;4&lt;/TD&gt;&lt;TD align="right" class="xl29" style="border-top: medium none; border-left: medium none;"&gt;15,763.67&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;BR /&gt;It's the real data.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Feb 2012 06:22:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-write-transpose-for-such-data/m-p/8713#M422</guid>
      <dc:creator>bbb_NG</dc:creator>
      <dc:date>2012-02-21T06:22:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to write transpose for such data?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-write-transpose-for-such-data/m-p/8714#M423</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think that the following does what you want:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc summary data=have nway;&lt;/P&gt;&lt;P&gt;&amp;nbsp; class branch_code nationcmp&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*and any other grouping fields*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cmp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; var NoCount;&lt;/P&gt;&lt;P&gt;&amp;nbsp; output out=temp (drop=_:) sum=;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc transpose data=temp &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; out=want (drop=_:);&lt;/P&gt;&lt;P&gt;&amp;nbsp; by branch_code nationcmp&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*and any other grouping fields*/;&lt;/P&gt;&lt;P&gt;&amp;nbsp; id cmp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; var NoCount;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Feb 2012 06:40:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-write-transpose-for-such-data/m-p/8714#M423</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-02-21T06:40:01Z</dc:date>
    </item>
    <item>
      <title>How to write transpose for such data?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-write-transpose-for-such-data/m-p/8715#M424</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this what your are expecting,&lt;/P&gt;&lt;P&gt;data a;&lt;/P&gt;&lt;P&gt;input branch_code $&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;PFSCustSegmentCode $ LoanCMP $ OutstandingCMP $&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;NationCMP $&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Version $ NewCustInd $&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;OccupationCMP $ 13.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;TRBLevel $ 13.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ZoneCMP $ 7.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;cmp $ 22.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;NoCount;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;AFU&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;NORMAL&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;N&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;N&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CN&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;201201&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;N&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Commercial&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;TRB1:0_10K&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Zone 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Male&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;AFU&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;NORMAL&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;N&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;N&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CN&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;201201&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;N&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Commercial&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;TRB1:0_10K&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Zone 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Female&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&lt;/P&gt;&lt;P&gt;AFU&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;NORMAL&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;N&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;N&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CN&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;201201&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;N&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Commercial&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;TRB1:0_10K&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Zone 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Commercial&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&lt;/P&gt;&lt;P&gt;AFU&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;NORMAL&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;N&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;N&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CN&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;201201&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;N&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Commercial&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;TRB1:0_10K&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Zone 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Production&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4&lt;/P&gt;&lt;P&gt;AFU&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;NORMAL&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;N&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;N&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CN&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;201201&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;N&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Commercial&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;TRB1:0_10K&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Zone 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SavingAccountBalance&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;15763.67&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sort data=a out=b;by branch_code PFSCustSegmentCode LoanCMP OutstandingCMP NationCMP Version NewCustInd OccupationCMP TRBLevel ZoneCMP;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc transpose data=b out=c ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; by branch_code PFSCustSegmentCode LoanCMP OutstandingCMP NationCMP Version NewCustInd OccupationCMP TRBLevel ZoneCMP;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; id cmp ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; var&amp;nbsp; NoCount;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Feb 2012 06:49:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-write-transpose-for-such-data/m-p/8715#M424</guid>
      <dc:creator>shivas</dc:creator>
      <dc:date>2012-02-21T06:49:39Z</dc:date>
    </item>
    <item>
      <title>How to write transpose for such data?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-write-transpose-for-such-data/m-p/8716#M425</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Dear All,&lt;/P&gt;&lt;P&gt;Thank you all for spending time looking at my question and giving an answer.&lt;/P&gt;&lt;P&gt;Very thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Feb 2012 06:52:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-write-transpose-for-such-data/m-p/8716#M425</guid>
      <dc:creator>bbb_NG</dc:creator>
      <dc:date>2012-02-21T06:52:59Z</dc:date>
    </item>
    <item>
      <title>How to write transpose for such data?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-write-transpose-for-such-data/m-p/8717#M426</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I've write the code as you mentioned above,&lt;/P&gt;&lt;P&gt;first sort, then transpose.&lt;/P&gt;&lt;P&gt;but error occurs&lt;/P&gt;&lt;P&gt;ERROR: ID value“'TRB9_4:300k_1M'n” appears twice in the same By group.&lt;/P&gt;&lt;P&gt;Note, that point to the following by group;&lt;/P&gt;&lt;P&gt;BRANCH CODE=AFU 'PFS Cust Segment Code'n=PSE LoanCMP=N OutstandingCMP=N NationCMP=CN Version=201201 New Cust Ind=N.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I tried debug, using filters as "BRANCH CODE=AFU 'PFS Cust Segment Code'n=PSE LoanCMP=N OutstandingCMP=N NationCMP=CN Version=201201 New Cust Ind=N", and only to find that there's no records for CMP=''TRB9_4:300k_1M'n', which means that the error might attributed to that&lt;/P&gt;&lt;P&gt;I've listed values for cmp ,which accounts for 135 items.&lt;/P&gt;&lt;P&gt;and for the already-grouped records, may only have 100 or even less of the item in vertical duplicate format.&lt;/P&gt;&lt;P&gt;Is the missing values caused the faliure of this transpose function?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Feb 2012 09:31:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-write-transpose-for-such-data/m-p/8717#M426</guid>
      <dc:creator>bbb_NG</dc:creator>
      <dc:date>2012-02-21T09:31:29Z</dc:date>
    </item>
    <item>
      <title>How to write transpose for such data?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-write-transpose-for-such-data/m-p/8718#M427</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;By the way,anyone knows how to let the log using english only, my SAS EG 4.2 is with english panel, but the log is combined with english and chinese, thus I have to translate the error, not the original ones. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Feb 2012 09:37:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-write-transpose-for-such-data/m-p/8718#M427</guid>
      <dc:creator>bbb_NG</dc:creator>
      <dc:date>2012-02-21T09:37:17Z</dc:date>
    </item>
    <item>
      <title>How to write transpose for such data?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-write-transpose-for-such-data/m-p/8719#M428</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use LET option in transpose..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;eg &lt;/P&gt;&lt;P style="background-color: #ffffff;"&gt;proc transpose data=b out=c let;&lt;/P&gt;&lt;P style="background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; by branch_code PFSCustSegmentCode LoanCMP OutstandingCMP NationCMP Version NewCustInd OccupationCMP TRBLevel ZoneCMP;&lt;/P&gt;&lt;P style="background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; id cmp ;&lt;/P&gt;&lt;P style="background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; var&amp;nbsp; NoCount;&lt;/P&gt;&lt;P style="background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Feb 2012 09:47:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-write-transpose-for-such-data/m-p/8719#M428</guid>
      <dc:creator>shivas</dc:creator>
      <dc:date>2012-02-21T09:47:13Z</dc:date>
    </item>
    <item>
      <title>How to write transpose for such data?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-write-transpose-for-such-data/m-p/8720#M429</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unless you have mistyped the value in the second row you should not include the variable ZONECMP in the proc transpose call.&amp;nbsp;&amp;nbsp; Your example input has two values for this variable and your desired output only has one row.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Based on your example rows there should not be rows of data where CMP is like TRB.....&amp;nbsp; Those values look like the values that are in the variable TRBLevel.&amp;nbsp;&amp;nbsp; Check and make sure that you are really dealing with a single range of values in your source data.&amp;nbsp; One of the problems when trying to deal with Excel files is that it is totally free form and so the values in the sheets might not form nice rectangular tables that SAS or a database system can handle.&amp;nbsp; You might need to treat the sheet as being composed of more than one block of data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The other issue about why you might not be able to find a match for the string that you see in the error message is that SAS might remove leading spaces before the value.&amp;nbsp; You might try searching for just pieces of the values listed in the log. For example:&amp;nbsp; where index(cmp,'TRB') and index(cmp,'4:300').&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Feb 2012 13:55:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-write-transpose-for-such-data/m-p/8720#M429</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2012-02-21T13:55:43Z</dc:date>
    </item>
    <item>
      <title>How to write transpose for such data?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-write-transpose-for-such-data/m-p/8721#M430</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The reason I suggested doing a proc summary before you used proc transpose was, from your original description, I understood that you expected to have multiple records for each of your class variables.&amp;nbsp; The purpose of using proc summary was to combine those records, by summing the values, prior to transposing the file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Feb 2012 14:15:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-write-transpose-for-such-data/m-p/8721#M430</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-02-21T14:15:30Z</dc:date>
    </item>
    <item>
      <title>How to write transpose for such data?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-write-transpose-for-such-data/m-p/8722#M431</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Art,&lt;/P&gt;&lt;P&gt;Thank your for your remind. &lt;/P&gt;&lt;P&gt;I have suffered the following phases.&lt;/P&gt;&lt;P&gt;1.Broken data in several data-views in the database.&lt;/P&gt;&lt;P&gt;2.Consolidated records (with PK) merged with information needed say, adding Gender/Profit,etc.&lt;/P&gt;&lt;P&gt;3.Using Proc SQL for generating data set by grouping classes + CMP+ Value for CMP&lt;/P&gt;&lt;P&gt;4.Union all those from phase 3, generating a vertical duplicated data.&lt;/P&gt;&lt;P&gt;5.Exporting to txt file.&lt;/P&gt;&lt;P&gt;6.Using Excel Pivot table wizard, all grouped fields in Page level, 'CMP' in Row level, Value for cmp in Data using sum function.&lt;/P&gt;&lt;P&gt; from step 1-6, I achieved my purpose as supporting role.&lt;/P&gt;&lt;P&gt;and after setp 4, the records number reaches 4M. and I want to do some enhancement for efficiency sake.&lt;/P&gt;&lt;P&gt;and I don't want to start from setp 1 again to generate a data with grouped value but not vertical showing ,but with horizatal showing, which means a lot of coding again.&lt;/P&gt;&lt;P&gt;thus I tried to just begin after step 4 to use transpose to get my desired format.&lt;/P&gt;&lt;P&gt;as to how to treat them to be readable in Excel pivot , I 'm not having a whole solution.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Feb 2012 02:08:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-write-transpose-for-such-data/m-p/8722#M431</guid>
      <dc:creator>bbb_NG</dc:creator>
      <dc:date>2012-02-22T02:08:23Z</dc:date>
    </item>
    <item>
      <title>How to write transpose for such data?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-write-transpose-for-such-data/m-p/8723#M432</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Shivas,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thanks a lot.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; After using Let, the error appears no more.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I'm not working on the checking procedure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If nothing wrong, I will mark it as correct.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Very thanks. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Feb 2012 02:10:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-write-transpose-for-such-data/m-p/8723#M432</guid>
      <dc:creator>bbb_NG</dc:creator>
      <dc:date>2012-02-22T02:10:46Z</dc:date>
    </item>
    <item>
      <title>How to write transpose for such data?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-write-transpose-for-such-data/m-p/8724#M433</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tom,&lt;/P&gt;&lt;P&gt;Thanks for your high level instruction. I 'm checking my mistakes under your&amp;nbsp; instruction.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Feb 2012 02:12:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-write-transpose-for-such-data/m-p/8724#M433</guid>
      <dc:creator>bbb_NG</dc:creator>
      <dc:date>2012-02-22T02:12:15Z</dc:date>
    </item>
    <item>
      <title>How to write transpose for such data?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-write-transpose-for-such-data/m-p/8725#M434</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My opinion?&amp;nbsp; Too many seemingly disjointed steps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would much rather have one stream of code that can be verified.&amp;nbsp; Sometimes, starting over is the best way to solve a problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Feb 2012 02:43:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-write-transpose-for-such-data/m-p/8725#M434</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-02-22T02:43:13Z</dc:date>
    </item>
    <item>
      <title>How to write transpose for such data?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-write-transpose-for-such-data/m-p/8726#M435</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Art,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thanks for your opinion.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; To have a good start and a good construction of the whole project is very important, which i can not agree more.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I was graduated from computer science.I was training to group code for differenct purpose into moudles.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The advantange is obvious,&amp;nbsp; if I can not write code without error, this method will be easy when conduct debug.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; And from you I learned to conduct a good framework before starting is important.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thanks for sharing your thoughts.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Feb 2012 02:57:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-write-transpose-for-such-data/m-p/8726#M435</guid>
      <dc:creator>bbb_NG</dc:creator>
      <dc:date>2012-02-22T02:57:31Z</dc:date>
    </item>
    <item>
      <title>How to write transpose for such data?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-write-transpose-for-such-data/m-p/8727#M436</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Shivas,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a little "Let" can do a so great work.&lt;/P&gt;&lt;P&gt;thanks. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Feb 2012 03:05:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-write-transpose-for-such-data/m-p/8727#M436</guid>
      <dc:creator>bbb_NG</dc:creator>
      <dc:date>2012-02-22T03:05:02Z</dc:date>
    </item>
  </channel>
</rss>

