hello everyone,
first of all: IT'S WORKING 🙂 great!!! thank you so much!
(a side-question: how can I post my code here in Courier and not in the Arial font? the code looks so poor in Arial)
I needed a macro because there are more than one table of this type in the project, but I mixed all solutions to one, the final one, this one:
/************** CODE BEGIN *********************/
proc SQL noprint;
select NAME into :toBON separated by ' ' from Merk where METHODE eq 'S%';
quit;
/* translate S% values into BON19 values */;
%macro S2BON19( strDataSet );
data &strDataSet;
modify &strDataSet;
array s
8 &toBON;
/* Checking method */
do _i_=1 to dim( s );
if not MISSING( s[_i_] ) then do;
if 0 le s[_i_] le 10 then s[_i_]=1;
else if 10 lt s[_i_] le 20 then s[_i_]=2;
else if 20 lt s[_i_] le 30 then s[_i_]=3;
else if 30 lt s[_i_] le 40 then s[_i_]=4;
else if 40 lt s[_i_] le 50 then s[_i_]=5;
else if 50 lt s[_i_] le 60 then s[_i_]=6;
else if 60 lt s[_i_] le 70 then s[_i_]=7;
else if 60 lt s[_i_] le 80 then s[_i_]=8;
else if 80 lt s[_i_] then s[_i_]=9;
end;
end;
replace;
run;
%mend;
/********************* CODE END **********************/
and best is: I even understand that code now 🙂
thank you soooooo much, you saved my day 🙂
Tom