SAS Monotonic (would you like Gin and a slice of Lemon with that)
I was using Enterprise Guide the other day to merge some data into a single table and I needed to generate a unique sequence for a derived column.
I asked around for the best option and was told that using ‘_n_’in a datastep would do i, but of course this would have to be a custom code node, and I was using the Enterprise Guide filter and query wizard, which meant I would have to create a second step within my process flow.
No biggy, but within Oracle I would have just called the Sequence function and all would have been good,
Then our resident SAS Geek (note the removal of Uber) mentioned that I could use ‘Monotonic()’. So I created a new computed column in the query, added Monotonic() as the expression and Bob’s you uncle (or even Aunt these days) EG produced a unique sequence in the new column.
The Monotonic() function is apparently experimental in SAS 9.1. But was mentioned in a SUGI paper : Helpful Undocumented Features in SAS
And according to Wikipedia it is:
“In mathematics, a monotonic function (or monotone function) is a function which preserves the given order.”