It is only possible to write the variable to a new variable containing the same data, although with a different type.By renaming and dropping variables, it is possible to produce a new variable with the same name as the original, although with a different type.The minimum length for numeric variables (where length refers to the number of bytes allocated by SAS for storing the variable) under SAS/Windows is 3, so variables containing less than 3 digits can be stored using less space as character variables (where the minimum length is 1).Swedish civil registration numbers, for example, which contain 10 digits, can be stored in a numeric variable of length 6, whereas 10 bytes would be required if it was stored as a character variable (see my notes on the LENGTH statement).A naive approach is to multiply the character variable by 1, causing SAS to perform an implicit type conversion.For example, if charvar is a character variable then the code will result in the creation of a new variable, numvar, which will be of type numeric.
For example, if numeric data are stored in a character variable of length 4, then the value '2bbb' (where b represents a space (blank)) is considered to be greater than '1865'.
The RESOLVE function, like SYMGET, is a data step function used to resolve macro variable references.
In addition, the RESOLVE function can resolve macros and data step variables containing macro references, making it far more powerful.
It can also control whether that resolution occurs at compilation time or execution time.
The type of quotation marks used determines when a macro variable is resolved.
If a variable contains integer data which will not necessarily be used in any calculations, such as ID number, it is preferable to save it as a variable of type numeric rather than a variable of type character, even if you have no intention of performing algebraic calculations using the variable.