Is there a function that returns the type of a variable—string or numeric? I’m pretty sure there’s nothing in syntax, but what about extensions accessable to syntax? I’m sure something could be written (has been written) in Python by someone
but my use for this is for someone that doesn’t know what python is or whether or not it is installed on their machine. I want to use this function to conditionally execute code that requires a specific variable type. (I took a pass through the Extensions
Hub but didn’t see anything obvious (but did see some surprising things!). Thanks, Gene Maguin |
See if the SPSSINC SELECT VARIABLES extension (Utilities > Define Variable Macro) will do what you want. It lets you create a macro listing variables that meet various metadata criteria. For example, SPSSINC SELECT VARIABLES MACRONAME="!numeric" /PROPERTIES TYPE=NUMERIC. would create a macro listing all the numeric variables in the file. SPSSINC SELECT VARIABLES MACRONAME="!categorical" /PROPERTIES LEVEL=NOMINAL ORDINAL /OPTIONS ORDER=ALPHA REVERSE=NO PRINT=YES IFNONE=ERROR SEPARATOR="+". would create a macro listing all the categorical variables separated by "+". Useful for CTABLES It can select based on lots of other criteria such as measurement level, patterns in names, and custom attributes. There are Python functions that can examine the variable type, but using these directly requires, well, Python. On Fri, Jan 31, 2020 at 12:01 PM Maguin, Eugene <[hidden email]> wrote:
|
Thank you.
From: Jon Peck [mailto:[hidden email]]
See if the SPSSINC SELECT VARIABLES extension (Utilities > Define Variable Macro) will do what you want. It lets you create a macro listing variables that meet various metadata criteria. For example, SPSSINC SELECT VARIABLES MACRONAME="!numeric" would create a macro listing all the numeric variables in the file. SPSSINC SELECT VARIABLES MACRONAME="!categorical" would create a macro listing all the categorical variables separated by "+". Useful for CTABLES It can select based on lots of other criteria such as measurement level, patterns in names, and custom attributes. There are Python functions that can examine the variable type, but using these directly requires, well, Python. On Fri, Jan 31, 2020 at 12:01 PM Maguin, Eugene <[hidden email]> wrote:
-- Jon K Peck |
Free forum by Nabble | Edit this page |