<?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 create a wide dataset? in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-create-a-wide-dataset/m-p/264705#M7290</link>
    <description>&lt;P&gt;Please tell us what you intend to achieve with such a data structure. Give us a chance to propose an alternative that avoids the complications inherent to this route.&lt;/P&gt;</description>
    <pubDate>Tue, 19 Apr 2016 02:54:04 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2016-04-19T02:54:04Z</dc:date>
    <item>
      <title>How to create a wide dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-create-a-wide-dataset/m-p/264701#M7288</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a dataset with many ID's and each id has multiple events(models in the case of the sample data). I want the&amp;nbsp;output data set to have one observation per subject, count the maximum events per id per&amp;nbsp;model and create a flagging variable(a,b, c and so on) for each occurence of the event and the corresponding values of year and state for that event. Any help would be appreciated. Thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Sample data&amp;amp;colon;

data test;
input id $ model $ year state $;
datalines;
A100 XYZ 1999 CA
A100 XYZ 2010 TX
A200 PQR 2013 IL
A200 XYZ 2015 IL
;
RUN

Output needed:

DATA TEST2;
INPUT id $ axyz bxyz xyzayr xyzbyr xyzast $ xyzbst $ apqr pqrayr pqrast $ ;
datalines;
A100 1 1 1999 2010 CA TX . . .
A200 1 . 2015 . IL . 1 2013 IL
;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2016 02:28:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-create-a-wide-dataset/m-p/264701#M7288</guid>
      <dc:creator>sandyrcl</dc:creator>
      <dc:date>2016-04-19T02:28:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a wide dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-create-a-wide-dataset/m-p/264703#M7289</link>
      <description>&lt;P&gt;Thats gonna be hell to work with after.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That being said it looks like two proc transposes that are then merged by ID. You can calculate the 1's afterwards by scanning the values.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2016 02:37:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-create-a-wide-dataset/m-p/264703#M7289</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-04-19T02:37:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a wide dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-create-a-wide-dataset/m-p/264705#M7290</link>
      <description>&lt;P&gt;Please tell us what you intend to achieve with such a data structure. Give us a chance to propose an alternative that avoids the complications inherent to this route.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2016 02:54:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-create-a-wide-dataset/m-p/264705#M7290</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-04-19T02:54:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a wide dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-create-a-wide-dataset/m-p/264777#M7292</link>
      <description>&lt;P&gt;I vociferously support the previous two posters in recommending that you look for an alternative.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are you familiar with the concept of a summary dataset, that would have your summary information at the id level, that you could then join to a lower level dataset using common keys?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2016 13:21:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-create-a-wide-dataset/m-p/264777#M7292</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2016-04-19T13:21:46Z</dc:date>
    </item>
  </channel>
</rss>

