[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:
> >datasets on both variables, then list both in the -merge- command:
> > . merge ssn adate using ...
> Thanks, but I just noticed an issue. In one dataset the Social
> Security Number is in the "standard" format (###-##-####), while in
> the other it's just a set of straight digits (no hyphens). I guess I
> need to remove the hyphens in the one set - how do I do that?
I assume that you want to remove the hyphens, and don't want to replace them
with spaces. If "ssn" is the variable containing the SSN, then
. replace ssn = subinstr(ssn,"-","",.)
should do the trick. See -help strfun- for details.
Take care that the ssn variables in both datasets are either "strings" or
"numbers". Use -tostring- or -destring- to convert your strings to real or
vice versa. I recommend to use strings.
+49 (030) 25491-361
* For searches and help try: