• 1 reply
  • Latest Post - ‏2013-04-19T13:01:25Z by JonPeck
5 Posts

Pinned topic Searching SPSS Variable Labels

‏2013-04-18T17:30:13Z | spss syntax

I would like suggestions for programmatically searching variable labels in order to identify variables that share the label of a known variable.  I have several hundred files that share a security question ("Please select 4 for this option"), but that question/variable was not consistently named across all the files.  To solve for this, our vendor copied the variable into a predictably named variable in each file; however there seem to be cases where the copied variable data do not exactly match the original.  For obvious reasons, we no longer work with that vendor and I'd like to identify these mismatches and recopy or create new copies.  I think I can trust the label of the vendor-copied variable to match the original, so that is my known "search term"  What are your suggestions for  searching labels for a match as I iterate through the files?  Thanks in advance.


  • JonPeck
    376 Posts

    Re: Searching SPSS Variable Labels


    The GATHERMD extension command available from the SPSS Community website in the Extension Commands Collection will build a cross-file dataset listing all the variable names and labels (and some other properties).  Then you can sort that dataset by the label field, and you should be good to go.

    This command requires the Python Essentials also available through this site..  Once installed, the dialog box for it will appear on the menus as File>Collect Variable Information.


    Jon Peck