IBM Support

Cannot recode numeric variables with comma based decimals into string variables using the Transform - Recode into different variables dialog

Troubleshooting


Problem

I am working with Statistics 18 on a comma based locale for decimal separators e.g. German or Polish In my data file I have a numeric variable with decimals e.g. 12,50 (this is 12.50 on a locale using dots as decimal separator). I would like to recode these values into a string variable with Recode into Different Variable dialog. On the Old and New Values dialog I select the option "Output variables are strings". I enter e.g. 12,50 as old value and 13,50 as new value. However, when I click on the Add button I get an error "Invalid numeric value" and I am unable to enter these string values, why is this? This does only happen when I have selected "Output variables are strings" and not with numeric output variables.

Resolving The Problem

This problem has been reported to SPSS Development - Workaround Available. It is resolved in Statistics 19.
As a workaround please use either syntax or set the locale to a non comma-based locale (e.g. English) and enter your decimal values in the transform - recode into different variables menu. For the above example the syntax would be:

STRING mynewstringvar (A8) .
RECODE
v1
(12.50='13,50') INTO mynewstringvar .
EXECUTE

[{"Product":{"code":"SSLVMB","label":"IBM SPSS Statistics"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Not Applicable","Platform":[{"code":"PF016","label":"Linux"},{"code":"PF014","label":"iOS"},{"code":"PF033","label":"Windows"}],"Version":"18.0","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Historical Number

86950

Document Information

More support for:
IBM SPSS Statistics

Software version:
18.0

Operating system(s):
Linux, iOS, Windows

Document number:
424045

Modified date:
16 April 2020

UID

swg21485090

Manage My Notification Subscriptions