libname orion "/folders/myshortcuts/SasData/sql";
Make a copy of orion.sales
proc sql;
create table sales as
select *
from orion.sales
;
quit;
proc sql;
update work.Sales
set Salary=Salary * 1.05
where Job_Title = "Sales Rep. I";
quit;
If Current Job Title Ends in | The New Level Is |
---|---|
I | Apprentice |
II | Journeyman |
III | Master |
IV | Mentor |
proc sql;
create table Staff as
select *, "" as Level length=10
from sales
;
reset outobs=25;
select job_title,level from staff
;
quit;
proc sql;
update work.Staff
set Level=
case (scan(Job_Title,-1))
when 'I' then 'Apprentice'
when 'II' then 'Journeyman'
when 'III' then 'Master'
when 'IV' then 'Mentor'
else ''
end;
reset outobs=25;
select Employee_ID, Job_Title, Level
from work.Staff;
quit;
proc sql;
create table staff as
select *
from prg1.employee_payroll
;
quit;
proc sql;
select count(*)
from staff
where employee_term_date is not missing
;
select count(*)
from staff
;
quit;
proc sql;
delete from Staff
where Employee_Term_Date is not missing
;
quit;
proc sql;
select count(*)
from staff
;
quit;