[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: How to merge 2 datasets using 2 unique variables
Robin Newberry wrote:
> > I recommend to use strings.
> Hmmmm. OK then - how do I put the hyphens into the non-hyphenated string?
No, no. Don't put hyphens into the numbers. Just tread the numbers as strings.
In your non-hyphenated dataset type something like
. ren ssn ssnreal
. destring ssnreal, generate(ssn)
. sort ssn
. save foo, replace
and than merge.
The reason for my recommendation, btw is, that numbers with many digits like
the SSN, can get obscured by the storage-type "float". I generally use
string-variables for unique-identifiers therefore ...
+49 (030) 25491-361
* For searches and help try: