SetVarAttributes Method (Python)
.SetVarAttributes(varName,attrName,attrValue,index). Sets a value in an attribute array for a new variable. The argument varName is a string specifying the name of a new variable. The argument attrName is a string specifying the name of the attribute array. The argument attrValue is a string specifying the attribute value, and index is the index position in the array, starting with the index 0 for the first element in the array.
- This method is only available in write mode.
- An attribute array with one element is equivalent to an attribute that is not specified as an array.
Example
cur=spss.Cursor(accessType='w')
cur.SetVarNameAndType(['numvar'],[0])
cur.SetVarAttributes('numvar','myattribute','first element',0)
cur.SetVarAttributes('numvar','myattribute','second element',1)
cur.CommitDictionary()
cur.close()