What would you do for a name like "Eddie Van Halen"?
Otherwise, in a simplistic situation illustrated, SCAN() works.
data want;
set have;
firstName = scan(name, 2);
lastName = scan(name, 1);
run;
@marleeakerson wrote:
Hello,
I currently have a variable that contains a last name and first name, and I want to split it up into two separate variables, one for the last name and one for the first name.
For example, I want the data to go from:
Name
Smith Julia
Johnson Mark
Reynolds Steve
to this:
Last Name First Name
Smith Julia
Johnson Mark
Reynolds Steve
Does anyone have any advice?
Thanks!