<?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 Transposing with Multiple Years in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Transposing-with-Multiple-Years/m-p/345645#M63522</link>
    <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I ran a SQL query to return how many times a specific event occurred. Here's a snippet of what that table looks like:&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/8035i39B5661E77FBE3FB/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="sample transpose.JPG" title="sample transpose.JPG" width="466" height="521" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd like to merge this table with another table, but this one needs transposed first.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd like to keep the year_id and bat_id as they are, but have the year_id's collapsed into one year. So combine the multiple 1999's in to one single row for 1999, for that batter. Then have the event_cd's be the new column headers and the counts fill each row, if that makes sense. The words columns are just labels for the event_cd's; it'd be nice to have those as column headings, but not neccessary.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So here's what the final table structure would look like, if possible.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/8036i980C04F4B789A70D/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="desired transpose.JPG" title="desired transpose.JPG" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I really appreciate the help,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Justin&lt;/P&gt;</description>
    <pubDate>Thu, 30 Mar 2017 04:08:19 GMT</pubDate>
    <dc:creator>jl1005</dc:creator>
    <dc:date>2017-03-30T04:08:19Z</dc:date>
    <item>
      <title>Transposing with Multiple Years</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Transposing-with-Multiple-Years/m-p/345645#M63522</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I ran a SQL query to return how many times a specific event occurred. Here's a snippet of what that table looks like:&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/8035i39B5661E77FBE3FB/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="sample transpose.JPG" title="sample transpose.JPG" width="466" height="521" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd like to merge this table with another table, but this one needs transposed first.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd like to keep the year_id and bat_id as they are, but have the year_id's collapsed into one year. So combine the multiple 1999's in to one single row for 1999, for that batter. Then have the event_cd's be the new column headers and the counts fill each row, if that makes sense. The words columns are just labels for the event_cd's; it'd be nice to have those as column headings, but not neccessary.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So here's what the final table structure would look like, if possible.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/8036i980C04F4B789A70D/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="desired transpose.JPG" title="desired transpose.JPG" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I really appreciate the help,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Justin&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2017 04:08:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Transposing-with-Multiple-Years/m-p/345645#M63522</guid>
      <dc:creator>jl1005</dc:creator>
      <dc:date>2017-03-30T04:08:19Z</dc:date>
    </item>
    <item>
      <title>Re: Transposing with Multiple Years</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Transposing-with-Multiple-Years/m-p/345646#M63523</link>
      <description>&lt;P&gt;The data in your two photographs don't seem to agree with each other.&lt;/P&gt;
&lt;P&gt;You should be able to use the ID statement in PROC TRANSPOSE.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc transpose data=have out=want prefix=event_ ;
  by year_id bat_id ;
  id event_cd ;
  var count;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 30 Mar 2017 04:14:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Transposing-with-Multiple-Years/m-p/345646#M63523</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-03-30T04:14:54Z</dc:date>
    </item>
  </channel>
</rss>

