I need help figuring out where I've gone wrong, please.
I have a data set containing 29 observations and 12 variables. After I import my data set, I see the following {below}. I'm attempting to use an array to clean up data. However, once I enter my code, I'm left with 7 variables and 1 observation. I don't know where I am going wrong and would appreciate help.
Thank you.
Libname Clean '/folders/myfolders/Week 11';
proc import datafile='/folders/myfolders/Week 11/BAS150 Survey.xlsx'
dbms=xlsx
out=Clean.CleanSurvey;
run;
proc print data=clean.cleansurvey;
run;
proc freq data=clean.cleansurvey;
run;
data clean.cleansurvey;
array clean{*} preferred_browser read_news online_shopping online_gaming facebook twitter other_social_network;
do i = 1 TO dim(clean);
if clean{i}="Eleven" then clean{i}="11";
if clean{i}=" " then clean{i}=".";
if clean{i}="Fire Fox" then clean{i}="Firefox";
if clean{i}="Gogle" then clean{i}="Google";
if clean{i}="Yohoo" then clean{i}="Yahoo";
if clean{i}="99" then clean{i}=".";
if clean{i}="Linked In" then clean{i}="LinkedIn";
end;
drop i;
run;
Log is as follows:
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
61
62 data clean.cleansurvey;
63 array clean{*} preferred_browser read_news online_shopping online_gaming facebook twitter other_social_network;
64 do i = 1 TO dim(clean);
65 if clean{i}="Eleven" then clean{i}="11";
66 if clean{i}=" " then clean{i}=".";
67 if clean{i}="Fire Fox" then clean{i}="Firefox";
68 if clean{i}="Gogle" then clean{i}="Google";
69 if clean{i}="Yohoo" then clean{i}="Yahoo";
70 if clean{i}="99" then clean{i}=".";
71 if clean{i}="Linked In" then clean{i}="LinkedIn";
72 end;
73 drop i;
74 run;
NOTE: Character values have been converted to numeric values at the places given by: (Line):(Column).
65:15 65:29 66:15 66:24 67:15 67:31 68:15 68:28 69:15 69:28 70:15 70:25 71:15 71:32
NOTE: Invalid numeric data, 'Eleven' , at line 65 column 15.
NOTE: Invalid numeric data, 'Fire Fox' , at line 67 column 15.
NOTE: Invalid numeric data, 'Gogle' , at line 68 column 15.
NOTE: Invalid numeric data, 'Yohoo' , at line 69 column 15.
NOTE: Invalid numeric data, 'Linked In' , at line 71 column 15.
NOTE: Invalid numeric data, 'Eleven' , at line 65 column 15.
NOTE: Invalid numeric data, 'Fire Fox' , at line 67 column 15.
NOTE: Invalid numeric data, 'Gogle' , at line 68 column 15.
NOTE: Invalid numeric data, 'Yohoo' , at line 69 column 15.
NOTE: Invalid numeric data, 'Linked In' , at line 71 column 15.
NOTE: Invalid numeric data, 'Eleven' , at line 65 column 15.
NOTE: Invalid numeric data, 'Fire Fox' , at line 67 column 15.
NOTE: Invalid numeric data, 'Gogle' , at line 68 column 15.
NOTE: Invalid numeric data, 'Yohoo' , at line 69 column 15.
NOTE: Invalid numeric data, 'Linked In' , at line 71 column 15.
NOTE: Invalid numeric data, 'Eleven' , at line 65 column 15.
NOTE: Invalid numeric data, 'Fire Fox' , at line 67 column 15.
NOTE: Invalid numeric data, 'Gogle' , at line 68 column 15.
NOTE: Invalid numeric data, 'Yohoo' , at line 69 column 15.
NOTE: Invalid numeric data, 'Linked In' , at line 71 column 15.
NOTE: Invalid numeric data, 'Eleven' , at line 65 column 15.
NOTE: Invalid numeric data, 'Fire Fox' , at line 67 column 15.
NOTE: Invalid numeric data, 'Gogle' , at line 68 column 15.
NOTE: Invalid numeric data, 'Yohoo' , at line 69 column 15.
NOTE: Invalid numeric data, 'Linked In' , at line 71 column 15.
NOTE: Invalid numeric data, 'Eleven' , at line 65 column 15.
NOTE: Invalid numeric data, 'Fire Fox' , at line 67 column 15.
NOTE: Invalid numeric data, 'Gogle' , at line 68 column 15.
NOTE: Invalid numeric data, 'Yohoo' , at line 69 column 15.
NOTE: Invalid numeric data, 'Linked In' , at line 71 column 15.
NOTE: Invalid numeric data, 'Eleven' , at line 65 column 15.
NOTE: Invalid numeric data, 'Fire Fox' , at line 67 column 15.
NOTE: Invalid numeric data, 'Gogle' , at line 68 column 15.
NOTE: Invalid numeric data, 'Yohoo' , at line 69 column 15.
NOTE: Invalid numeric data, 'Linked In' , at line 71 column 15.
preferred_browser=11 read_news=11 online_shopping=11 online_gaming=11 facebook=11 twitter=11 other_social_network=11 i=8 _ERROR_=1
_N_=1
NOTE: The data set CLEAN.CLEANSURVEY has 1 observations and 7 variables.
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
75
76 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
89