PROC FedSQL
|
PROC SQL
|
---|---|
Complies with ANSI standard
3.
|
Follows ANSI standard
2.
|
Processes 17 ANSI data
types.
|
Is limited to SAS data
types (numeric or character).
|
Provides vendor-neutral
ANSI SQL.
|
Provides SAS SQL implementation.
|
Is fully multi-threaded
on the SAS Platform.
|
Is multi-threaded for
sorting and indexing on the SAS Platform.
|
Includes very few non-ANSI
SAS enhancements.
|
Includes many non-ANSI
standard SAS enhancements.
|
Syntax, PROC FEDSQL
step:
PROC FedSQL;
SELECT col-name ;FROM input-table
<WHERE clause>
<GROUP
BY clause>
<HAVING clause>
<ORDER
BY clause>
QUIT;
|
Syntax, PROC FedSQL
step:
LIBNAME libref-engine <SAS/ACCESS-engine-options>;
PROC FedSQL;
SELECT col-name ;FROM input-table
<WHERE clause>
<GROUP
BY clause>
<HAVING clause>
<ORDER
BY clause>
QUIT;
|
libname market oracle user=cert password=student path=localhost schema=Analyst; proc fedsql; select State, count(*) as TotalCustomer format=comma14. from market.customer where CreditScore > 650 group by State order by TotalCustomer desc; quit;
Syntax, LIMIT clause:
LIBNAME libref-engine <SAS/ACCESS-engine-options>;
PROC FedSQL;
SELECT col-name ;FROM input-table
<LIMIT {count}>
QUIT;
count
specifies the number
of rows that the SELECT statement returns.
Tip count can
be an integer or any simple expression that resolves to an integer
value. |
libname certadv v9 'C:UsersStudentcertadv';
proc fedsql;
select State, Census_Apr2010, PopEst_Apr2018
from certadv.census
order by State
limit 10;
quit;
Syntax, PUT function:
LIBNAME libref-engine <SAS/ACCESS-engine-options>;
PROC FedSQL;
SELECT col-name <PUT(col-name, format) as col-name> ;FROM input-table
QUIT;
col-name
identifies the variable
or constant whose value you want to reformat.
format
contains the SAS or
FedSQL format that you want applied to the variable or constant that
is specified in the source.
|
libname certadv v9 'C:UsersStudentcertadv'; proc fedsql; select SalesRep, put(Sales1, dollar10.2), put(Sales2, dollar10.2), put(Sales3, dollar10.2), put(Sales4, dollar10.2) from certadv.qsales; quit;
libname certadv v9 'C:UsersStudentcertadv'; proc fedsql; select SalesRep, put(Sales1, dollar10.2) as Sales1, put(Sales2, dollar10.2) as Sales2, put(Sales3, dollar10.2) as Sales3, put(Sales4, dollar10.2) as Sales4 from certadv.qsales; quit;