0

I have received a data set which multiple response variables were already set. Is it possible to export their syntaxts in order to use them in another data with the same variables? Thank you

1 Answer 1

0

You can use the APPLY DICTIONARY command. Strictly speaking, the variable definitions are not exported (to a file) or imported (from a file). The APPLY DICTIONARY command allows you to directly apply roughly three types of dictionary information from one dataset(file) . to another:

  1. Dictionary info on the file level (FILEINFO)

  2. Dictionary info about variables that exist in both files (VARINFO)

  3. Dictionary of variables not present in the target file (NEWVARS)

The defintions of (MRSETS) are part of #1, FILEINFO, because they describe more than single variables' attributes, but rather how certain variables are defined to make up a multiple response set. So, to copy the MRSETS you copy the dictionaries of existing, matching variables, and copy any new variables belong to the MRSET, before you can apply the FILEINFO.

In this example, the variable info on var1 from file1.sav is copied to the variables var2, var3 and var4 in the active dataset.

Syntax example:

APPLY DICTIONARY FROM file1.sav
 /SOURCE VARIABLES = var1
 /TARGET VARIABLES = var2 var3 var4 
 /NEWVARS
 /FILEINFO MRSETS = REPLACE.

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.