11-09-2016 09:41 AM
How can i convert a sql code to data step.
update table1 t1
set name = (select t2.name from work.table2 t2
where t1.value > t2.value_min and t1.value <= t2.value_max);
11-09-2016 09:48 AM
Why do you need to, seems like perfectly good SAS procedure SQL to me? The datastep version will be longer as you can only merge on variables, not between ranges. Anyways, post test data of your have tables (in the form of a datastep) as we have nothing to base code one. The simplest way I can think of offhand is to create a format based on table2 and then put the value from table1 into that format.