Creation of new variable

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

g.pino
Posts: 1
Joined: Sun Jun 22, 2014 4:28 am

Creation of new variable

Postby g.pino » Sun Jun 22, 2014 4:46 am

Hi,
I have a numeric variable, how do I create a new one with the first three numbers?
Example:
DRG ---> DRGa
12345 ---> 123
......... ---> .....
thanks

IBM SPSS v.21
GerineL
Moderator
Posts: 1477
Joined: Tue Jun 10, 2008 4:50 pm

Re: Creation of new variable

Postby GerineL » Mon Jun 23, 2014 10:16 am

You can do this by a substring function, however, this only works on string variables, so you would have to convert your numeric variables into string.

Good luck!

Who is online

Users browsing this forum: No registered users and 1 guest

cron