Help using Base SAS procedures

Convert string variables with labels to numeric variables with same labels

Reply
N/A
Posts: 1

Convert string variables with labels to numeric variables with same labels

I have a dataset that contains several string variables that have value labels.  I'm am not a SAS user, I use Stata and I want to import this data into Stata for analysis.  I can import the xport file into Stata but when I include the provided formats.cpt file the import halts.  This occurs because several of the string variables have labels.  Stata allows labels only for numeric variables.  So I'm trying to find a way to duplicate these variables, convert the duplicate into a numeric variable of the same name with a prefix or suffix, and apply the label to the numeric variable.  Then I can keep the original variable with the string text and no label.  There would be no loss of information this way.

The problem is, I can't do this within Stata.  This has to be done in SAS and I haven't a clue how to use SAS.  I expect this is probably a simple problem but for someone with absolutely zero knowledge of the SAS programming language it is daunting.  I'd would appreciate any guidance you could provide.  I do have access to SPSS and I am somewhat proficient in it - at least more so than SAS which isn't saying much. 

Will Hauser

Ask a Question
Discussion stats
  • 0 replies
  • 252 views
  • 0 likes
  • 1 in conversation