Topic
  • 4 replies
  • Latest Post - ‏2013-01-24T09:59:04Z by SystemAdmin
SystemAdmin
SystemAdmin
2077 Posts

Pinned topic Accessing variable name array without using Python

‏2012-12-27T16:03:35Z |
At present, I use Python to step through the table of variable names in (many) data sets to attach a suffix to each variable name, e.g., turn Var1, Var2, Var3, etc. to Var1_ETC, Var2_ETC, Var3_ETC, etc. The variable names change between each run of the programs, so I can't just hard code all of the individual variable names into it. Python is somewhat unwieldy as people who run the programs have had difficulty finding the correct add-ons at the IBM site (surprise, surprise).

Is there any other way to do this yet using just SPSS code?
Updated on 2013-01-24T09:59:04Z at 2013-01-24T09:59:04Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    2077 Posts

    Re: Accessing variable name array without using Python

    ‏2012-12-27T17:42:18Z  
    It would be a bit convoluted, but you could use OMS to capture the output of a DISPLAY DICTIONARY table as a dataset and then use a WRITE command to write the variable names surrounded by the rest of the RENAME syntax to a file and then use INSERT to run that file. Ugly.

    You could alternatively just supply users with the urls to the relevant Python Essentials for their version(s). V18-20 are all hosted on the SPSS Community site, while V21 can be obtained from the regular Statistics download site or from the trial software site. Only the Statistics download site requires any special access.

    HTH,
    Jon Peck
  • SystemAdmin
    SystemAdmin
    2077 Posts

    Re: Accessing variable name array without using Python

    ‏2012-12-27T17:48:15Z  
    Thanks, Jon. I'd pondered trying something like that but, as you say, ugly. It's been a bit problematic to get the proper Pythons distributed since some people are in the US, some in Kenya, with different versions and OS's floating around. Oh well. . . . .
  • SystemAdmin
    SystemAdmin
    2077 Posts

    Re: Accessing variable name array without using Python

    ‏2013-01-24T09:07:05Z  
    Thanks, Jon. I'd pondered trying something like that but, as you say, ugly. It's been a bit problematic to get the proper Pythons distributed since some people are in the US, some in Kenya, with different versions and OS's floating around. Oh well. . . . .
    I always use www.tinyurl.com to abbreviate the lo-o-o-o-o-ong IBM urls (for instance, I've been using www.tinyurl.com/spss-downloads for a long time*). That way I can actually remember them. Some parts of the IBM website require a login though.

    Albert-Jan

    *) easier to remember than this 172-character beast: https://www.ibm.com/developerworks/mydeveloperworks/wikis/home?lang=en#/wiki/We70df3195ec8_4f95_9773_42e448fa9029/page/Downloads%20for%20IBM%C2%AE%20SPSS%C2%AE%20Statistics
  • SystemAdmin
    SystemAdmin
    2077 Posts

    Re: Accessing variable name array without using Python

    ‏2013-01-24T09:59:04Z  
    Thanks, Jon. I'd pondered trying something like that but, as you say, ugly. It's been a bit problematic to get the proper Pythons distributed since some people are in the US, some in Kenya, with different versions and OS's floating around. Oh well. . . . .
    I always use www.tinyurl.com to abbreviate the lo-o-o-o-o-ong IBM urls (for instance, I've been using www.tinyurl.com/spss-downloads for a long time*). That way I can actually remember them. Some parts of the IBM website require a login though.

    Albert-Jan

    *) easier to remember than this 172-character beast: https://www.ibm.com/developerworks/mydeveloperworks/wikis/home?lang=en#/wiki/We70df3195ec8_4f95_9773_42e448fa9029/page/Downloads%20for%20IBM%C2%AE%20SPSS%C2%AE%20Statistics