Variable attributes are, of course, variable specific, so you have to know the variable name that owns the attribute. You might be able to use file attributes instead.
Otherwise, you could iterate over the variable index and find the attributes for each variable via spss.GetVarAttributeNames.
Otherwise, if you have a list of candidate variables, you could capture the output of DISPLAY ATTRIBUTES with OMS and parse through that.
------------------------------
Jon Peck
------------------------------
Original Message:
Sent: Wed November 30, 2022 05:13 PM
From: Frank Watzl
Subject: Deleting a variable attribute
Hi.
I need to remove a variable attribute by name.
Not just the attribute values, but the entire attribute column in variable view.
I tried
which prints
Warnings |
VARIABLES is required. |
Execution of this command stops. |
Changing to
VARIABLE ATTRIBUTE
VARIABLES = first_var_in_dataset TO last_var_in_dataset
DELETE = my_var_attr.
works.
How can I delete a variable attribute if I do _not_ know the first and last variable at runtime and hence can not hard code their names?
#SPSSStatistics