I'm not sure if this is a great idea.
-The monotonic function is not supported by SAS
-The described pre-step does a full table scan (a pass of data) if the table resides in a SAS Base libname. Indexing the surrogate key column won't help. If your data is in SPDS, this would work excellent and extremely fast, since SPDS will query the meta data portion of any existing index. If your data is an external RDBMS, it's likely that you have functionality of generating surrogate keys built in.
An alternative (if you have your target table sorted by the surrogate key) is to use data set functions to retrieve the last record and its surrogate key value. This is also very efficient. And if you don't wish to use an unsupported function, you could just use a data step view and calculate the key values using _n_ and the current max value retrieved earlier.
/Linus
Data never sleeps