13.07.2015 Views

SAS/ACCESS 9.2 for Relational Databases: Reference, Fourth Edition

SAS/ACCESS 9.2 for Relational Databases: Reference, Fourth Edition

SAS/ACCESS 9.2 for Relational Databases: Reference, Fourth Edition

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

188 SQL_FUNCTIONS= LIBNAME Option 4 Chapter 10Variable Required* Optional**CONVERT_ARGSSENGINEINDEX* An error results when a value is missing.** For new and existing functions.Read-Only**XXValid ValuesMust be set to 0<strong>for</strong> a newly addedfunction.Must remainunchanged <strong>for</strong>existingfunctions. Set to0 <strong>for</strong> a newlyadded function.ExamplesYou can use EXTERNAL_APPEND= to include one or more existing functions to thein-memory function list and EXTERNAL_REPLACE= to exclude them. In this examplethe DATEPART function in a <strong>SAS</strong> data set of Oracle functions by appending thefunction to an existing list of <strong>SAS</strong> functions:proc sql;create table work.append as select * from work.allfuncs where sasfuncname=’DATEPART’;quit;libname mydblib oracle sql_functions="EXTERNAL_APPEND=work.append"sql_functions_copy=saslog;In this next example, the equivalent Oracle functions in a <strong>SAS</strong> data set replace all<strong>SAS</strong> functions that contain the letter I:proc sql;create table work.replace as select * from work.allfuncs where sasfuncname like ’%I%’;quit;libname mydblib oracle sql_functions="EXTERNAL_REPLACE=work.replace"sql_functions_copy=saslog;This example shows how to add a new function:data work.newfunc;<strong>SAS</strong>FUNCNAME = "sasname";<strong>SAS</strong>FUNCNAMELEN = 7;DBMSFUNCNAME = "DBMSUDFName";DBMSFUNCNAMELEN = 11;FUNCTION_CATEGORY = "CONSTANT";FUNC_USAGE_CONTEXT = "WHERE_ORDERBY";FUNCTION_RETURNTYP = "NUMERIC";FUNCTION_NUM_ARGS = 0;CONVERT_ARGS = 0;ENGINEINDEX = 0;

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!