CHANGE command
See Crunch Automation basics for more information.
The CHANGE command allows you to change the title, notes, and description for a list of variable aliases. Additionally, it lets you set the labels of the subvariables on categorical arrays and dichotomous arrays via the CHANGE LABELS syntax. It is possible to modify only a subset of an array's subvariables using the SUBVARIABLES modifier, and when present, only one array can be altered.
CHANGE (NOTES|TITLE|DESCRIPTION) IN alias, ..., alias WITH ("string", ..., "string"|function());
CHANGE LABELS IN alias, ..., alias [SUBVARIABLES subvariable_code, ..., subvariable_code|function()] WITH ("string", ..., "string"|function());
CHANGE (NOTES|TITLE|DESCRIPTION) IN alias, ..., alias FROM alias, ..., alias;
CHANGE (NOTES|TITLE|DESCRIPTION)
SET "string" ON alias, ..., alias
...
SET "string" ON alias, ..., alias;
See how functions that operate on attributes to learn more.
Example
# Overwrite all variables' titles with their descriptions.
CHANGE TITLE IN ALL() WITH COPY(DESCRIPTION);
CHANGE TITLE IN q1...q10 WITH COPY(DESCRIPTION);
CHANGE NOTES SET "System variables" ON random,pk,starttime;
CHANGE TITLE IN Age WITH "Respondent Age";
CHANGE DESCRIPTION
SET "Main variables" ON q1...q5
SET "subvariables" ON q6...q10;
CHANGE DESCRIPTION IN var1, var2 WITH LIKE_REPLACE(DESCRIPTION, "Remove me", "Changed");
CHANGE DESCRIPTION IN var1, var2 WITH LIKE_REPLACE(DESCRIPTION, "%begin", "begin");
CHANGE DESCRIPTION IN var1, var2 WITH REGEX_REPLACE(DESCRIPTION, "[abc]", "+");
CHANGE DESCRIPTION IN var1, var2 WITH REGEX_REPLACE(DESCRIPTION, "last.*", "last");
CHANGE NOTES ON var1, var2 FROM var3, va4;
CHANGE DESCRIPTION ON var5, var6 FROM var7, var8;
CHANGE LABELS IN array1...array5 WITH "Like", "Neutral", "Dislike";
CHANGE LABELS IN array1, array2 WITH REMOVE_COMMON_SUFFIX();
CHANGE LABELS IN array1, array2 WITH REGEX_REPLACE("A (\d)", "\1 A");