0

I'm writing syntax in SPSS and need to create logic statements and loops that are based on the variable type. Could someone suggest to me the code for SPSS Syntax to return variable type? Thank you!

2
  • To my knowledge, that is only possible using a scripting facility (python or R). Do you have them installed ?
    – horace_vr
    Jul 6, 2018 at 19:26
  • This answer will probably help you
    – eli-k
    Jul 8, 2018 at 5:41

1 Answer 1

0

It's only an indirect way of working with variable information: You could combine'codebook' with 'oms'. Like that, you'll get a new dataset with all the variable information as separat variables. After the needed transformations, you can merge the new dataset to the original.

    DATASET DECLARE v_information.
    OMS
    /SELECT TABLES /IF SUBTYPES ='Variable Information' /DESTINATION FORMAT=SAV OUTFILE=v_information VIEWER=YES.
    CODEBOOK test1 test2  /varinfo format.
    OMSEND.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.