Apply by type OR save variable order

Moderators: statman, Analyst Techy, andris, Fierce, GerineL, Smash

Plutowilson
Posts: 1
Joined: Sat Mar 08, 2014 3:17 pm

Apply by type OR save variable order

Postby Plutowilson » Sat Mar 08, 2014 3:36 pm

I have many datasets with many different variables (numeric & string) in each. For each dataset, I would like to:
1. Set missing values for the numeric variables
2. Label those missing values on the numeric variables
3. Retain the original order of the variables in the dataset
4. Do all of this programmatically

I. Is there an easy way to select variables by type (if numeric) for the labels & missing values commands?

II. I can sort the variable by type, and I can identify the first and last numeric variables, so I could use (Var1 TO VarN), but then I lose the original sort order. Is there a way to save the variable sort order with syntax (I know there is a feature in the menu of SORT VARIABLES that saves the sort as a custom attribute, but it does not generate syntax)?

III. Worst case scenario, I can list all the variables in the correct order for a KEEP command, but this is creating hiccups in my code that generates the syntax file from another program. If I can fix the limitations on the external program, are the any limitations on a KEEP command that might bite?

IV. Is there some other approach I'm missing?

Thank you!

Who is online

Users browsing this forum: No registered users and 1 guest

cron