<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: SAS Monotonic (would you like Gin and a slice of Lemon with that)</title>
	<link>http://blog.sasinct.com/2008/04/05/sas-monotonic-would-you-like-gin-and-a-slice-of-lemon-with-that/</link>
	<description>Sharing with the world everything we know about SAS.</description>
	<pubDate>Tue,  6 Jan 2009 12:21:22 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.2</generator>
		<item>
		<title>By: Laurie Fleming</title>
		<link>http://blog.sasinct.com/2008/04/05/sas-monotonic-would-you-like-gin-and-a-slice-of-lemon-with-that/#comment-11</link>
		<dc:creator>Laurie Fleming</dc:creator>
		<pubDate>Tue, 08 Apr 2008 23:13:00 +0000</pubDate>
		<guid>http://blog.sasinct.com/2008/04/05/sas-monotonic-would-you-like-gin-and-a-slice-of-lemon-with-that/#comment-11</guid>
		<description>I said at the time that it wasn't an absolutely reliable function, and I have found a post (and old one!) in SAS-L, from Sigmund Hermansen:

"I believe that this is the same problem that I reported a number of months ago on SAS-L. The undocumented MONOTONIC() function does not appear in the documentation for a reason. If invoked in a CREATE VIEW statement or an in-line view, it seems that the MAX() and MIN() functions do not recognize its calculated value. If instantiated in a prior CREATE TABLE or a Data step, the MAX() etc. functions do recognize it.

As you know, assuming ordering by row ID's has its dangers in SQL queries. I usually attribute the need to fix a row order as a DB design failure. Even so, it often becomes a practical necessity."

I agree with what he says - but in your case it worked as intended. If all you need to do is create some sort of identity column, it seems the perfect solution. If the query involves an 'order by', the target will not have the monotonic column in numerical order, but its contents *will* be unique.</description>
		<content:encoded><![CDATA[<p>I said at the time that it wasn&#8217;t an absolutely reliable function, and I have found a post (and old one!) in SAS-L, from Sigmund Hermansen:</p>
<p>&#8220;I believe that this is the same problem that I reported a number of months ago on SAS-L. The undocumented MONOTONIC() function does not appear in the documentation for a reason. If invoked in a CREATE VIEW statement or an in-line view, it seems that the MAX() and MIN() functions do not recognize its calculated value. If instantiated in a prior CREATE TABLE or a Data step, the MAX() etc. functions do recognize it.</p>
<p>As you know, assuming ordering by row ID&#8217;s has its dangers in SQL queries. I usually attribute the need to fix a row order as a DB design failure. Even so, it often becomes a practical necessity.&#8221;</p>
<p>I agree with what he says - but in your case it worked as intended. If all you need to do is create some sort of identity column, it seems the perfect solution. If the query involves an &#8216;order by&#8217;, the target will not have the monotonic column in numerical order, but its contents *will* be unique.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
