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.

826 Publishing <strong>SAS</strong> Formats 4 Chapter 28CharacterHow to Represent) %str(%))%str( )1 Only leading blanks require the %STR function, but you should avoid using leading blanks indirectory names.2 Asterisks (*) are allowed in UNIX directory names. Asterisks are not allowed in Windowsdirectory names. In general, avoid using asterisks in directory names.Here are some examples of directory names with special characters:Table 28.7Examples of Special Characters in Directory NamesDirectoryCode Representationc:\temp\Sales(part1)c:\temp\Drug "trial" Xc:\temp\Disc’s 50% Yc:\temp\Pay,Emp=Zc:\temp\Sales%str(%()part1%str(%))c:\temp\Drug %str(%")trial(%str(%") Xc:\temp\Disc%str(%’)s 50%str(%%) Yc:\temp\Pay%str(,)Emp%str(=)ZTeradata PermissionsBecause functions are associated with a database, the functions inherit the accessrights of that database. It could be useful to create a separate shared database <strong>for</strong>scoring functions so that access rights can be customized as needed. In addition, topublish the scoring functions in Teradata, you must have the following permissions:CREATE FUNCTIONDROP FUNCTIONEXECUTE FUNCTIONALTER FUNCTIONTo obtain permissions, contact your database administrator.Format Publishing Macro Example%indtdpf;%let indconn server="terabase" user="user1" password="open1" database="mydb";%indtd_publish_<strong>for</strong>mats(fmtcat= fmtlib.fmtcat);This sequence of macros generates a .c and a .h file <strong>for</strong> each data type. The <strong>for</strong>matdata types that are supported are numeric (FLOAT, INT), character, date, time, andtimestamp (DATETIME). The %INDTD_PUBLISH_FORMATS macro also produces atext file of Teradata CREATE FUNCTION commands that are similar to these:CREATE FUNCTION sas_put(d float, f varchar(64))RETURNS varchar(256)SPECIFIC sas_putnLANGUAGE CNO SQLPARAMETER STYLE SQLNOT DETERMINISTIC

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

Saved successfully!

Ooh no, something went wrong!