<?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 Help with a certain datastep logic in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Help-with-a-certain-datastep-logic/m-p/193627#M48657</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have this data-set, NAME is the primary key. AccessTime is the order sequence.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REF NO = "#" means customer did not go to the end of a step-by-step webform, instead JAMES clicked saved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REF NO not equal "#" means customer clicked submit at the end of the steps, and system assigned a reference number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then the 4th data row indicates same customer started &lt;STRONG&gt;another&lt;/STRONG&gt; application.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" height="199" style="width: 519px; height: 199px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" width="88"&gt;REFNO&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="106"&gt;ACCESSTIME&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="117"&gt;NAME&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" style="border-top: none;"&gt;#&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;26/11/2014 11:10&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;JAMES WARREN&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" style="border-top: none;"&gt;#&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;26/11/2014 11:11&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;JAMES WARREN&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" style="border-top: none;"&gt;S141126-14&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;26/11/2014 11:12&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;JAMES WARREN&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" style="border-top: none;"&gt;#&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;26/11/2014 11:13&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;JAMES WARREN&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" style="border-top: none;"&gt;#&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;26/11/2014 11:14&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;JAMES WARREN&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" style="border-top: none;"&gt;S141126-15&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;26/11/2014 11:15&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;JAMES WARREN&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" style="border-top: none;"&gt;#&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;26/11/2014 11:16&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;JAMES WARREN&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want the REFNO fields populated with the next REFNO ordered by ACCESSTIME&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like this:&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" height="199" style="width: 516px; height: 202px;" width="514"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" width="88"&gt;REFNO&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="106"&gt;ACCESSTIME&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="117"&gt;NAME&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" style="border-top: none;"&gt;&lt;STRONG&gt;S141126-14&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;26/11/2014 11:10&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;JAMES WARREN&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" style="border-top: none;"&gt;&lt;STRONG&gt;S141126-14&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;26/11/2014 11:11&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;JAMES WARREN&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" style="border-top: none;"&gt;S141126-14&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;26/11/2014 11:12&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;JAMES WARREN&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" style="border-top: none;"&gt;&lt;STRONG&gt;S141126-15&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;26/11/2014 11:13&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;JAMES WARREN&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" style="border-top: none;"&gt;&lt;STRONG&gt;S141126-15&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;26/11/2014 11:14&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;JAMES WARREN&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" style="border-top: none;"&gt;S141126-15&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;26/11/2014 11:15&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;JAMES WARREN&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" style="border-top: none;"&gt;#&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;26/11/2014 11:16&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;JAMES WARREN&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 06 Aug 2015 10:32:17 GMT</pubDate>
    <dc:creator>hellind</dc:creator>
    <dc:date>2015-08-06T10:32:17Z</dc:date>
    <item>
      <title>Help with a certain datastep logic</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Help-with-a-certain-datastep-logic/m-p/193627#M48657</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have this data-set, NAME is the primary key. AccessTime is the order sequence.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REF NO = "#" means customer did not go to the end of a step-by-step webform, instead JAMES clicked saved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REF NO not equal "#" means customer clicked submit at the end of the steps, and system assigned a reference number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then the 4th data row indicates same customer started &lt;STRONG&gt;another&lt;/STRONG&gt; application.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" height="199" style="width: 519px; height: 199px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" width="88"&gt;REFNO&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="106"&gt;ACCESSTIME&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="117"&gt;NAME&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" style="border-top: none;"&gt;#&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;26/11/2014 11:10&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;JAMES WARREN&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" style="border-top: none;"&gt;#&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;26/11/2014 11:11&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;JAMES WARREN&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" style="border-top: none;"&gt;S141126-14&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;26/11/2014 11:12&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;JAMES WARREN&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" style="border-top: none;"&gt;#&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;26/11/2014 11:13&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;JAMES WARREN&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" style="border-top: none;"&gt;#&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;26/11/2014 11:14&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;JAMES WARREN&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" style="border-top: none;"&gt;S141126-15&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;26/11/2014 11:15&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;JAMES WARREN&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" style="border-top: none;"&gt;#&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;26/11/2014 11:16&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;JAMES WARREN&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want the REFNO fields populated with the next REFNO ordered by ACCESSTIME&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like this:&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" height="199" style="width: 516px; height: 202px;" width="514"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" width="88"&gt;REFNO&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="106"&gt;ACCESSTIME&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="117"&gt;NAME&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" style="border-top: none;"&gt;&lt;STRONG&gt;S141126-14&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;26/11/2014 11:10&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;JAMES WARREN&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" style="border-top: none;"&gt;&lt;STRONG&gt;S141126-14&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;26/11/2014 11:11&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;JAMES WARREN&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" style="border-top: none;"&gt;S141126-14&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;26/11/2014 11:12&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;JAMES WARREN&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" style="border-top: none;"&gt;&lt;STRONG&gt;S141126-15&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;26/11/2014 11:13&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;JAMES WARREN&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" style="border-top: none;"&gt;&lt;STRONG&gt;S141126-15&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;26/11/2014 11:14&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;JAMES WARREN&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" style="border-top: none;"&gt;S141126-15&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;26/11/2014 11:15&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;JAMES WARREN&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" style="border-top: none;"&gt;#&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;26/11/2014 11:16&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;JAMES WARREN&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2015 10:32:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Help-with-a-certain-datastep-logic/m-p/193627#M48657</guid>
      <dc:creator>hellind</dc:creator>
      <dc:date>2015-08-06T10:32:17Z</dc:date>
    </item>
    <item>
      <title>Re: Help with a certain datastep logic</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Help-with-a-certain-datastep-logic/m-p/193628#M48658</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hallo Hellind,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are sure that the refno is present every 4th observation you can merge the dataset by itself.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is an example (unfortunately I cannot paste in this box, so I keep it simple):&lt;/P&gt;&lt;P&gt;v stands for value (refno in your situation).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; input id v;&lt;/P&gt;&lt;P&gt;1 .&lt;/P&gt;&lt;P&gt;1 .&lt;/P&gt;&lt;P&gt;1 .&lt;/P&gt;&lt;P&gt;1 4&lt;/P&gt;&lt;P&gt;2 .&lt;/P&gt;&lt;P&gt;2 .&lt;/P&gt;&lt;P&gt;2 .&lt;/P&gt;&lt;P&gt;2 8&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; merge have (drop=v) test (firstobs=4 keep=v rename=(v=_v));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; retain v;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if _v NE . then v = _v;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; drop _v;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;P&gt;Eric&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2015 11:45:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Help-with-a-certain-datastep-logic/m-p/193628#M48658</guid>
      <dc:creator>EricHoogenboom</dc:creator>
      <dc:date>2015-08-06T11:45:34Z</dc:date>
    </item>
    <item>
      <title>Re: Help with a certain datastep logic</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Help-with-a-certain-datastep-logic/m-p/193629#M48659</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sort by name and descending accesstime. Then do&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want (drop=oldrefno);&lt;/P&gt;&lt;P&gt;set have (rename=(refno=oldrefno));&lt;/P&gt;&lt;P&gt;by name;&lt;/P&gt;&lt;P&gt;retain refno;&lt;/P&gt;&lt;P&gt;if first.name or oldrefno ne '#' then refno = oldrefno;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then recreate the original sort order.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2015 11:49:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Help-with-a-certain-datastep-logic/m-p/193629#M48659</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2015-08-06T11:49:12Z</dc:date>
    </item>
    <item>
      <title>Re: Help with a certain datastep logic</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Help-with-a-certain-datastep-logic/m-p/193630#M48660</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&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;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;infile&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;cards&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;expandtabs&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="sep" style="color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt;REFNO&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt;ACCESSTIME&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;NAME&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="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;&amp;amp;&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="format" style="color: #008080;"&gt;$20.&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="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;# 26/11/2014 11:10 JAMES WARREN&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="cards-data" style="color: #bb9905;"&gt;# 26/11/2014 11:11 JAMES WARREN&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="cards-data" style="color: #bb9905;"&gt;S141126-14 26/11/2014 11:12 JAMES WARREN&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="cards-data" style="color: #bb9905;"&gt;# 26/11/2014 11:13 JAMES WARREN&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="cards-data" style="color: #bb9905;"&gt;# 26/11/2014 11:14 JAMES WARREN&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="cards-data" style="color: #bb9905;"&gt;S141126-15 26/11/2014 11:15 JAMES WARREN&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="cards-data" style="color: #bb9905;"&gt;# 26/11/2014 11:16 JAMES WARREN&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;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;want&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;if&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;0&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;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;do&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;until&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt;REFNO&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt;ne&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="string" style="color: #800080;"&gt;'#'&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;or&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;last&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; &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="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;SPAN class="keyword" style="color: #0000ff;"&gt;last&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; &lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt;_REFNO&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt;REFNO&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;do&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;until&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt;REFNO&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt;ne&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="string" style="color: #800080;"&gt;'#'&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;or&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;last&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; &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="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;SPAN class="keyword" style="color: #0000ff;"&gt;last&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;BR /&gt;&lt;SPAN class="text" style="color: black;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;output&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="keyword" style="color: #0000ff;"&gt;drop&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt;REFNO&lt;/SPAN&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;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2015 12:23:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Help-with-a-certain-datastep-logic/m-p/193630#M48660</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-08-06T12:23:47Z</dc:date>
    </item>
    <item>
      <title>Re: Help with a certain datastep logic</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Help-with-a-certain-datastep-logic/m-p/193631#M48661</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's a solution:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; infile cards dsd;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; length refno accesstime name $25.;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; input REFNO$&amp;nbsp;&amp;nbsp;&amp;nbsp; ACCESSTIME$&amp;nbsp;&amp;nbsp;&amp;nbsp; NAME$;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;#,26/11/2014 11:10,JAMES WARREN&lt;/P&gt;&lt;P&gt;#,26/11/2014 11:11,JAMES WARREN&lt;/P&gt;&lt;P&gt;S141126-14,26/11/2014 11:12,JAMES WARREN&lt;/P&gt;&lt;P&gt;#,26/11/2014 11:13,JAMES WARREN&lt;/P&gt;&lt;P&gt;#,26/11/2014 11:14,JAMES WARREN&lt;/P&gt;&lt;P&gt;S141126-15,26/11/2014 11:15,JAMES WARREN&lt;/P&gt;&lt;P&gt;#,26/11/2014 11:16,JAMES WARREN&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sort data=have;by descending accesstime;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;by descending accesstime;&lt;/P&gt;&lt;P&gt;retain _refno;&lt;/P&gt;&lt;P&gt;if refno ne '#' then _refno = refno;&lt;/P&gt;&lt;P&gt;if refno = '#' and not missing(_refno) then refno = _refno;&lt;/P&gt;&lt;P&gt;drop _:;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sort data=want;by accesstime;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2015 12:47:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Help-with-a-certain-datastep-logic/m-p/193631#M48661</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2015-08-06T12:47:31Z</dc:date>
    </item>
    <item>
      <title>Re: Help with a certain datastep logic</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Help-with-a-certain-datastep-logic/m-p/193632#M48662</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, I used your option for my coding.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This data is from web application. There can be many users, and each time a user click SAVE, a record with REFNO="#" is saved. But the moment the user click SUBMIT, the web application interface with the backend system to assign a reference number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am yet to try other suggestions, but thanks everyone.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Aug 2015 04:01:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Help-with-a-certain-datastep-logic/m-p/193632#M48662</guid>
      <dc:creator>hellind</dc:creator>
      <dc:date>2015-08-11T04:01:55Z</dc:date>
    </item>
  </channel>
</rss>

