<?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: The difference between two dates by row and then transpose in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/The-difference-between-two-dates-by-row-and-then-transpose/m-p/214156#M39526</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data set options can be your friend:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc transpose data=have &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; out=want (drop=_name_ purchase_1 rename=(date=First_purchase_date) where=(Purchase_2 ne .)) &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; prefix=Purchase_;&lt;/P&gt;&lt;P&gt;by customer_id;&lt;/P&gt;&lt;P&gt;copy date;&lt;/P&gt;&lt;P&gt;var days_between;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I won't claim efficiency other than code isn't complex&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 25 Jun 2015 18:00:48 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2015-06-25T18:00:48Z</dc:date>
    <item>
      <title>The difference between two dates by row and then transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/The-difference-between-two-dates-by-row-and-then-transpose/m-p/214153#M39523</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Hi, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I’m trying to get the difference between dates by row.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my data set: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; have;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; CUSTOMER_ID date &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: teal; background: white;"&gt;anydtdte23.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;format&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; date &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: teal; background: white;"&gt;date9.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;cards&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;1057086 21AUG2014 &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;1057086 25AUG2014 &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;1057086 17SEP2014 &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;1057086 17SEP2014 &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;1057086 19SEP2014 &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;1057086 26SEP2014 &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;And this is the program I have so far: &lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; want; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; have; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;days_between = intck(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'days'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;,date,lag(date)); &lt;/SPAN&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;My results look like this :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="0" cellspacing="0" jive-data-cell="{&amp;quot;color&amp;quot;:&amp;quot;#575757&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;left&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;NaN&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;transparent&amp;quot;,&amp;quot;fontFamily&amp;quot;:&amp;quot;arial,helvetica,sans-serif&amp;quot;}" jive-data-header="{&amp;quot;color&amp;quot;:&amp;quot;#FFFFFF&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;#6690BC&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;center&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;2&amp;quot;}" style="width: 321px; height: 274px; border: 1px solid #000000;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl65" height="60" style="color: #575757; text-align: left; padding: 0px; font-family: arial, helvetica, sans-serif; background-color: transparent;" width="64"&gt;&lt;STRONG&gt;CUSTOMER_ID&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD class="xl66" style="color: #575757; text-align: left; padding: 0px; font-family: arial, helvetica, sans-serif; background-color: transparent;" width="75"&gt;&lt;STRONG&gt;date&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD class="xl66" style="color: #575757; text-align: left; padding: 0px; font-family: arial, helvetica, sans-serif; background-color: transparent;" width="121"&gt;&lt;STRONG&gt;days_between&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl67" height="20" style="color: #575757; text-align: left; padding: 0px; font-family: arial, helvetica, sans-serif; background-color: transparent;" width="64"&gt;1057086&lt;/TD&gt;&lt;TD class="xl68" style="color: #575757; text-align: left; padding: 0px; font-family: arial, helvetica, sans-serif; background-color: transparent;" width="75"&gt;21-Aug-14&lt;/TD&gt;&lt;TD class="xl69" style="color: #575757; text-align: left; padding: 0px; font-family: arial, helvetica, sans-serif; background-color: transparent;" width="121"&gt;.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl67" height="20" style="color: #575757; text-align: left; padding: 0px; font-family: arial, helvetica, sans-serif; background-color: transparent;" width="64"&gt;1057086&lt;/TD&gt;&lt;TD class="xl68" style="color: #575757; text-align: left; padding: 0px; font-family: arial, helvetica, sans-serif; background-color: transparent;" width="75"&gt;25-Aug-14&lt;/TD&gt;&lt;TD class="xl70" style="color: #575757; text-align: left; padding: 0px; font-family: arial, helvetica, sans-serif; background-color: transparent;"&gt;-4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl67" height="20" style="color: #575757; text-align: left; padding: 0px; font-family: arial, helvetica, sans-serif; background-color: transparent;" width="64"&gt;1057086&lt;/TD&gt;&lt;TD class="xl68" style="color: #575757; text-align: left; padding: 0px; font-family: arial, helvetica, sans-serif; background-color: transparent;" width="75"&gt;17-Sep-14&lt;/TD&gt;&lt;TD class="xl70" style="color: #575757; text-align: left; padding: 0px; font-family: arial, helvetica, sans-serif; background-color: transparent;"&gt;-23&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl67" height="20" style="color: #575757; text-align: left; padding: 0px; font-family: arial, helvetica, sans-serif; background-color: transparent;" width="64"&gt;1057086&lt;/TD&gt;&lt;TD class="xl68" style="color: #575757; text-align: left; padding: 0px; font-family: arial, helvetica, sans-serif; background-color: transparent;" width="75"&gt;19-Sep-14&lt;/TD&gt;&lt;TD class="xl70" style="color: #575757; text-align: left; padding: 0px; font-family: arial, helvetica, sans-serif; background-color: transparent;"&gt;-2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl67" height="20" style="color: #575757; text-align: left; padding: 0px; font-family: arial, helvetica, sans-serif; background-color: transparent;" width="64"&gt;1057086&lt;/TD&gt;&lt;TD class="xl68" style="color: #575757; text-align: left; padding: 0px; font-family: arial, helvetica, sans-serif; background-color: transparent;" width="75"&gt;26-Sep-14&lt;/TD&gt;&lt;TD class="xl70" style="color: #575757; text-align: left; padding: 0px; font-family: arial, helvetica, sans-serif; background-color: transparent;"&gt;-7&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt; What I need is the results to be positive values&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="0" cellspacing="0" jive-data-cell="{&amp;quot;color&amp;quot;:&amp;quot;#575757&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;left&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;NaN&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;transparent&amp;quot;,&amp;quot;fontFamily&amp;quot;:&amp;quot;arial,helvetica,sans-serif&amp;quot;}" jive-data-header="{&amp;quot;color&amp;quot;:&amp;quot;#FFFFFF&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;#6690BC&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;center&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;2&amp;quot;}" style="border-style: solid; border-color: #000000; font-size: 13.3333330154419px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl65" height="60" width="64"&gt;&lt;STRONG&gt;CUSTOMER_ID&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD class="xl66" width="75"&gt;&lt;STRONG&gt;date&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD class="xl66" width="121"&gt;&lt;STRONG&gt;days_between&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl67" height="20" width="64"&gt;1057086&lt;/TD&gt;&lt;TD class="xl68" width="75"&gt;21-Aug-14&lt;/TD&gt;&lt;TD class="xl69" width="121"&gt;.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl67" height="20" width="64"&gt;1057086&lt;/TD&gt;&lt;TD class="xl68" width="75"&gt;25-Aug-14&lt;/TD&gt;&lt;TD class="xl70"&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl67" height="20" width="64"&gt;1057086&lt;/TD&gt;&lt;TD class="xl68" width="75"&gt;17-Sep-14&lt;/TD&gt;&lt;TD class="xl70"&gt;23&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl67" height="20" width="64"&gt;1057086&lt;/TD&gt;&lt;TD class="xl68" width="75"&gt;19-Sep-14&lt;/TD&gt;&lt;TD class="xl70"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl67" height="20" width="64"&gt;1057086&lt;/TD&gt;&lt;TD class="xl68" width="75"&gt;26-Sep-14&lt;/TD&gt;&lt;TD class="xl70"&gt;7&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;And after that I need to transpose the values so they look like this: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="0" cellspacing="0" jive-data-cell="{&amp;quot;color&amp;quot;:&amp;quot;#575757&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;left&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;NaN&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;transparent&amp;quot;,&amp;quot;fontFamily&amp;quot;:&amp;quot;arial,helvetica,sans-serif&amp;quot;}" jive-data-header="{&amp;quot;color&amp;quot;:&amp;quot;#FFFFFF&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;#6690BC&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;center&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;2&amp;quot;}" style="width: 537px; height: 69px; border: 1px solid #000000;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl65" height="40" style="color: #575757; text-align: left; padding: 0px; font-family: arial, helvetica, sans-serif; background-color: transparent;" width="119"&gt;&lt;STRONG&gt;CUSTOMER_ID&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD class="xl66" style="color: #575757; text-align: left; padding: 0px; font-family: arial, helvetica, sans-serif; background-color: transparent;" width="163"&gt;&lt;STRONG&gt;First_Purchase Date&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD class="xl66" style="color: #575757; text-align: left; padding: 0px; font-family: arial, helvetica, sans-serif; background-color: transparent;" width="113"&gt;&lt;STRONG&gt;Purchase_2&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD class="xl66" style="color: #575757; text-align: left; padding: 0px; font-family: arial, helvetica, sans-serif; background-color: transparent;" width="96"&gt;&lt;STRONG&gt;Purchase_3&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD class="xl66" style="color: #575757; text-align: left; padding: 0px; font-family: arial, helvetica, sans-serif; background-color: transparent;" width="90"&gt;&lt;STRONG&gt;Purchase_4&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD class="xl66" style="color: #575757; text-align: left; padding: 0px; font-family: arial, helvetica, sans-serif; background-color: transparent;" width="98"&gt;&lt;STRONG&gt;Purchase_5&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl67" height="20" style="color: #575757; text-align: left; padding: 0px; font-family: arial, helvetica, sans-serif; background-color: transparent;" width="119"&gt;1057086&lt;/TD&gt;&lt;TD class="xl68" style="color: #575757; text-align: left; padding: 0px; font-family: arial, helvetica, sans-serif; background-color: transparent;" width="163"&gt;21-Aug-14&lt;/TD&gt;&lt;TD class="xl69" style="color: #575757; text-align: left; padding: 0px; font-family: arial, helvetica, sans-serif; background-color: transparent;"&gt;4&lt;/TD&gt;&lt;TD class="xl69" style="color: #575757; text-align: left; padding: 0px; font-family: arial, helvetica, sans-serif; background-color: transparent;"&gt;23&lt;/TD&gt;&lt;TD class="xl69" style="color: #575757; text-align: left; padding: 0px; font-family: arial, helvetica, sans-serif; background-color: transparent;"&gt;2&lt;/TD&gt;&lt;TD class="xl69" style="color: #575757; text-align: left; padding: 0px; font-family: arial, helvetica, sans-serif; background-color: transparent;"&gt;7&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Notice I have kept the first purchase date.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Any help will be greatly &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;appreciated. Thanks! &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jun 2015 16:50:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/The-difference-between-two-dates-by-row-and-then-transpose/m-p/214153#M39523</guid>
      <dc:creator>RobertNYC</dc:creator>
      <dc:date>2015-06-25T16:50:02Z</dc:date>
    </item>
    <item>
      <title>Re: The difference between two dates by row and then transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/The-difference-between-two-dates-by-row-and-then-transpose/m-p/214154#M39524</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Change your INTCK argument order for the two dates and the results will go positive.&amp;nbsp; Then have a look at using PROC TRANSPOSE in the SAS PROCEDURES documentation / examples provided.&lt;/P&gt;&lt;P&gt;Scott Barry&lt;/P&gt;&lt;P&gt;SBBWorks, Inc.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jun 2015 16:53:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/The-difference-between-two-dates-by-row-and-then-transpose/m-p/214154#M39524</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2015-06-25T16:53:20Z</dc:date>
    </item>
    <item>
      <title>Re: The difference between two dates by row and then transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/The-difference-between-two-dates-by-row-and-then-transpose/m-p/214155#M39525</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Sbb, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm good with the transposing its just keeping/ not transposing the &lt;STRONG style="font-size: 13px; background-color: #ffffff;"&gt;First_Purchase Date &lt;/STRONG&gt;that I can't figure out. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jun 2015 17:11:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/The-difference-between-two-dates-by-row-and-then-transpose/m-p/214155#M39525</guid>
      <dc:creator>RobertNYC</dc:creator>
      <dc:date>2015-06-25T17:11:39Z</dc:date>
    </item>
    <item>
      <title>Re: The difference between two dates by row and then transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/The-difference-between-two-dates-by-row-and-then-transpose/m-p/214156#M39526</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data set options can be your friend:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc transpose data=have &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; out=want (drop=_name_ purchase_1 rename=(date=First_purchase_date) where=(Purchase_2 ne .)) &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; prefix=Purchase_;&lt;/P&gt;&lt;P&gt;by customer_id;&lt;/P&gt;&lt;P&gt;copy date;&lt;/P&gt;&lt;P&gt;var days_between;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I won't claim efficiency other than code isn't complex&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jun 2015 18:00:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/The-difference-between-two-dates-by-row-and-then-transpose/m-p/214156#M39526</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-06-25T18:00:48Z</dc:date>
    </item>
    <item>
      <title>Re: The difference between two dates by row and then transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/The-difference-between-two-dates-by-row-and-then-transpose/m-p/214157#M39527</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Also, if you intend to have multiple Customer_ID values, the data should be sorted, and you will need BY CUSTOMER_ID;&amp;nbsp;&amp;nbsp; with some additional IF FIRST.CUSTOMER_ID THEN ....;&amp;nbsp;&amp;nbsp; code to conditionally use the LAG(date) variable result/value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, the consideration for having PURCHASE_n variables with/using multiple output formats will need to be addressed with any TRANSPOSE-output file unless you do capture / maintain First_Purchase_Date separately -- possibly it could be that PURCHASE_1 would use DATE9 format and other PURCHASE_n variables having no output FORMAT defined.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Scott Barry&lt;BR /&gt;SBBWorks, Inc.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jun 2015 19:25:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/The-difference-between-two-dates-by-row-and-then-transpose/m-p/214157#M39527</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2015-06-25T19:25:49Z</dc:date>
    </item>
    <item>
      <title>Re: The difference between two dates by row and then transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/The-difference-between-two-dates-by-row-and-then-transpose/m-p/214158#M39528</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want it to be positive just use abs (absolute difference).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jun 2015 08:02:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/The-difference-between-two-dates-by-row-and-then-transpose/m-p/214158#M39528</guid>
      <dc:creator>BartDekeyser</dc:creator>
      <dc:date>2015-06-26T08:02:43Z</dc:date>
    </item>
    <item>
      <title>Re: The difference between two dates by row and then transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/The-difference-between-two-dates-by-row-and-then-transpose/m-p/214159#M39529</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Robert,&lt;/P&gt;&lt;P&gt;I tried to reconstruct your program. See if below will help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input CUSTOMER_ID date anydtdte23.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; format date date9.;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;1057086 21AUG2014&lt;/P&gt;&lt;P&gt;1057086 25AUG2014&lt;/P&gt;&lt;P&gt;1057086 17SEP2014&lt;/P&gt;&lt;P&gt;1057086 17SEP2014&lt;/P&gt;&lt;P&gt;1057086 19SEP2014&lt;/P&gt;&lt;P&gt;1057086 26SEP2014&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;proc sort; by customer_id date; run;&lt;/P&gt;&lt;P&gt;data nhave;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; by customer_id date;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if first.customer_id then output;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data wantz;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if _N_ = 1 then set nhave(rename=(date = date1));&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; days_between = dif(date);&lt;/P&gt;&lt;P&gt;&amp;nbsp; drop date;&lt;/P&gt;&lt;P&gt;&amp;nbsp; rename date1 = date;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc transpose data = wantz out = nwant(drop = _name_ Purchase_1) prefix = Purchase_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; by customer_id date;&lt;/P&gt;&lt;P&gt;&amp;nbsp; var days_between;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Br,Amit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jun 2015 11:46:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/The-difference-between-two-dates-by-row-and-then-transpose/m-p/214159#M39529</guid>
      <dc:creator>AmitRathore</dc:creator>
      <dc:date>2015-06-26T11:46:51Z</dc:date>
    </item>
    <item>
      <title>Re: The difference between two dates by row and then transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/The-difference-between-two-dates-by-row-and-then-transpose/m-p/214160#M39530</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am a little surprise . You didn't use DIF().&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H3 style="color: #353535; font-family: Lato, sans-serif; background-color: #f0f1f2;"&gt;Code: Program&lt;/H3&gt;&lt;PRE class="sce-render" style="font-family: 'Courier New', Menlo, 'Lucida Console'; font-size: 16px;"&gt;
&lt;P&gt;&lt;SPAN class="sec-keyword" style="color: #000080; font-weight: bold;"&gt;data&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt;have&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;input&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt;CUSTOMER_ID&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;date&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="format" style="color: #008080;"&gt;anydtdte23.&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;format&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;date&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="format" style="color: #008080;"&gt;date9.&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;cards&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="cards-data" style="color: #bb9905;"&gt;1057086 21AUG2014&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="cards-data" style="color: #bb9905;"&gt;1057086 25AUG2014&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="cards-data" style="color: #bb9905;"&gt;1057086 17SEP2014&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="cards-data" style="color: #bb9905;"&gt;1057086 17SEP2014&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="cards-data" style="color: #bb9905;"&gt;1057086 19SEP2014&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="cards-data" style="color: #bb9905;"&gt;1057086 26SEP2014&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="sec-keyword" style="color: #000080; font-weight: bold;"&gt;run&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN class="sec-keyword" style="color: #000080; font-weight: bold;"&gt;data&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;temp&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;set&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt;have&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;by&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt;CUSTOMER_ID&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;length&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;v&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;id&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;$&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="numeric" style="color: #008080; font-weight: bold;"&gt;20&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt;days_between&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;dif&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;date&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;if&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt;first.CUSTOMER_ID&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;then&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;do&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="text" style="color: black;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;n&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="numeric" style="color: #008080; font-weight: bold;"&gt;1&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="text" style="color: black;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;call&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;missing&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt;days_between&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="text" style="color: black;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;v&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;put&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;date&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="format" style="color: #008080;"&gt;date11.&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="text" style="color: black;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;id&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string" style="color: #800080;"&gt;'First_Purchase_date'&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;end&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="text" style="color: black;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;else&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;do&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="text" style="color: black;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;n&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;+&lt;/SPAN&gt;&lt;SPAN class="numeric" style="color: #008080; font-weight: bold;"&gt;1&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="text" style="color: black;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;v&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;put&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt;days_between&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="format" style="color: #008080;"&gt;best8.&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="text" style="color: black;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;id&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt;cats&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string" style="color: #800080;"&gt;'Purchase_'&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;n&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="text" style="color: black;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;end&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="sec-keyword" style="color: #000080; font-weight: bold;"&gt;run&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="sec-keyword" style="color: #000080; font-weight: bold;"&gt;proc&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="sec-keyword" style="color: #000080; font-weight: bold;"&gt;transpose&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;data&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;temp&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;out&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt;want&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;drop&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt;_&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;by&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt;CUSTOMER_ID&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;var&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;v&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;id&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;id&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="sec-keyword" style="color: #000080; font-weight: bold;"&gt;run&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="sep" style="color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jun 2015 13:03:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/The-difference-between-two-dates-by-row-and-then-transpose/m-p/214160#M39530</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-06-26T13:03:39Z</dc:date>
    </item>
    <item>
      <title>Re: The difference between two dates by row and then transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/The-difference-between-two-dates-by-row-and-then-transpose/m-p/214161#M39531</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mistake. Updated the correct program. I picked the dataset from work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks, Amit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jun 2015 15:46:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/The-difference-between-two-dates-by-row-and-then-transpose/m-p/214161#M39531</guid>
      <dc:creator>AmitRathore</dc:creator>
      <dc:date>2015-06-26T15:46:20Z</dc:date>
    </item>
  </channel>
</rss>

