proc sql; /*1*/ create table work.bonus as /*2*/ select EmpId, Jobcode, Salary, /*3*/ Salary*.10 as Bonus /*4*/ from certadv.empdata /*5*/ order by JobCode, Salary; /*6*/ quit;
1 | The SQL procedure retrieves data from tables or views to generate a report. |
2 | The CREATE TABLE statement creates the temporary table Work.Bonus from the query result of the current PROC SQL query. |
3 | The SELECT statement retrieves the EmpId, Jobcode, and Salary columns and displays the column values in the query result. |
4 | The SELECT statement also creates a column alias by using the AS keyword followed by the column name of Bonus. The value of Bonus is 10% multiplied by the value of Salary. |
5 | The FROM clause specifies Certadv.Empdata as the source table to be queried. |
6 | The ORDER BY clause specifies to sort the rows by the values of the JobCode variable first and then Salary. |
3.147.65.247