SetVarRole Method (Python)
.SetVarRole(varName,varRole). Sets the role for a new variable. The argument varName is a string specifying the name of a new variable. The argument varRole is a string specifying the role: "Input", "Target", "Both", "None", "Partition" or "Split".
- This method is only available in write mode.
Example
cur=spss.Cursor(accessType='w')
cur.SetVarNameAndType(['targetvar'],[0])
cur.SetVarRole('targetvar','Target')
cur.CommitDictionary()
cur.close()