/*udate*/
data emp_sal;
input eid salary sale;
cards;
234 2300 675
245 2400 560
456 8900 567
123 3000 345
236 4000 456
278 5345 523
345 6000 321
111 4500 256
187 4326 390
;
proc sql;
update emp_sal
set salary=salary+ case when sale>500 then 2000
when sale>350 and sale<500 then 2000
else 1000 end;
quit;
/*modify*/
/*adding variable*/
proc sql;
alter table emp_sal
add newsalary num,rating char(6);
quit;
/*upload variables*/
proc sql;
update emp_sal
set newsalary=salary+ case when sale>500 then 2000
when sale>350 and sale<500 then 2000
else 1000 end;
update emp_sal
set rating=case when sale>500 then 'a+++'
when sale>350 and sale<500 then 'a++'
else 'a+' end;
quit;
proc sql;
alter table emp_sal
drop newsalary,rating;
quit;
proc sql;
delete from emp_sal where sale<=350;
quit;
proc sql;
delete from emp_sal;
quit;
No comments:
Post a Comment