IBM Support

Syntactically change variable format to a specific width and/or format.

Question & Answer


Question

How can I syntactically or via the user interface change all of my String variables to a specific Width, or my Numeric variables to a specific Format.

Cause

For Example, I have 600 string variables and I do not want to change the width one by one in the variable tab. I need a more streamlined method.

Answer

* The following ALTER TYPE command will change all of your String Variables in your data set to a Width of 50.
ALTER TYPE ALL (A=A50).

* The following ALTER TYPE command will change all of your Numeric Variables in your data set to a Format of 8.5.
ALTER TYPE ALL (F=F8.5).

For more information and examples of the 'ALTER TYPE' syntax command, from within SPSS Statistics Help menu launch help topics and search on 'Overview (ALTER TYPE command)'.

Note:
The ALTER TYPE command was introduced is SPSS Statistics version 16.0.

[{"Product":{"code":"SSLVMB","label":"IBM SPSS Statistics"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"--","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"21.0;20.0;19.0;18.0","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

More support for:
IBM SPSS Statistics

Software version:
21.0, 20.0, 19.0, 18.0

Document number:
219347

Modified date:
16 April 2020

UID

swg21625154

Manage My Notification Subscriptions