IBM Support

Counting the events of a substring within a string variable in SPSS

Troubleshooting


Problem

I have a long string variable. Is it possible for me to count the occurrences of a given substring, such as the letter "a", within the long string value? I think the COUNT command is designed for this sort of thing, but that works across variables. How can I get it to work within a variable?

[{"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

19255

Document Information

More support for:
IBM SPSS Statistics

Software version:
Not Applicable

Document number:
418151

Modified date:
16 April 2020

UID

swg21476682

Manage My Notification Subscriptions