General form, basic
PROC SQL step to perform a query:
PROC SQL;
SELECT column-1<,...column-n>
FROM table-1|view-1<,...table-n|view-n>
<WHERE expression>
<GROUP
BY column-1<,
... column-n>>
<ORDER
BY column-1<,...
column-n>>;
PROC SQL
invokes the SQL procedure
SELECT
specifies the column(s)
to be selected
FROM
specifies the table(s)
to be queried
WHERE
subsets the data
based on one or more conditions
GROUP BY
classifies the data
into groups based on the specified column(s)
ORDER BY
sorts the rows that
the query returns by the value(s) of the specified column(s).
|
proc sql; |-select empid,jobcode,salary, | salary*.06 as bonus |----from sasuser.payrollmaster |----where salary<32000 |----order by jobcode;
proc sql; select empid,jobcode,salary, salary*.06 as bonus from sasuser.payrollmaster where salary<32000 order by jobcode; |
|