Syntax, PROC SQL statement:
PROC SQL <option(s)>;
option(s)
names the option(s)
to be used.
|
Desired Result
|
Option
|
---|---|
Restrict the number
of input rows.
|
INOBS=
|
Restrict the number
of output rows.
|
OUTOBS=
|
Specify whether PROC
SQL prints the query’s result.
|
PRINT | NOPRINT
|
Include a column of
row numbers.
|
NUMBER | NONUMBER
|
Desired Result
|
Option
|
---|---|
Specify the names of
columns to be kept.
|
KEEP=
|
Specify the names of
columns to be dropped.
|
DROP=
|
Specify the last observations
that SAS processes in a data set.
|
OBS=
|
Change the name of a
variable.
|
RENAME=
|
proc sql inobs=5;
select *
from certadv.mechanicslevel1;
quit;
WARNING: Only 5 records were read from CERTADV.MECHANICSLEVEL1 due to INOBS= option.
proc sql outobs=10;
select *
from certadv.payrollmaster
order by Salary desc;
quit;
WARNING: Statement terminated early due to OUTOBS=10 option.
proc sql inobs=10 number;
select flightnumber, destination
from certadv.internationalflights;
quit;