4

Frequently, PSPP/SPSS syntax documentation (example) suggests I must to pass a list of variables with /VARIABLES=var_list and this is not an optional subcommand.

But I have a lot of datasets to process. I would like to programmatically get a list of all variables in the active dataset, pass that to a procedure, and then generate a file from the procedure output.

I've tried /VARIABLES=* but that didn't work.

error: DESCRIPTIVES: Syntax error at `*': expecting variable name.

Martin Burch
  • 2,726
  • 4
  • 31
  • 59

2 Answers2

4

You can use display variables. or display dictionary. to generate a table of all variables and their attributes which could then be captured using OMS. However if you want to pass all variables to a function that expects a list you can use all, i.e. descriptives /variables= all..

Ritchie Sacramento
  • 29,890
  • 4
  • 48
  • 56
2

/VARIABLES is often optional in procedures, but ALL stands for all the variables. If you need to refine by a particular measurement level, type or other metadata, try the SPSSINC SELECT VARIABLES extension command. This command applies various filters based on the metadata and creates a macro with the variables that pass. You can then use that in any context.

eli-k
  • 10,898
  • 11
  • 40
  • 44
JKP
  • 5,419
  • 13
  • 5