SPSS Statistics

 View Only
  • 1.  SYNTAX Red Error- HELP

    Posted Fri March 29, 2024 08:49 AM

    Hi! 

    I am in grad school and downloaded my survey SPSS Syntax from Qualtrics and my Variable Labels is red. I have no idea how to fix this. It says that the variables are red because they have quotation marks or apostrophes so when I try to fix that and my variable label turns to blue. I get an error when I hit the run selection button. I have pictures below. My assignment is due on Monday and I have been working on this for days. If anyone has any suggestions I would really appreciate it!



    ------------------------------
    Brittany Foster
    ------------------------------



  • 2.  RE: SYNTAX Red Error- HELP

    IBM Champion
    Posted Fri March 29, 2024 09:53 AM

    I can't see from the small image where the problem is, but it might be that that VARIABLE LABEL syntax doesn't follow the SPSS syntax rules about quoting literals.  
    The image shows the labels enclosed in double quotes - ".  So if a label contains " as part of the label, it needs to be doubled- "" or the outer quotes need to be changed to single quotes - ' for that item.



    ------------------------------
    Jon Peck
    ------------------------------



  • 3.  RE: SYNTAX Red Error- HELP

    Posted Tue April 02, 2024 05:54 PM

    Hi @Brittany Foster

    I can't see the end of your VARIABLE LABELS command.  Does it end with a command terminator character('.')?

    Assuming all of the values to the left of the double-quoted strings are variable names and the quoted strings are the variable labels, then your VARIABLE LABELS command syntax looks correct -- as long as the labels are in keeping with what @Jon Peck has already said.

    It looks like you've tried to run this incomplete command while you have no data in the Data Editor.  That's where the error at the bottom is coming from.



    ------------------------------
    David Dwyer
    SPSS Technical Support
    IBM Software
    ------------------------------