SPSS Statistics

SPSS Statistics

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

 View Only
  • 1.  DEFINE / !ENDDEFINE macro stopped working in Version 29

    Posted Fri November 04, 2022 09:09 AM
    I've acquired a new computer and installed the latest SPSS (at least, the latest available at my university's software portal).

    I'd been using macros to easily update annual information for my all my syntaxes, e.g. 

    DEFINE !year() "2021" !ENDDEFINE

    After running that, any time SPSS saw syntax like "select if year = !year" it would keep the latest year and delete everything else, yippee.

    But now, when I run my DEFINE statements, nothing happens. Nothing. No Output appears, no error message either.  And if I try "select if year = !year" , it's also silent. No error message, but nothing runs. 

    I'm flummoxed. Does anyone know what's changed and how to fix it? This is syntax I've run annually for years ...

    ------------------------------
    Ashley Lambert-Maberly
    ------------------------------

    #SPSSStatistics


  • 2.  RE: DEFINE / !ENDDEFINE macro stopped working in Version 29

    Posted Fri November 04, 2022 10:09 AM
    I don't see a problem with this, assuming that there is a period after the !denddefine.
    What do you see if you run
    DISPLAY MACROS.
    after the macro definition?

    --





  • 3.  RE: DEFINE / !ENDDEFINE macro stopped working in Version 29

    Posted Fri November 04, 2022 12:18 PM
    Thanks for helping! If I run DISPLAY MACROS It does give me this:

    So it appears that it defines the macros after all, it just won't tell me it's done so, in prior years, unless I prod it.

    So then my problem is a different one, which was easier to solve: my colleague saved my data in the wrong format, so that the year variable is a numeric field when our syntax expects a string.  When I fix that, my

    select if Session_Year >= !year10.
    execute.

     works.

    Thanks so much! I had not known about DEFINE MACROS, but will add it to my syntaxes from now on, if Output won't automatically reassure me it's running my define statements.

    ------------------------------
    Ashley Lambert-Maberly
    ------------------------------



  • 4.  RE: DEFINE / !ENDDEFINE macro stopped working in Version 29

    Posted Fri November 04, 2022 01:32 PM

    It seems I have a larger problem, which is that my Output View Window isn't displaying all my actions. I'd been under the understanding that it would do this:

    "Primarily, the Output Viewer is where the results of statistical analysis are shown, but any command invoked through the drop-down menus or syntax will be printed to the Output Viewer. This includes opening, closing, or saving a data file."

    (it's been doing that for 25 years for me) ...
     
    but my latest version isn't showing (a) saving files, (b) opening files, or (c) defining macros ... so far, there could be more omissions to come, I'm just getting started. 
     
    Is there a way to enable "show every action in the output view window" or some such thing? It's incredibly helpful for knowing where I left off, among all sorts of other reasons, and in today's multi-tasking world, knowing what step you just completed is vital.
     
    Has anyone else noticed this, or know how to fix it?


    ------------------------------
    Ashley Lambert-Maberly
    ------------------------------



  • 5.  RE: DEFINE / !ENDDEFINE macro stopped working in Version 29

    Posted Fri November 04, 2022 01:36 PM
    In a syntax window, issue this command:

    SET PRINTBACK LISTING.

    That will show commands in the viewer.

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



  • 6.  RE: DEFINE / !ENDDEFINE macro stopped working in Version 29

    Posted Fri November 04, 2022 01:43 PM
    I'm not sure that the SET PRINTBACK command persists as a preference setting, but you can set that in Edit > Options > Viewer "Display commands in the log".  That really ought to be the default setting.

    --