SPSS Statistics

SPSS Statistics

Your hub for statistical analysis, data management, and data documentation. Connect, learn, and share with your peers! 

 View Only
  • 1.  Not recognizing Macro Command

    Posted Fri March 08, 2024 10:21 PM

    I have defined a macro, but when I call the macro I get an error message indicating that it isn't a recognized SPSS command.

    >Error # 1.  Command name: !doLongVTC 
    >The first word in the line is not recognized as an SPSS Statistics command. 
    >Execution of this command stops.

    Syntax File:

    * Encoding: UTF-8.
    define doLongVTC (vlist = !CMDEND)
        varstocases
        !DO !vname !IN (!vlist)
                 /make !vname  from 
          !DO !i=1 !to 40      
                        !CONCAT("A", !I, "_",  !vname)  
            !DOEND
                /INDEX = course(!vname)
    !DOEND 
             
                 /NULL = KEEP.
    !enddefine.

    SET MPRINT = on.

    !doLongVTC vlist =Themes_1 Themes_2 Themes_3 Themes_4 Themes_5 Themes_6 Themes_7 ThemesComm Content_1 Content_2 Content_3 Content_4 ContentComm Inquiry_CritThinking_1 
    Inquiry_CritThinking_2 Inquiry_CritThinking_3 Inquiry_CritThinking_4 SciCritThinkingComm Values_1 Values_2 Values_3 ValuesComm Comm_Literacy_Tech_1 Comm_Literacy_Tech_2 
    Comm_Literacy_Tech_3 Comm_Literacy_Tech_4 CommLitTechComm Pers_ProfDevelopmnt_1 Pers_ProfDevelopmnt_2 Pers_ProfDevelopmnt_3 Pers_ProfDevelopmnt_4 Pers_ProfDevelopmnt_5
    Pers_ProfDevelopmnt_6 PersProfDevComm.

    DISPLAY Macros.



    ------------------------------
    Steven Scher
    ------------------------------


  • 2.  RE: Not recognizing Macro Command

    Posted Fri March 08, 2024 10:27 PM
    put a ! in front of the name in the DEFINE statement.