I originally had my data look like this
if index(upcase(tests), 'HEP') then Hepcheck = 1;
else if index(upcase(tests), 'HBSAG') then HEpCheck = 1;
else if index(upcase(remarks), 'HEP') then Hepcheck = 1;
else if index(upcase(remarks), 'HBSAG') then HepCheck = 1;
else Hepcheck = 0;
I tried to condense the code:
data program.ds2054;
set sheet.ds2054;
if index(upcase(tests), 'HEP C' or 'HEPATITIS C') then hepcheck = 0;
else if index(upcase(tests), 'HEP' or 'HBSAG' or 'HBV') then Hepcheck = 1 ;
Else if index(upcase(remarks), 'HEP C' or 'HEPATITIS C') then hepcheck =0;
Else if index(upcase(remarks), 'HEP' or 'HBSAG' or 'HBV') then hepcheck =1;
else Hepcheck = 0;
However I get this error now and no data shows up even though i had a lot of data the other way
NOTE: Character values have been converted to numeric values at the places given by: (Line):(Column).
71:38 71:49 72:43 72:52 72:63 73:32 73:43 74:32 74:41 74:52 75:44 75:55 76:44 76:53 76:64
80:39 80:53 81:32 81:46 82:42 82:56
NOTE: Numeric values have been converted to character values at the places given by: (Line):(Column).
71:46 72:60 73:40 74:49 75:23 75:52 76:23 76:61 80:50 81:43 82:22 82:53
NOTE: Variable OtherClassBDetails is uninitialized.
NOTE: Invalid numeric data, 'HEP C' , at line 71 column 38.
NOTE: Invalid numeric data, 'HEPATITIS C' , at line 71 column 49.
NOTE: Invalid numeric data, 'HEP' , at line 72 column 43.