<?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/864497#M341402</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/188504"&gt;@AmrAd&lt;/a&gt;, on top of &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;'s comments - you have two values for that customer on that date, but your transpose only contains one value (50) for that date.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you consider that a duplicate? If so, I would suggest de-duplicating before running PROC TRANSPOSE.&lt;/P&gt;</description>
    <pubDate>Thu, 16 Mar 2023 12:17:13 GMT</pubDate>
    <dc:creator>maguiremq</dc:creator>
    <dc:date>2023-03-16T12:17:13Z</dc:date>
    <item>
      <title>Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose/m-p/864476#M341396</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I am trying to transpose below table from&amp;nbsp; however i receive this error "ERROR: The ID value "'30NOV2022'n" occurs twice in the same BY group."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any Help !!&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;MISDATE&lt;/TD&gt;&lt;TD&gt;CUSTNO&lt;/TD&gt;&lt;TD&gt;AdvAmt&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;30-Nov-22&lt;/TD&gt;&l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E&gt;</description>
      <pubDate>Thu, 16 Mar 2023 09:27:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose/m-p/864476#M341396</guid>
      <dc:creator>AmrAd</dc:creator>
      <dc:date>2023-03-16T09:27:11Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose/m-p/864481#M341397</link>
      <description>&lt;P&gt;This layout makes the data very difficult to work with. Better to not transpose and work with the data long (most SAS PROCs expect the data in long layout anyway). What will you be doing with this data?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In addition, SAS data set names cannot have dashes in them. Picking the last day of the month is hard to code without making mistakes. These dates will not sort in any reasonable order.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2023 10:13:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose/m-p/864481#M341397</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-03-16T10:13:05Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose/m-p/864497#M341402</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/188504"&gt;@AmrAd&lt;/a&gt;, on top of &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;'s comments - you have two values for that customer on that date, but your transpose only contains one value (50) for that date.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you consider that a duplicate? If so, I would suggest de-duplicating before running PROC TRANSPOSE.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2023 12:17:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose/m-p/864497#M341402</guid>
      <dc:creator>maguiremq</dc:creator>
      <dc:date>2023-03-16T12:17:13Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose/m-p/864600#M341430</link>
      <description>&lt;P&gt;First, make a decision how to deal with duplicates. Do you want the sum, the average, minimum or maximum in such a case?&lt;/P&gt;
&lt;P&gt;Your intended "dataset" looks more like a report for human consumption. For such, you use PROC REPORT, where misdate is used as an ACROSS variable, and where the calculation (see above) can be done right in the procedure.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2023 16:26:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose/m-p/864600#M341430</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-03-16T16:26:52Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose/m-p/864604#M341433</link>
      <description>&lt;P&gt;That looks like a REPORT and not a dataset.&amp;nbsp; You can easily make such a report using PROC REPORT.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  input MISDATE :date. CUSTNO :$10. AdvAmt ;
  format misdate yymmdd10. ;
cards;
30-Nov-22 101000307 7
31-Dec-22 101000307 7
31-Jan-23 101000307 7
28-Feb-23 101000307 7
30-Nov-22 101000520 50
31-Dec-22 101000520 50
31-Jan-23 101000520 50
28-Feb-23 101000520 50
30-Nov-22 101000545 50
31-Dec-22 101000545 50
31-Jan-23 101000545 50
28-Feb-23 101000545 50
30-Nov-22 101000800 7
;

proc report data=have;
 columns custno advamt,misdate;
 define custno/group;
 define misdate / across ' ';
 define advamt / sum ' ' ;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Tom_0-1678984929127.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/81661iB6A906D839647048/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Tom_0-1678984929127.png" alt="Tom_0-1678984929127.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2023 16:42:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose/m-p/864604#M341433</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-03-16T16:42:35Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose/m-p/864606#M341435</link>
      <description>&lt;P&gt;At least show your code, better the entire log with the code and messages.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What do you expect to do with the transformed data? Do you expect to have two columns with the same name when there are duplicate MISDATE (apparently) values for a Custno (guessing)? Since you have duplicates you need to show us what you expect to get with the duplicates, so include some in the have and want.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2023 16:41:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose/m-p/864606#M341435</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-03-16T16:41:50Z</dc:date>
    </item>
  </channel>
</rss>

