01-02-2016 08:40 PM
Is there an option to only keep variables referenced in a program? I would like to shrink a large dataset but would prefer not to have to identify 50-80 variables everytime I start a new analysis.
01-02-2016 09:50 PM
There isn't such an option. However, you might be able to lessen the workload. Instead of naming 50 to 80 variables toward the end of the program, you might be able to keep just 20 or 30 variables at the beginning of the program. Those would be kept, along with all variables that are calculated by executing the program.
Without more specifics about what the program does, it's difficult to give more specific suggestions.
If the variables you are keeping have recognizable patterns to their variable names, additional possibilities exist. For example, it's easy to keep all variables where the variable name begins with "var_".
01-02-2016 10:19 PM - edited 01-02-2016 10:31 PM
Use the colon operator to specify a prefix.
Use a list for variables that are sequentially labelled.
Use -- to keep variables that are side by side. All variables in between the two variables listed are kept.
The documentation details it better than I can, as usual: