Here's a tutorial on using Arrays in SAS https://stats.idre.ucla.edu/sas/seminars/sas-arrays/
You need arrays to process multiple variables in the same fashion.
data want;
set have;
array myvars(3) col1-col3;
do i=1 to dim(myvars);
if myvars(i) in ('somewhat negative', 'extremely negative') then myvars(i) = 'negative';
end;
run;
@JibJam221 wrote:
Hi everyone,
im looking for an efficient way to replace values in a table in a SAS work.library. This data was imported from excel, and there are many variables in multiple columns that im looking to change. For example:
in column1, column2, column3, I would like to replace their values from "somewhat negative" and "extremely negative" to simply "negative".
Any ideas?
thanks!
... View more