General form, CREATE
VIEW statement:
CREATE VIEW proc-sql-view AS
SELECT column-1<,
... column-n>
FROM table-1 | view-1<,
... table-n | view-n>
<optional
query clauses>;
|
proc sql;
create view sasuser.faview as
select lastname, firstname, gender,
int((today()-dateofbirth)/365.25) as Age,
substr(jobcode,3,1) as Level,
salary
from sasuser.payrollmaster,
sasuser.staffmaster
where jobcode contains 'FA' and
staffmaster.empid=
payrollmaster.empid;
1 proc sql;
2 create view sasuser.faview as
3 select lastname, firstname, gender,
4 int((today()-dateofbirth)/365.25)
5 as Age,
6 substr(jobcode,3,1) as Level,
7 salary
8 from sasuser.payrollmaster,
9 sasuser.staffmaster
10 where jobcode contains 'FA' and
11 staffmaster.empid=
12 payrollmaster.empid;
NOTE: SQL view SASUSER.FAVIEW has been defined. |
proc sql; select * from sasuser.faview;