SPSS Statistics

 View Only
  • 1.  Variable names were changed when reading in from Excel

    Posted Fri March 24, 2023 03:17 PM

    I read in a data file from Excel, like I do all the time. But this time, SPSS added the "@" symbol at the beginning of all variable names that started with a number. When I tried to remove the symbols, they would reappear and I would get an error message that said the variable name started with a symbol that was not allowed. The correct names of the variables were put in the Variable Labels slot. Although I could not remove the "@" from the start of each variable name, I could change it to another letter/number. That is a work-around for the moment - I don't wish to have to change the variable names in all my documentation just because SPSS is adding a "@" and won't let me get rid of it. Any thoughts on why this is happening and how I can prevent it?

    #SPSS Statistics



    ------------------------------
    Janet
    ------------------------------


  • 2.  RE: Variable names were changed when reading in from Excel

    Posted Fri March 24, 2023 03:20 PM

    Note this information on variable names in SPSS.



    ------------------------------
    Rick Marcantonio
    Quality Assurance
    IBM
    ------------------------------



  • 3.  RE: Variable names were changed when reading in from Excel

    Posted Fri March 24, 2023 03:36 PM

    Thanks so much -- 



    ------------------------------
    Janet
    ------------------------------



  • 4.  RE: Variable names were changed when reading in from Excel

    IBM Champion
    Posted Fri March 24, 2023 03:21 PM
    Variable names cannot start with a digit.  You can change the @ to something else, but it has to be alphabetic.

    --





  • 5.  RE: Variable names were changed when reading in from Excel

    Posted Fri March 24, 2023 03:31 PM

    I looked up that possibility before posting and found several on-line sites that said they could start with either a letter or number. I guess I didn't look far enough as just now I found a site that said they can only start with letters. Thanks for the definitive answer, Jon! Guess I am changing all the documentation anyway. 



    ------------------------------
    Janet
    ------------------------------



  • 6.  RE: Variable names were changed when reading in from Excel

    IBM Champion
    Posted Fri March 24, 2023 03:51 PM
    Well, the first character must be a letter  or one of a few special characters that indicate different variable types, but the notion of a letter follows the Unicode character classification, so you could have some pretty exotic starters.  The image below shows first characters from Greek, Hiragana (Japanese), Arabic, Korean etc.

    Kind of hard to type, though :-)
    image.png

    --