IBM Support

How to change a STRING into a DATE: Mimic POINT and CLICK

Question & Answer


Question

I am using SPSS for Windows and have many variables that which look like date variables but are actually string variables. I have noticed that I can simply double click on the variable heading in the data editor and change the type of variable from string to date. I also notice that the generated syntax is merely a FORMATS command. When I issue the equivalent FORMATS command: FORMATS STRDATE (DATE11). SPSS gives me this error: Error # 4836 in column 9. Text: STRDATE Only the formats A and AHEX can be applied to string variables. This command not executed. I have many of these fields and don't want to point and click on variable headings for an indefinite period of time. Is there a syntax solution which will work for many variables?

[{"Product":{"code":"SSLVMB","label":"IBM SPSS Statistics"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Component":"Not Applicable","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"Not Applicable","Edition":"","Line of Business":{"code":"LOB76","label":"Data Platform"}}]

Log InLog in to view more of this document

This document has the abstract of a technical article that is available to authorized users once you have logged on. Please use Log in button above to access the full document. After log in, if you do not have the right authorization for this document, there will be instructions on what to do next.

Historical Number

17490

Document Information

More support for:
IBM SPSS Statistics

Software version:
Not Applicable

Document number:
417773

Modified date:
16 April 2020

UID

swg21476171

Manage My Notification Subscriptions