Hi all
I am trying to change a string throughout a whole dataset. I know i could do case when statements but there are to many variables. I am trying to use an array but i can quite get it to work, code below. Could anyone help please. Thanks
data data2;
set data;
array s _char_;
do _n_=1 to dim(s);
if s(_n_)="Timed" then (s(_n_)="Time");
end;
run;
Edit to add data there are about 50 of the St columns
Num | rate | rate st | rate2 | rate2 st |
1 | 0.1 | Timed | 0.1 | Timed |
2 | 0.2 | New | 0.2 | New |
3 | 0.5 | Unchanged | 0.5 | Unchanged |
4 | 0.1 | New | 0.1 | Timed |
5 | 0.1 | Unchanged | 1 | Unchanged |
6 | 0.2 | Timed | 0.2 | Timed |
7 | 0.5 | Timed | 2 | New |
8 | 0.1 | Timed | 0.1 | Unchanged |
9 | 0.5 | Timed | 0.5 | Timed |
10 | 0.1 | New | 2.5 | New |
11 | 0.1 | Unchanged | 0.1 | Unchanged |