Got it! My apologies. Let me start over here then. 1) I brought the file in using this code: libname mylib '/home/xxxxxxx/sasuser.v94';
proc import out=mylib.mydata datafile='/home/xxxxxxx/2019 ASR_Public_Use_File.dta' dbms=DTA replace;
run;
proc print data=mylib.mydata;
run;
proc freq data=mylib.mydata;
table _all_;
run;
proc means data=mylib.mydata;
run; 2) I try to set up a 'working' version so as not to overwrite the original: DATA asr;
set '/home/xxxxxxx/sasuser.v94/mydata.sas7bdat';
run; 3) I run the below code to try to start modifying variables from the 'working' data set and the changes do not appear in OUTPUT DATA in the 'working asr' version: data workingasr;
set asr;
if qn1f='male' then qn1f=1;
else if qn1f='female' then qn1f=0;
if respondent='respondent' then respondent=1;
else if respondent='not respondent' then respondent=0;
run; 4) I checked the LOG and it appears to be making changes to the mydata.sas7bdat dataset or at least, reading from it? NOTE: Character values have been converted to numeric values at the places given by: (Line):(Column).
71:9 72:14 73:15 74:20
NOTE: Invalid numeric data, 'male' , at line 71 column 9.
NOTE: Invalid numeric data, 'female' , at line 72 column 14.
NOTE: Invalid numeric data, 'respondent' , at line 73 column 15.
NOTE: Invalid numeric data, 'not respondent' , at line 74 column 20. 5) So the questions are: i) What is the presumably simple change that I clearly need to make in my code in order to make modifications to variables from the 'working asr' data set rather than the mydata.sas7bdat dataset so that the OUTPUT DATA reflects the changes? ii) How can I read the data NOT as numeric so that I can later create dummy variables for gender, marital status, etc.? NOTE: what's super weird is if I add a line of code to part 3) above that asks to rename one of the columns, it shows up in the OUTPUT DATA for the 'working asr' but NOT in the maydata.sas7bdat file. Let me know if I'm missing any details you need to offer guidance! Thanks in advance.
... View more