<?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 SAS/SQL: 3 times, check if there's an interval greater than 2 minutes in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-SQL-3-times-check-if-there-s-an-interval-greater-than-2/m-p/582591#M165720</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, I'm trying to output the data rows where given the same TimePoint, the difference Time1 between from the lowest time and the middle time as well as the middle time and the highest time should be greater than 2 minutes. For every given TimePoint, there will only be 3 Time1s.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sample Input Data:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;╔═════════╦══════════╦════════════╗
║ Subject ║  Time1   ║  TimePoint ║
╠═════════╬══════════╬════════════╣
║       1 ║ 11:13:10 ║  s1        ║
║       1 ║ 11:15:10 ║  s1        ║
║       1 ║ 11:17:30 ║  s1        ║
║       1 ║ 11:45    ║  s2        ║
║       1 ║          ║  s2        ║
║       1 ║ 11:50    ║  s2        ║
╚═════════╩══════════╩════════════╝&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Output Data:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;╔═════════╦══════════╦════════════╗
║ Subject ║  Time1   ║  TimePoint ║
╠═════════╬══════════╬════════════╣
║       1 ║ 11:15:10 ║  s1        ║
║       1 ║ 11:17:30 ║  s1        ║
║       1 ║ 11:45    ║  s2        ║
║       1 ║ 11:50    ║  s2        ║
╚═════════╩══════════╩════════════╝&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Explanation:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;CODE class=" language-sas"&gt;Highest time - Middle time: 11:17:30 - 11:15:10 &amp;gt; 2 (should output)&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class=" language-sas"&gt;Middle time - Lowest time:&amp;nbsp;&lt;/CODE&gt;11:13 - 11:11 &amp;lt;= 2 minutes (should not output)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Highest time - Lowest time: 11:50 - 11:45 &amp;gt; 4min (should output)&lt;/P&gt;&lt;P&gt;^this means that whatever the middle time is, at least one of the interval is &amp;gt; 2min, so should output&lt;/P&gt;&lt;P&gt;---------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I'm open to either proc sql/SAS advices, but I am more experienced in SQL but I can't think of a way for this. This would be a lot easier if it's just two Time1s. I do know of the INTCK function to get the time difference, but I'm stuck on getting it to apply in this manner.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I did a quick google search&amp;nbsp;on this, including&amp;nbsp;search queries like "sas sql get middle time between three 3 times" but nothing really relevant came up.&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;EDIT: Thinking about it now, I think the best way to approach this is to compile all three times onto one single row into their own column, along with the other data (subject and timepoint). Then I can just compare by doing like TimeONE - TimeTwo and so on with the columns.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a better way than this? But now I'm kind of stuck on how to get each Time onto their own column:/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;╔═════════╦══════════╦══════════╦═══════════╦═══════════╗
║ Subject ║ TimeONE  ║ TimeTWO  ║ TimeTHREE ║ TimePoint ║
╠═════════╬══════════╬══════════╬═══════════╬═══════════╣
║       1 ║ 11:13:10 ║ 11:15:10 ║ 11:17:30  ║ s1        ║&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 20 Aug 2019 21:02:36 GMT</pubDate>
    <dc:creator>jerrylshen</dc:creator>
    <dc:date>2019-08-20T21:02:36Z</dc:date>
    <item>
      <title>SAS/SQL: 3 times, check if there's an interval greater than 2 minutes</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-SQL-3-times-check-if-there-s-an-interval-greater-than-2/m-p/582591#M165720</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, I'm trying to output the data rows where given the same TimePoint, the difference Time1 between from the lowest time and the middle time as well as the middle time and the highest time should be greater than 2 minutes. For every given TimePoint, there will only be 3 Time1s.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sample Input Data:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;╔═════════╦══════════╦════════════╗
║ Subject ║  Time1   ║  TimePoint ║
╠═════════╬══════════╬════════════╣
║       1 ║ 11:13:10 ║  s1        ║
║       1 ║ 11:15:10 ║  s1        ║
║       1 ║ 11:17:30 ║  s1        ║
║       1 ║ 11:45    ║  s2        ║
║       1 ║          ║  s2        ║
║       1 ║ 11:50    ║  s2        ║
╚═════════╩══════════╩════════════╝&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Output Data:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;╔═════════╦══════════╦════════════╗
║ Subject ║  Time1   ║  TimePoint ║
╠═════════╬══════════╬════════════╣
║       1 ║ 11:15:10 ║  s1        ║
║       1 ║ 11:17:30 ║  s1        ║
║       1 ║ 11:45    ║  s2        ║
║       1 ║ 11:50    ║  s2        ║
╚═════════╩══════════╩════════════╝&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Explanation:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;CODE class=" language-sas"&gt;Highest time - Middle time: 11:17:30 - 11:15:10 &amp;gt; 2 (should output)&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class=" language-sas"&gt;Middle time - Lowest time:&amp;nbsp;&lt;/CODE&gt;11:13 - 11:11 &amp;lt;= 2 minutes (should not output)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Highest time - Lowest time: 11:50 - 11:45 &amp;gt; 4min (should output)&lt;/P&gt;&lt;P&gt;^this means that whatever the middle time is, at least one of the interval is &amp;gt; 2min, so should output&lt;/P&gt;&lt;P&gt;---------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I'm open to either proc sql/SAS advices, but I am more experienced in SQL but I can't think of a way for this. This would be a lot easier if it's just two Time1s. I do know of the INTCK function to get the time difference, but I'm stuck on getting it to apply in this manner.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I did a quick google search&amp;nbsp;on this, including&amp;nbsp;search queries like "sas sql get middle time between three 3 times" but nothing really relevant came up.&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;EDIT: Thinking about it now, I think the best way to approach this is to compile all three times onto one single row into their own column, along with the other data (subject and timepoint). Then I can just compare by doing like TimeONE - TimeTwo and so on with the columns.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a better way than this? But now I'm kind of stuck on how to get each Time onto their own column:/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;╔═════════╦══════════╦══════════╦═══════════╦═══════════╗
║ Subject ║ TimeONE  ║ TimeTWO  ║ TimeTHREE ║ TimePoint ║
╠═════════╬══════════╬══════════╬═══════════╬═══════════╣
║       1 ║ 11:13:10 ║ 11:15:10 ║ 11:17:30  ║ s1        ║&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2019 21:02:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-SQL-3-times-check-if-there-s-an-interval-greater-than-2/m-p/582591#M165720</guid>
      <dc:creator>jerrylshen</dc:creator>
      <dc:date>2019-08-20T21:02:36Z</dc:date>
    </item>
    <item>
      <title>Re: SAS/SQL: 3 times, check if there's an interval greater than 2 minutes</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-SQL-3-times-check-if-there-s-an-interval-greater-than-2/m-p/582596#M165725</link>
      <description>&lt;P&gt;Use the DIF() operator in conjunction with BY group to reset your counters, but I think you need to expand your sample data. Can you include one where you have times but they would not be included, not just ones that are missing times? And do you have multiple subjects and multiple time points?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Assuming you'll have multiple subject and time points this can get you started. It's untested.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
by subject timepoint time1;

time_dif = dif(time1);

if first.subject or first.timepoint then time_dif = .;

if time_dif &amp;lt; 120 or missing(time1) then delete;

run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/277351"&gt;@jerrylshen&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, I'm trying to output the data rows where given the same TimePoint, the difference Time1 between from the lowest time and the middle time as well as the middle time and the highest time should be greater than 2 minutes. For every given TimePoint, there will only be 3 Time1s.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sample Input Data:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;╔═════════╦══════════╦════════════╗
║ Subject ║  Time1   ║  TimePoint ║
╠═════════╬══════════╬════════════╣
║       1 ║ 11:13:10 ║  s1        ║
║       1 ║ 11:15:10 ║  s1        ║
║       1 ║ 11:17:30 ║  s1        ║
║       1 ║ 11:45    ║  s2        ║
║       1 ║          ║  s2        ║
║       1 ║ 11:50    ║  s2        ║
╚═════════╩══════════╩════════════╝&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Output Data:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;╔═════════╦══════════╦════════════╗
║ Subject ║  Time1   ║  TimePoint ║
╠═════════╬══════════╬════════════╣
║       1 ║ 11:15:10 ║  s1        ║
║       1 ║ 11:17:30 ║  s1        ║
║       1 ║ 11:45    ║  s2        ║
║       1 ║ 11:50    ║  s2        ║
╚═════════╩══════════╩════════════╝&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Explanation:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;Highest time - Middle time: 11:17:30 - 11:15:10 &amp;gt; 2 (should output)&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;Middle time - Lowest time:&amp;nbsp;&lt;/CODE&gt;11:13 - 11:11 &amp;lt;= 2 minutes (should not output)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Highest time - Lowest time: 11:50 - 11:45 &amp;gt; 4min (should output)&lt;/P&gt;
&lt;P&gt;^this means that whatever the middle time is, at least one of the interval is &amp;gt; 2min, so should output&lt;/P&gt;
&lt;P&gt;---------------------------------------------------------------------------------------&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I'm open to either proc sql/SAS advices, but I am more experienced in SQL but I can't think of a way for this. This would be a lot easier if it's just two Time1s. I do know of the INTCK function to get the time difference, but I'm stuck on getting it to apply in this manner.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I did a quick google search&amp;nbsp;on this, including&amp;nbsp;search queries like "sas sql get middle time between three 3 times" but nothing really relevant came up.&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;EDIT: Thinking about it now, I think the best way to approach this is to compile all three times onto one single row into their own column, along with the other data (subject and timepoint). Then I can just compare by doing like TimeONE - TimeTwo and so on with the columns.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a better way than this? But now I'm kind of stuck on how to get each Time onto their own column:/&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;╔═════════╦══════════╦══════════╦═══════════╦═══════════╗
║ Subject ║ TimeONE  ║ TimeTWO  ║ TimeTHREE ║ TimePoint ║
╠═════════╬══════════╬══════════╬═══════════╬═══════════╣
║       1 ║ 11:13:10 ║ 11:15:10 ║ 11:17:30  ║ s1        ║&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2019 21:07:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-SQL-3-times-check-if-there-s-an-interval-greater-than-2/m-p/582596#M165725</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-08-20T21:07:44Z</dc:date>
    </item>
    <item>
      <title>Re: SAS/SQL: 3 times, check if there's an interval greater than 2 minutes</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-SQL-3-times-check-if-there-s-an-interval-greater-than-2/m-p/582598#M165727</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/277351"&gt;@jerrylshen&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The below will get the min,max remerge(automatic) done in each row for a by group id,timepoint. Beyond that, I haven't understand your explanation of the logic i.e which ones to keep /drop. However, you could get your SQL skills to think in terms of CASE WHEN,IFN, or Boolean in a HAVING. If you can elabroate, i can provide that too.&amp;nbsp; Run a look at the output to gauge what i am saying.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data have;
input Subject  Time1 :time10.  TimePoint $;
format time1 time.;
cards;
1  11:13:10 s1   
1 11:15:10   s1
1 11:17:30  s1 
1 11:45  s2   
1  .  s2    
1 11:50   s2  
;
proc sql;
create table want as
select *,min(time1) as min, max(time1) as max
from have
group by subject,timepoint
order by monotonic();
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2019 21:11:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-SQL-3-times-check-if-there-s-an-interval-greater-than-2/m-p/582598#M165727</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-08-20T21:11:38Z</dc:date>
    </item>
    <item>
      <title>Re: SAS/SQL: 3 times, check if there's an interval greater than 2 minutes</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-SQL-3-times-check-if-there-s-an-interval-greater-than-2/m-p/582599#M165728</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi, thanks for a quick reply!&amp;nbsp; &amp;nbsp;I'll check it out, thanks for a starting point!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;There is an instance where all the times aren't blank but they don't shouldn't output - it's TimePoint s1, where the lowest and middle time isn't greater than 2 minutes.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yeah, I would have multiple subjects and timepoints.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2019 21:11:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-SQL-3-times-check-if-there-s-an-interval-greater-than-2/m-p/582599#M165728</guid>
      <dc:creator>jerrylshen</dc:creator>
      <dc:date>2019-08-20T21:11:26Z</dc:date>
    </item>
    <item>
      <title>Re: SAS/SQL: 3 times, check if there's an interval greater than 2 minutes</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-SQL-3-times-check-if-there-s-an-interval-greater-than-2/m-p/582601#M165730</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/277351"&gt;@jerrylshen&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;EDIT: Thinking about it now, I think the best way to approach this is to compile all three times onto one single row into their own column, along with the other data (subject and timepoint). Then I can just compare by doing like TimeONE - TimeTwo and so on with the columns.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a better way than this? But now I'm kind of stuck on how to get each Time onto their own column:/&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;╔═════════╦══════════╦══════════╦═══════════╦═══════════╗
║ Subject ║ TimeONE  ║ TimeTWO  ║ TimeTHREE ║ TimePoint ║
╠═════════╬══════════╬══════════╬═══════════╬═══════════╣
║       1 ║ 11:13:10 ║ 11:15:10 ║ 11:17:30  ║ s1        ║&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Transposing data tutorials:&lt;BR /&gt;Long to Wide:&lt;BR /&gt;&lt;A href="https://stats.idre.ucla.edu/sas/modules/how-to-reshape-data-long-to-wide-using-proc-transpose/" target="_blank"&gt;https://stats.idre.ucla.edu/sas/modules/how-to-reshape-data-long-to-wide-using-proc-transpose/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://stats.idre.ucla.edu/sas/modules/reshaping-data-long-to-wide-using-the-data-step/" target="_blank"&gt;https://stats.idre.ucla.edu/sas/modules/reshaping-data-long-to-wide-using-the-data-step/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Wide to Long:&lt;BR /&gt;&lt;A href="https://stats.idre.ucla.edu/sas/modules/how-to-reshape-data-wide-to-long-using-proc-transpose/" target="_blank"&gt;https://stats.idre.ucla.edu/sas/modules/how-to-reshape-data-wide-to-long-using-proc-transpose/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://stats.idre.ucla.edu/sas/modules/reshaping-data-wide-to-long-using-a-data-step/" target="_blank"&gt;https://stats.idre.ucla.edu/sas/modules/reshaping-data-wide-to-long-using-a-data-step/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;And sometimes a double transpose is needed for extra wide data sets:&lt;BR /&gt;&lt;A href="https://gist.github.com/statgeek/2321b6f62ab78d5bf2b0a5a8626bd7cd" target="_blank"&gt;https://gist.github.com/statgeek/2321b6f62ab78d5bf2b0a5a8626bd7cd&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2019 21:12:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-SQL-3-times-check-if-there-s-an-interval-greater-than-2/m-p/582601#M165730</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-08-20T21:12:33Z</dc:date>
    </item>
  </channel>
</rss>

