replace code with label in new variable

Moderators: statman, Analyst Techy, andris, Fierce, GerineL, Smash

nerimartinez
Posts: 1
Joined: Wed Aug 28, 2013 11:26 pm

replace code with label in new variable

Postby nerimartinez » Thu Aug 29, 2013 12:04 am

Hi everyone there!
I'm new in the forum and it's wonderful to be part of a supportive communty like this. I hope i can contribute with it.

I have a trouble i can't solve by myself and i've googled it looks that there is no easy way to solve it. Or perhaps i dont know how to explain it clearly... :/

Ok, let me expose my case:

I have a numeric variable associating the "employee number" as code and the "employee name" as label.
My boss ask me to create a new string variable which stores the "employee name's".
I need to do some transformation like this.

EmployeeNmr(F5.0) >>> EmployeeStr(A100)
10982 (John Doe) >>> John Doe
10982 (John Doe) >>> John Doe
10986 (Jane Doe) >>> Jane Doe

I'd like to know if there is some "syntaxis trick" to help me to do this. I've already look up in this forum using the keyword "replace with labels" but none of the items helps me. :/

I´ve thought on "brute force" approach, something like "Save as">>excel>>replace values with labels, and the copy-paste the string from Excel to a new variable in spss, but i think that should be a native (and more elegant and powerful) way to deal with this.

Thanks in advace for your kind suggestions.

Best regards from Mexico!

Who is online

Users browsing this forum: No registered users and 1 guest

cron