<?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: Sequence in SAS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Sequence-in-SAS/m-p/48799#M10071</link>
    <description>Hi:&lt;BR /&gt;
  For simple queries, monotonic may work. However, I call your attention to this Tech Support note:&lt;BR /&gt;
&lt;A href="http://support.sas.com/kb/15/138.html" target="_blank"&gt;http://support.sas.com/kb/15/138.html&lt;/A&gt;&lt;BR /&gt;
which says that:&lt;B&gt;&lt;BR /&gt;
"The MONOTONIC() function is not supported in PROC SQL.  Using the&lt;BR /&gt;
MONOTONIC() function in PROC SQL can cause missing or non-sequential&lt;BR /&gt;
values to be returned."&lt;/B&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
cynthia</description>
    <pubDate>Tue, 23 Sep 2008 08:44:55 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2008-09-23T08:44:55Z</dc:date>
    <item>
      <title>Sequence in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sequence-in-SAS/m-p/48797#M10069</link>
      <description>Hello SAS Gurus!!!&lt;BR /&gt;
I need your help (once again). This time regarding the sequence in SAS.&lt;BR /&gt;
&lt;BR /&gt;
Could you please let me know if there is any SAS Equivalent to the "Sequence" in Oracle.&lt;BR /&gt;
&lt;BR /&gt;
Actually I need a common sequence number which can be used across the multiple datasets to generate unique sequence number every time. &lt;BR /&gt;
&lt;BR /&gt;
e.g. If for Dataset A, the sequence number reached till say 100, the sequence in dataset B should start from 101 and likewise.&lt;BR /&gt;
&lt;BR /&gt;
In oracle I have used Sequence and Sequence.nextVal to get the auto incremented value. Need to get the similar feature in SAS.&lt;BR /&gt;
&lt;BR /&gt;
Any help regarding this would be highly appreciated.&lt;BR /&gt;
&lt;BR /&gt;
regards&lt;BR /&gt;
Kapil Agrawal</description>
      <pubDate>Mon, 22 Sep 2008 17:02:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sequence-in-SAS/m-p/48797#M10069</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-09-22T17:02:39Z</dc:date>
    </item>
    <item>
      <title>Re: Sequence in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sequence-in-SAS/m-p/48798#M10070</link>
      <description>Kapil,&lt;BR /&gt;
&lt;BR /&gt;
SAS does not have a sequence object like Oracle does. I would think your options are: &lt;BR /&gt;
&lt;BR /&gt;
1) For one table solution you can use function monotonic(). Note that it is experimental in 9.1.3. &lt;BR /&gt;
&lt;BR /&gt;
proc sql;&lt;BR /&gt;
create table test as &lt;BR /&gt;
select  monotonic() as rownum LABEL ='Row Number',&lt;BR /&gt;
	    a.*&lt;BR /&gt;
from test1 as a&lt;BR /&gt;
;&lt;BR /&gt;
quit;&lt;BR /&gt;
&lt;BR /&gt;
2) For multi-table solution you will have to keep track of it yourself. &lt;BR /&gt;
&lt;BR /&gt;
ikp.</description>
      <pubDate>Mon, 22 Sep 2008 17:37:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sequence-in-SAS/m-p/48798#M10070</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-09-22T17:37:07Z</dc:date>
    </item>
    <item>
      <title>Re: Sequence in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sequence-in-SAS/m-p/48799#M10071</link>
      <description>Hi:&lt;BR /&gt;
  For simple queries, monotonic may work. However, I call your attention to this Tech Support note:&lt;BR /&gt;
&lt;A href="http://support.sas.com/kb/15/138.html" target="_blank"&gt;http://support.sas.com/kb/15/138.html&lt;/A&gt;&lt;BR /&gt;
which says that:&lt;B&gt;&lt;BR /&gt;
"The MONOTONIC() function is not supported in PROC SQL.  Using the&lt;BR /&gt;
MONOTONIC() function in PROC SQL can cause missing or non-sequential&lt;BR /&gt;
values to be returned."&lt;/B&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
cynthia</description>
      <pubDate>Tue, 23 Sep 2008 08:44:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sequence-in-SAS/m-p/48799#M10071</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2008-09-23T08:44:55Z</dc:date>
    </item>
    <item>
      <title>Re: Sequence in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sequence-in-SAS/m-p/48800#M10072</link>
      <description>Cynthia,&lt;BR /&gt;
&lt;BR /&gt;
Thanks for pointing it out. &lt;BR /&gt;
&lt;BR /&gt;
ikp</description>
      <pubDate>Tue, 23 Sep 2008 16:17:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sequence-in-SAS/m-p/48800#M10072</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-09-23T16:17:36Z</dc:date>
    </item>
    <item>
      <title>Re: Sequence in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sequence-in-SAS/m-p/48801#M10073</link>
      <description>Dear ikp and Synthia.&lt;BR /&gt;
&lt;BR /&gt;
Thanks for providing the info. that Sequence does not work in SAS the way it does in Oracle.&lt;BR /&gt;
&lt;BR /&gt;
I have found the way to handle it in SAS.&lt;BR /&gt;
&lt;BR /&gt;
But the information provided by you saved a lot of time.&lt;BR /&gt;
&lt;BR /&gt;
Thanks a ton &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
Regards&lt;BR /&gt;
Kapil Agrawal</description>
      <pubDate>Wed, 24 Sep 2008 15:52:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sequence-in-SAS/m-p/48801#M10073</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-09-24T15:52:18Z</dc:date>
    </item>
  </channel>
</rss>

