?? bpg34r01.sas
字號:
/****************************************************************/ /* S A S S A M P L E L I B R A R Y */ /* */ /* NAME: BPG34R01 */ /* TITLE: SAS PROCEDURES GUIDE: chapter 34 */ /* PRODUCT: BASE */ /* SYSTEM: ALL */ /* KEYS: DOC CREATE TABLE INSERT ALTER SELECT VIEW WHERE */ /* UPDATE SET IN ORDER BY */ /* PROCS: SQL */ /* DATA: */ /* */ /* SUPPORT: UPDATE: */ /* REF: SAS PROCEDURES GUIDE, CHAPTER 34 */ /* MISC: */ /* */ /****************************************************************/options ls=72 ps=60 ;proc sql;create table salaries(type=data label='Salaries Table', lastname char(14), fname char(10), ssnumber num format=SSN11., salary num label='Monthly Salary' format=dollar10.2, annsal num label='Annual Salary' format=dollar10.2);insert into salaries values('Conway','Kathryn',224223312,4325,51900) values('Schneyer','Samantha',321538796,1275,15300) values('Stein','Joel',323093467,3211,38532) values('Rodriguez','Jose',123994563,3356,40272) values('Johnston','Lois',276116745,2444,29328) values('Wong','William',321684532,1798,21576) ;title 'Salaries Table';select * from salaries;proc sql;create table altertab as select * from salaries;alter table altertab add gender char(1);title 'Altertab Table';select * from altertab;proc sql;create view midsals asselect lastname, fname, ssnumber from salaries where salary>2000 and salary<3999.99;title 'Middle-Range Salaries View';select * from midsals;proc sql;create table saltemp asselect * from salaries;delete from saltemp where annsal<20000;title 'Temporary Saltemp Table';select * from saltemp;proc sql;title 'Employees with Midrange Salaries';select lastname, fname, ssnumber from salaries where salary>2000 and salary<3999.99 order by lastname;proc sql;create table updated asselect * from salaries;update updated set salary=salary*1.1 where salary<2000;update updated set annsal=salary*12 where salary<2000;title 'Updated Table with Raises';select * from updated order by salary;proc sql;update altertab set gender='F' where lastname in ('Conway','Schneyer','Johnston');update altertab set gender='M' where gender is missing;title 'Altertab Table';select lastname, fname, gender, ssnumber, salary, annsal from altertab;quit;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -