<?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: HELP NEEDED: Code to rearrange data in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/HELP-NEEDED-Code-to-rearrange-data/m-p/539649#M74079</link>
    <description>&lt;P&gt;Why do you need the second example?&amp;nbsp; The data as stored in the first example is a better method of storing the data.&lt;/P&gt;
&lt;P&gt;The only time it might be useful is for a report, in which case three proc transposes, then merge back together by group name.&lt;/P&gt;</description>
    <pubDate>Fri, 01 Mar 2019 14:39:17 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2019-03-01T14:39:17Z</dc:date>
    <item>
      <title>HELP NEEDED: Code to rearrange data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/HELP-NEEDED-Code-to-rearrange-data/m-p/539630#M74077</link>
      <description>&lt;P&gt;Hello fellow SAS users,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hoping someone can help me write a code for a relatively simple (but tedious) procedure. My data set includes dates (beginning and ending) during which an error occurred for a given observation. About 41% of Groups have errors in multiple periods. The data looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Group Name&lt;/TD&gt;&lt;TD&gt;Type&lt;/TD&gt;&lt;TD&gt;Error Type&lt;/TD&gt;&lt;TD&gt;Period Beg&lt;/TD&gt;&lt;TD&gt;Period End&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AAABBB&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;F&lt;/TD&gt;&lt;TD&gt;1/1/2003&lt;/TD&gt;&lt;TD&gt;12/31/2003&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AAABBB&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;R&lt;/TD&gt;&lt;TD&gt;4/1/2004&lt;/TD&gt;&lt;TD&gt;6/30/2004&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need each Group to correspond to only a single observation, so that line of data needs to capture all the different error periods. Something like this:&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Group Name&lt;/TD&gt;&lt;TD&gt;Type&lt;/TD&gt;&lt;TD&gt;Error Type&lt;/TD&gt;&lt;TD&gt;Period Beg&lt;/TD&gt;&lt;TD&gt;Period End&lt;/TD&gt;&lt;TD&gt;Error Type2&lt;/TD&gt;&lt;TD&gt;Period Beg2&lt;/TD&gt;&lt;TD&gt;Period End2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AAABBB&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;F&lt;/TD&gt;&lt;TD&gt;1/1/2003&lt;/TD&gt;&lt;TD&gt;12/31/2003&lt;/TD&gt;&lt;TD&gt;R&lt;/TD&gt;&lt;TD&gt;4/1/2004&lt;/TD&gt;&lt;TD&gt;6/30/2004&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Some groups have only a single error period, some have many. I was using a pretty rudimentary program using lags but it was not efficient. Any help would be greatly appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2019 14:21:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/HELP-NEEDED-Code-to-rearrange-data/m-p/539630#M74077</guid>
      <dc:creator>wriccar</dc:creator>
      <dc:date>2019-03-01T14:21:37Z</dc:date>
    </item>
    <item>
      <title>Re: HELP NEEDED: Code to rearrange data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/HELP-NEEDED-Code-to-rearrange-data/m-p/539640#M74078</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/88921"&gt;@wriccar&lt;/a&gt; your sample data should included some samples that your request address.&lt;/P&gt;
&lt;P&gt;When the sample size is to small the results will not always include possible constraints that need to be considered.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2019 14:32:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/HELP-NEEDED-Code-to-rearrange-data/m-p/539640#M74078</guid>
      <dc:creator>VDD</dc:creator>
      <dc:date>2019-03-01T14:32:00Z</dc:date>
    </item>
    <item>
      <title>Re: HELP NEEDED: Code to rearrange data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/HELP-NEEDED-Code-to-rearrange-data/m-p/539649#M74079</link>
      <description>&lt;P&gt;Why do you need the second example?&amp;nbsp; The data as stored in the first example is a better method of storing the data.&lt;/P&gt;
&lt;P&gt;The only time it might be useful is for a report, in which case three proc transposes, then merge back together by group name.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2019 14:39:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/HELP-NEEDED-Code-to-rearrange-data/m-p/539649#M74079</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2019-03-01T14:39:17Z</dc:date>
    </item>
    <item>
      <title>Re: HELP NEEDED: Code to rearrange data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/HELP-NEEDED-Code-to-rearrange-data/m-p/539651#M74080</link>
      <description>&lt;P&gt;The end goal of what I'm asking is because I need to merge with a second dataset, and identify if the period from that dataset corresponds to an error period. If there are multiple observations for the same Group, then the merge does not take in all of those different error periods.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2019 14:41:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/HELP-NEEDED-Code-to-rearrange-data/m-p/539651#M74080</guid>
      <dc:creator>wriccar</dc:creator>
      <dc:date>2019-03-01T14:41:26Z</dc:date>
    </item>
    <item>
      <title>Re: HELP NEEDED: Code to rearrange data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/HELP-NEEDED-Code-to-rearrange-data/m-p/539653#M74081</link>
      <description>&lt;P&gt;Please show concrete examples, presenting test data in the form of a datastep for each input dataset:&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I do not see how merging with one record rather than multiple records would be any different, its exactly the same data, if date fits into one of the time periods then it merges onto that row??&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2019 14:48:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/HELP-NEEDED-Code-to-rearrange-data/m-p/539653#M74081</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2019-03-01T14:48:25Z</dc:date>
    </item>
    <item>
      <title>Re: HELP NEEDED: Code to rearrange data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/HELP-NEEDED-Code-to-rearrange-data/m-p/539678#M74082</link>
      <description>&lt;P&gt;I solved my problem so no need for further replies. Thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2019 16:19:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/HELP-NEEDED-Code-to-rearrange-data/m-p/539678#M74082</guid>
      <dc:creator>wriccar</dc:creator>
      <dc:date>2019-03-01T16:19:49Z</dc:date>
    </item>
    <item>
      <title>Re: HELP NEEDED: Code to rearrange data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/HELP-NEEDED-Code-to-rearrange-data/m-p/539681#M74083</link>
      <description>&lt;P&gt;Please post your solution so the community benefits also.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2019 16:21:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/HELP-NEEDED-Code-to-rearrange-data/m-p/539681#M74083</guid>
      <dc:creator>VDD</dc:creator>
      <dc:date>2019-03-01T16:21:37Z</dc:date>
    </item>
  </channel>
</rss>

