<?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: Create a computed column within SAS EG that creates a increasing row number per row in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Create-a-computed-column-within-SAS-EG-that-creates-a-increasing/m-p/94029#M257605</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the answers, I have found that MONOTONIC() works well and in fairness gives me exactly the required result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Apr 2012 07:36:25 GMT</pubDate>
    <dc:creator>shudsoo</dc:creator>
    <dc:date>2012-04-25T07:36:25Z</dc:date>
    <item>
      <title>Create a computed column within SAS EG that creates a increasing row number per row</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-computed-column-within-SAS-EG-that-creates-a-increasing/m-p/94026#M257602</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a set of data (approx 88 million rows) and wish to add on a computed column that creates a number that increases with every row - sort of like a row number but contained within its own column. The reason is that I need to perform further analysis using an offset of the row number but need the row number to be visible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any thoughts or ideas - someone has mentioned the use of MONOTONIC() but cannot find much out there on that one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Apr 2012 06:47:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-computed-column-within-SAS-EG-that-creates-a-increasing/m-p/94026#M257602</guid>
      <dc:creator>shudsoo</dc:creator>
      <dc:date>2012-04-25T06:47:02Z</dc:date>
    </item>
    <item>
      <title>Re: Create a computed column within SAS EG that creates a increasing row number per row</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-computed-column-within-SAS-EG-that-creates-a-increasing/m-p/94027#M257603</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about using ODS ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;ods _all_ close;
ods output sql_results=want;
proc sql number;
 select * from sashelp.class;
quit;
ods listing ;


&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Apr 2012 07:22:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-computed-column-within-SAS-EG-that-creates-a-increasing/m-p/94027#M257603</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2012-04-25T07:22:39Z</dc:date>
    </item>
    <item>
      <title>Re: Create a computed column within SAS EG that creates a increasing row number per row</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-computed-column-within-SAS-EG-that-creates-a-increasing/m-p/94028#M257604</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Monotonic() is an unsupported function and as such not documented in official SAS documentation. Non the less it has been presented at forums and you can find whitepapers (and I believe even some SAS Samples) using it (just Google it).&lt;/P&gt;&lt;P&gt;Monotonic() gives you an ascending rowcount - exactly what you're after.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It appears that there are issues with monotonic() under certain circumstances when used in conjunction with databases (I believe I've read that monotonic() in a sub-select together with Oracle returns unexpected results).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wouldn't use an undocumented function for a "serious" implementation - but it seems to be o.k. for what you need it for. And actually: monotonic() is a very useful function and I would love to see it supported.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just define an advanced expression for your computed column with expression &lt;STRONG&gt;monotonic().&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck&lt;/P&gt;&lt;P&gt;Patrick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Apr 2012 07:34:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-computed-column-within-SAS-EG-that-creates-a-increasing/m-p/94028#M257604</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2012-04-25T07:34:29Z</dc:date>
    </item>
    <item>
      <title>Re: Create a computed column within SAS EG that creates a increasing row number per row</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-computed-column-within-SAS-EG-that-creates-a-increasing/m-p/94029#M257605</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the answers, I have found that MONOTONIC() works well and in fairness gives me exactly the required result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Apr 2012 07:36:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-computed-column-within-SAS-EG-that-creates-a-increasing/m-p/94029#M257605</guid>
      <dc:creator>shudsoo</dc:creator>
      <dc:date>2012-04-25T07:36:25Z</dc:date>
    </item>
    <item>
      <title>Re: Create a computed column within SAS EG that creates a increasing row number per row</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-computed-column-within-SAS-EG-that-creates-a-increasing/m-p/94030#M257606</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I doubt that such code can be generated using EG wizards... But nevertheless really cool solution.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Apr 2012 07:38:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-computed-column-within-SAS-EG-that-creates-a-increasing/m-p/94030#M257606</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2012-04-25T07:38:43Z</dc:date>
    </item>
  </channel>
</rss>

