I am a new sas user trying to clean up a dataset. I am interested in coding some categorical variables into a composite variable of water and sanitation quality.
I have a dataset from nicaragua where responses have accents. It was a previous SPSS file, and when I import to SAS all accent characters convert to unknown characters and prevent me from running a proc freq. I simply need 9 categories to code as 0/1, so the variable could simply be converted to numeric if I know what the values mean. Can someone please advise on how to get rid of the unknown character? The variable in question is S1P15
dataset is attached. Current proc import below:
*import spss dataset and convert; proc import datafile = "/folders/myfolders/sasuser.v94/WFP/datasets/EMNV14-02 DATOS DE LA VIVIENDA Y EL HOGAR (1).SAV" out= work.nicaragua dbms=sav replace; run;
Then convert the format catalog to a dataset. And change the values of the LABEL variable from WLATIN1 to UTF-8 encoding. Get rid of the MIN/MAX/DEFAULT/LENGTH variables so that PROC FORMAT will recalculate the default length to use based on the adjusted label values.
proc format lib=work.nicaragua out=formats; run;
length label $200;
set formats ;
keep fmtname start end label;
proc format lib=work.nicaragua cntlin=formats ; run;
Now let's try using the labels. If you didn't write the formats into the WORK.FORMATS catalog then make sure to add the catalog to the FMTSEARCH option.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.