I'm helping a colleague who has been asked to generate a key ID for two different groups of data coming in. I've completed this step but it's not very user friendly so I'm looking for suggestions on how to make it more readable. Each group has its own ID that appears to be a hexadecimal value. The concatenation of them appears to be a unique key in its own right. In this case, the Household table and the Account table are being brought together and she has been asked to generate at Household-Account value (a household can have many accounts, an account can span households).
Our data is stored on SQL server but we do most of our manipulations using SAS, hence, PROC SQL below.
My initial thought was that the most obvious key is to run the two key fields together and use a delimiter. You'll see that in the top portion of my code. However this makes a very long field so I was asked to shorten it. My second thought, and their initial ask, was to just do an integer field. You can see that with the Monotonic but they felt that since it has warnings about it around the internet they don't trust it. My third thought was to run the existing, concatenated field through some kind of one-way function but when I do that (see MD5 below) I get something that looks like wingdings took over.
/* creating a table of just the "key" columns */
PROC SQL;
CREATE TABLE work.ConcatonatedKey AS
SELECT DISTINCT
CATX("G", HouseholdKey,FinancialKey) as Concatonated
FROM work.OriginalData
;
QUIT;
/* Populate HHFinancialKey */
/* Monotonic documentation */
/* http://support.sas.com/techsup/notes/v8/15/138.html */
PROC SQL;
CREATE TABLE work.ContrivedKeys AS
SELECT
Monotonic() AS HHFinID
, Concatonated
, MD5(Concatonated) As foo
FROM work.ConcatonatedKey
;
QUIT;
So, the real question here is, if you had something that could uniquely ID a row but wanted to make it more user friendly, using SAS, how would you go about it. ?