How to set the length of variable name

Discussion in 'SPSS' started by Jinsong Zhao, Oct 22, 2011.

  1. Jinsong Zhao

    Jinsong Zhao Guest

    Hi there,

    I hope to input several variable using the following code:

    DATA LIST LIST /Population School Employment Services HouseValue .
    BEGIN DATA
    5700 12.8 2500 270 25000
    1000 10.9 600 10 10000
    3400 8.8 1000 10 9000
    3800 13.6 1700 140 25000
    4000 12.8 1600 140 25000
    8200 8.3 2600 60 12000
    1200 11.4 400 10 16000
    9100 11.5 3300 60 14000
    9900 12.5 3400 180 18000
    9600 13.7 3600 390 25000
    9600 9.6 3300 80 12000
    9400 11.4 4000 100 13000
    END DATA .

    However, SPSS complained that:
    It seems that the variable name too long. Thus, my question is it is
    possible to set so that SPSS could use the above variable name, or short
    the name automatically.

    Any suggestions will be really appreciated. Thanks in advance.

    Regards,
    Jinsong
     
    Jinsong Zhao, Oct 22, 2011
    #1
    1. Advertisements

  2. Jinsong Zhao

    Art Kendall Guest

    What version of SPSS are you using? On what platform.

    I could spot nothing wrong with the syntax so I pasted it into version
    19 and version 20 on a 64-bits Windows 7 platform and it worked as I
    expected.

    Are you sure there is nothing before the syntax, perhaps that did not
    have a period at the end?

    Art Kendall
    Social Research Consultants
     
    Art Kendall, Oct 22, 2011
    #2
    1. Advertisements

  3. Jinsong Zhao

    Jinsong Zhao Guest

    Sorry for forgetting the important information. The version of SPSS is 11.5.

    When I short the variable name to eight characters, the syntax works well.

    Regards,
    Jinsong
     
    Jinsong Zhao, Oct 22, 2011
    #3
  4. Jinsong Zhao

    Jinsong Zhao Guest

    Sorry for forgetting the important information, and the platform is
    32-bits Windows XP. The version of SPSS is 11.5.

    When I short the variable name to eight characters, the syntax works well.

    Regards,
    Jinsong
     
    Jinsong Zhao, Oct 22, 2011
    #4
  5. Jinsong Zhao

    Jon Peck Guest

    Old versions of SPSS only allow 8 characters in a variable name. With newer versions they can be up to 64 bytes long. This is not a setting that you can change.

    Regards,
    Jon Peck
     
    Jon Peck, Oct 22, 2011
    #5
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.