1. Trang chủ
  2. » Công Nghệ Thông Tin

sas odbc driver 9 1 pot

60 170 0
Tài liệu được quét OCR, nội dung có thể không chính xác
Tài liệu đã được kiểm tra trùng lặp

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Tiêu đề SAS ODBC Driver 9.1 Pot
Trường học Sample University
Chuyên ngành Computer Science
Thể loại Thesis
Năm xuất bản 2023
Thành phố Hanoi
Định dạng
Số trang 60
Dung lượng 3,21 MB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

Detning Your Data Sources Tnteduetion to Defining Data Sources [i] “Accesing the SAS ODBC Driver Dialog Boxes] Setting Up Your Data Source Defining Servers a Defining Data Libravies Savi

Trang 1

GSAS | srw

SAS ODBC Driver 9.1

User's Guide and Programmer's Reference

The Power to Know

Trang 2

The correct bogrphl tation the manual ea lows: SAS Inetitte Ine 2005, SASS ODAC Drier ls Users Gude and Programmers Reference Cary, NC: SAS SAS" ODBC Driver 1: User's Gul and Programmer's Reference

‘Copyrahe © 2004, 848 Isitute Ine, Cary, NC, USA

ISBN 180007302

‘ay be epredced stored i a atfievl temo ranahlErb la any ym oy a

"mang sietUenlt mrchhnie pia0zofving or therwine, without the pr wnien

US Government Restricted Rights Notice Use, upliation, or dssear ot

‘oftware and related dreunentton bythe U.S, governments ti <1 the AaeeBenL van Resetdod tght une 1987

SAS Iai Ine, SAS Campus Drs, Cary Norh Canlln 38618,

ee pnting, January 2008

{SAS Publishing provides a crap cetion of books and electric produ to bap

‘books elearning product, CDs, and hard-opy books, vit the SAS Publishing Web ste T5 eupontrae.cotipubv cll 809157 G808

‘SAS® and all ater Sranademarkr sf SAS Inaftte Ine in'he USA and eho eountrics indent USA SAS Inet Inc producto service names ate reitred trademarks elton

Trang 3

Contents

Chapter 14 Introducing the SAS 008C Oriver

Overview: The SAS ODBC Driver {]

What fe opBC?

What I the SAS ODBC Dever? 6

‘Types of Data Accnsed with the SAS ODBC Deiver

Understanding SAS

What Softeare DoT Need?

Chapter 2A Detning Your Data Sources

Tnteduetion to Defining Data Sources [i]

“Accesing the SAS ODBC Driver Dialog Boxes]

Setting Up Your Data Source

Defining Servers a

Defining Data Libravies

Saving a Data Source DeBnion B]

Modifying a Data Source Deisition B3]

‘Specifying a Different Server fora Defined Dat

Deleting a Data Source Dotition [BỊ]

Chaplar 9 Using the SAS 008C Orver (3)

Totducion to Using the SAS ODBC Driver

‘Accessing Your Data Sources 25)

Prerequisite for Communications

Other Important Usage Infomation

chapter ¢ 2 PosammersReteence BS] Inti athe Programmer Referee

Siyprt fran inplomentatin of OBB Functions [BỊ

—— veered Data yes]

rer Spee Ql Options]

Scrip Notes on Windowe NT, Windows 200, and Windows XP)

SAS ODBC Driver Enor Coles ES)

‘Appendix A Return Codes and Associated Messages [5]

SAS ODBC Driver Retwen Codes [2]

$1000 Comminicstins Access Method Errore]

TTCPMP Winsock Retuen Coder (i)

Appendix 2 A, Recommended Reading

Trang 5

Overview: The SAS ODBC Driver

‘This book documents SAS 9.1 ofthe SAS ODBC driver I you ae using the Version 8 river, yon should see SAS ODBC Driver Urs Guide and Programmer's Reference ion 8

“Thí book ie intended fr thnee audiences

“This book assumes that you are fanliar with the Microsoft Windows NT, Windows

2000, or Windows KP operating environments and that you know how tose a mouse And Lesard to perform common Windows tasks,

Trang 6

What Is ODBC?

‘ODBC stands for Open Datahase Connectivity Ii an interfae standant that provides a common application programming interface (API) to access databases, Many oftware products that run in the Windows operating environment adhere to thie Standard to tht you ean access data that other software has created,

“ODBC functionality is provided by three main eotponents

15 the elient application

1 the ODBC driver manager

1 the ODBC driver,

Figure 11 on page displays components of ODBC functionality The ODBC driver anager, which was developed by Micros, manages the interaction between a client pplication and one or more ODBC drivers,

What Is the SAS ODBC Driver?

‘Tho SAS ODBC driver isan implementation of the ODBC standard that enables you

to access, manipulate, and update SAS datasources from applications that are ODBC fompliant As Figure 1.1 ex page 3 shows, the SAB ODBC driver uses @ SAB server to

‘access data from your SAS data sources Tho SAS server ean be either a local, eonified SAS seston or a remote SASSHARE server (See “SAS Server” on page 6 for more Information.) If you use ether ODBC drivers (such as those for ORACLE or SQL Server) to access other datn sources, chose drivers might require additional software fomponents

Note: To acwess ODBC data sources from within SAS the opporite of what the SAS (ODBC driver enables you to assomplish, you mist eense the SASIACCESS interface

to ODBC, For additional information see SAS/ACCESS for Relational Database Rejerene

Trang 7

Figue 1.41 Component 100 FuleeMt/

(ODBC) Application

‘opac Driver Manager

Types of Data Accessed with the SAS ODBC Driver

Jn Figure 1.1 on page 9 and elsewhere throughout this document, the term SAS datasources ie sed to describe data seurees that ou have defined ia the SAS ODBC Ariver These ean incide SAS datasets, Rat files, and VSAM files, as well ax data from

‘many database management systems (DBMS) through tho use of SAS/ACCESS faftware (See SAS Data Seta” on page 6 for details)

your personal sompuler le cônneriel lo a TOEITP network, you ean neces both local data sources and remote data sources, (Seo "What Software Do 1 Need?” om page 8 {or information abot software requirements) Lava! data is data that yow aces through a SAS server on your local machine The data ean be stored either on Your computer’ hard drive or on a network le system such as-a Netware or Windows NT

Trang 8

le server that makos the physic! location ofthe data transparent to applications emote data is data that you access through a SASSHARE server that uns on another (remote) machine

"The ability to use the SAS ODBC driver in conjunction with SASACCESS software

as a gatoway to DBMS data is particlarly usefal under any ofthe fllowing

1 There is no ODBC driver available for the DEMS In thie situation, sou can use the SAS ODBC driver in cnjunetion with SAS/ACCESS on the SAB server 10

‘connect to the DBMS

1 You do not licen the necesary software either an ODBC driver forthe DBMS oF DIIMS network access eoftware) on sour eient machine

5 You want to join or merge DBMS data with other da

‘Currently, SASIACCESS software i

ble forthe following systems, nehuding

For information about the individual SAS/ACCESS interfaces, ceo "Recommended Roading” on page 48

Trang 9

Understanding SAS

‘Touse the SAS ODBC driver, you should understand three components of SAS:

5 SAS data sate

12 SAS date libraries SAS servers,

‘You should also understand how ODBC terminology corresponds to SAS terminology

‘See “SAS Terainology” on page & for more details,

SAS Data Sets

[AAS data set is le structed in a format that SAS can aosse, The physical objet contains

1 data values that ane stored in tabulae form

© a descriptor portion that defines the types of data to SAS,

'SAS data views ane deGnitions or descriptions of data tha resides elsewhere They

‘enable sou to use SAS to acess many different datasource, nckuding flat es, VSAM files, and DEMS structues, as well as native SAS dats files” A data view eliminates the need wo know anything about Ube structure of the data or the software that ereated ite Data views take up very hte storage because they contain no data They aso

‘access the most current data from their defined sources because they collet the seta data values only when called

"You ean use data views to define subsets of larger structures, or supersets of data

‘hat have Been enhanced with ealenated values You can alo create SAS data views that combine views of dissimilar datasources For example, you can combine a view of

‘relational DB2 table witha view of a SAS data Ble, a view of hieraehiealIMS-DLA

‘lata, or even a view from a PC-based BASE Be,

"You create SAS dala views in three ways

15 with the DATA step (DATA step views)

1 with the SQ procedure (PROC SQL sews)

© with the ACCESS procedure (SAS/ACCESS views)

‘ou ean also use SAS/ACCESS software to work directly with DEMS tables such a8 DDB and ORACLE, a if they were SAS datasets and ewe by sng the SASVACCESS LIBNANE statement See SAS/ACCESS for Relational Databases! Reference for more

'For more information about how to ereate and use DATA step views, se the

‘chapter “SAS Data Views” in SAS Language Refrence: Concept, PROC SQL views

Trang 10

{efi cithor a subset or a superset of data from one or more SAS data ets These datasets canbe files or views, and can incu data sets composed of DBMS data that are ereated withthe SAS/ACCESS LIENAME statement and views that are

‘rented with the PROC SQI Past-Throwgh Facility to aoeoss DBS data You ean

0 construct PROC SQL views of DBMS data by wring an embedded LIBNAME

or example, the SQL procedure can combine data from PROC SQL views, DATA step views, and SASJACCESS views with data in SAS data Ble You

‘annot use PROC SQI views to update the data inthe views underlying fles or tables, However, with come restrictions, you can use the UPDATE, DELETE, and INSERT statements in the SQL procedure to update data that is deseribed by SASIACCESS views

For information about the PROC SQL Pass-Through aii see the chapter

“the SQL Prose” in Base SAS Procedures Guide, or SASTACCESS for

Relational Databases: Reference

For nore information about view descriptors, se SASJACCESS for Relational Databaee: Reference

SAS Data Libraries

‘SAS data sets are contained in data libraries Bach SAS data library has two

‘names: a piysical name and a lopial name (II The physieal nam€ of the brary fully identifies the directory or operating system data strutane that contains the data sets Therefore, the phyical name must conform tothe rues Tor naming Biles wii your operating system,

‘You use the libre to identify a group of datasets (les oF views) within SAS The bef isa temporary name that you associate with the physical name ofthe SAS data [brary during each SAS job or seeson After the Uhre assigned, yo can read, reat oF update Biles in the data Hhrr, A iret wali only for the erent SAS job lrsescion and you can reference it repeatedly within that jb or session

‘You ea also use SAS/ACCESS software to associate a SAS ibref with a DBMS Aatabase, schema, sever or group of tables and views, such a4 a DB2 database oF trop of ORACLE tables nnd views, Seo SAS/ACCESS for Relational Databases Feference for more information about using SASIACCESS software,

For mote information about SAS data libraries, ce the chapter SAS Data Libraries”

Jn SAS Language Refrence: Concept

Trang 11

{rom tho SAS ODBC driver on behalf of the applications that are ODBC compliant

‘While the server is running, the SAS session dees not accep input from the Keyboard Note: Boginning with Version 7 of SAS, the SAS ODBC driver uses the TCPAP protocol to communicate with both lea servers and mhmote SASSHANE servers Support forthe DDE protocol has been dseontinued Thorofore, you should reconfigure your driver settings @ change any DDE (aca or network) servers to TCPAP servers, as

“eserbed in “Converting DDE Server to TOP Servers” an page 7

‘The type of server that the driver uses depends on whether you are accessing Ioeal Ada oF remote data

leeal dats

“The driver uses a SAS ODBC server to acess your data Ifyou do not already have a SAS session running on sour computer, the driver stats a SAS seston and

‘executes PROC ODBCSERY, thereby automatically starting the server when you

‘once to Your laeal data source See “Accessing Local SAS Data Sources" on page 26 for more information, If you have SAS session (bul nota SAS ODBC server) running on your computer, then You must either stat the SAS ODEC server

‘manually oF ond the SAS session before you eannect to your SAS data coureae (except under Windows NT, which supports muliple concurrent SAS sessions) See "Starting a SAS ODBC Server" on page 26 for detail

remote data

“The driver uses a SAS/SHARE sorvor This rquires that you licens the

SASSHARE software on the rot host, The driver also requires TCPIP

software that is included with your operating environment to communicate with the server Your server administrator uses PROC SERVER to start the server on your remote host See “Accessing Remote (SASSHARE) Data Sources" on page 27 for more information

‘using the LIBNAME statement engine option in either SAS or SPD server

Scalable Performance Data Server

‘The Scalable Performance Data (SPD) server utilizes the latest parallel processing

‘metheds and data server eapabilities to efficiently acees large volmes of data and Serve large numbers of coneurrest users I provides ellcient data cams for hundeeds

of users across multiple processors,

‘The SPD server allows aceees to SAS data for intensive processing (queries and sorts)

fn the host Server machine Ie organizes and processes SAS data to take advantage of parallel processors on specie host servers ‘The SPD SNET server handles communication between SAS clients and an SPD server You must have the SPD server licensed on your client machine Then you can Interchange SAS data and SPD server data by using the LIBNANE statement engine option either in SAS oF on the SPD server For more information, see Scalable

Performance Data Server Users Guide

Converting DDE Servers to TCP Servers

you sil use SAS sorvers that are configured fo use DDE, you must convert them

to TCP servers tn vse them with this release of the SAS ODBC driver

‘To convert a DDE (or Network DDB) server to a TCP server, perform these steps

Trang 12

`

4 Install the now SAS ODBC driver,

2 Selec the Servers tab from the SAS ODBC Driver Configuration dialog bax

4 Select tho existing DDE sorvor that you want to convert to TCP in the Servers list

to he lft of the Servers page

4 Select to verify thatthe options are correct, and then seleet [OK Note: If yon are converting from a local DDE server you need ta remove the

~conamid ge option from the SAS Startup Parameters text bo

5 Select [UBHGt| and then [OK] to store your changes [Note:_ For local TCP servers you will also have to verify that your TCP Servies Ale has an appropriate entry forthe server that you are configuring For more

information, ae “The TEPIP Servies Pile" on page 29 0

SAS Terminology

Software products often include similar components or constructs Unt are known by diferent names, For the ODBC standard and SAS, the following correspondences exist ODBC term SAS tem

ener brary name (bref thúc data set

What Software Do | Need?

‘The SAS ODBC driver runs under 42-bit Windows (Windows NT, Windows XP,

‘Windows 2000), Other software requirements depend on your hardware configuration and onthe data sours) that ye want to acest, as shown in Table 11 on pa 9 [Note:The 16-bit version (hipped with Releases 6.10, 6.11 and 6.12 of SAS) i

‘downloadable from the SAS Web site and mane rmder Windows 3.1, 12, and Windows {or Workgroups

Trang 13

Table 14 sete Roomate

Trang 15

Dating a Dota Library Dfiton 2 Mesing 9 Dla Library Dion 28 Sauing Data Sure Duin 2

Maing o Date Source Dfntion 22

‘Sing a Diforent Server for «Deed DataSource 2

Introduction to Defining Data Sources

Aer sou install the SAS ODBC driver you must provide information about the data sourets) that you want to access, Tie chapter explains how tote the SAS

‘OBC driver dialog boxes to provide the neccesary information,

From the SAS ODBC dialog baxes, you can select ep at any tne t obtain information about the active dialog box

Accessing the SAS ODBC Driver Dialog Boxes

‘To acess the BAS ODBC dialog boxes, complete theoe step:

1 Acces the Miso Windows Control Panel window hy selecting [Stare] [Settings] » [Conte Panel

Find the ODBC Data Soures or ODBC Administrator fon, Thi fon mht be Incated in the Contr Panel poup, in an ODBC poup, en i'you have inaaled a

package of other ODBC drivers, it might bein a group that i asoeiated with that package

Trang 16

` `

2 Double-lick on the icon Depending on the version of ODBC Administrator that

‘Variation in the following dialog bax:

Dist 21 0080 Data Sore Aniston

"MercsoadBee Errr D480 sees dee VPP Doe Pe) Meresot ca Droeet) MercestFexP VPP Davee

Số se as reso cess iver) NsetveuelEofoiuer NecsotVanalFo#rexver

3b gửi a now data source, select ther the User sx tab or the

and solet (83H The Create New Data Source dialog bax appears:

Trang 17

Ding Yur Date Suu eh SHS OE Dia Day Bee 13 Dplay 22 ie tow Os Sauce Dale Bo

Trang 18

Dilay23 SAS 008 Dre Conon Dg Box

‘After you have supplied all the noecssary information, slect [OKI from any page to save your data source definition Selecting (Canel! discards any new or changed

Information that you have supplied and returts yon tothe ODBC Data Source

Administrator dialog box Display 21 on page 12)

Setting Up Your Data Source

When you fist access the SAS ODRC Driver Configuration dialog box, the General

ge in the freon, ne shown in Display 23 on pane Lt Follow these steps

1 Inthe pata Source mano fold ener a namo forthe datasource that you want to acces, The name must begin with a eter, and it cannot eontain comma

Semicolons, o any of the flowing special characters: (1) (.) () 2 + = 1 8 For example, if you are defining SAS data that is stored on a machine named

‘cxe4no, you might call your data source 6A8_CTeERO Ifyou oF other sors are

‘eoncomed only with the type of data (or withthe type of application that uees that

‘data and not with where the data is stored, then you might have datasources with names le Finanee ar Eaycsl1

(Optional In the Deseription fed, supply @ description ofthe data source

"The Server Held includes a dvop-down lst that you select in order to expand the lst of defied seers The fet tine You define a data source, the Ist 8 empty

Trang 19

Cang Mac Dưa Senee 2 RmANNBgSBLtplen 1E Define one or more servers (as deseribed inthe next section), and then come back

to the General page to make a selection fom the Server list You must specify 8 server for every data source

4 nthe Records to sueter fld specify the number of rows to request frm the SASSHARE server ina single transmission, The default value is 100 and the naximum value Is $2,000

‘The size ofthe server’ teanmission buffers limits the aetual numberof owe setursed Usually ou will not change the deull value However, specifying a Tanger valve might improve performance when yo retrieve avery lange rst st

SQL options affect the interaction between the SAS ODBC dever, SAS, and

applications that are ODBC compliant The default settings forthe option’ are those

‘hat most applications that are ODBC eompliant will expect and will work best with However, you can override the defaults hy seleting any of the SQL Options listed Select the bok next tothe desired option

eve trailing baa

preserves tailing banks atthe end of character feds The default action is that fraling blanks are removed, 20 that each Meld ends in nl vale

Support VARCHAR

uses character elds that are Jonger than 80 characters to be reported as

‘ariablelengdh Held, and eauscs the trailing blanks to be removed See “Support VARCHAR Option” on page 1 for more information

cauaes SAS nuneric datatypes (ypically eported a8 SQL DOUBLE) o be

reported as SQL INTEGER, Soo “Infor INTEGER from FORMAT Option” on page {for more information,

Rotors s9utables REMARKS

aes the SAS ODBC driver to read and return the SAS dataset label foreach fata set inthe brary you are accessing (SQLTables i the name of an ODBC fanction that ean be used for this purpose.) For SAS datasets, this can

‘gative impact on performance, because each data set aust be opened

‘ad the label, Therefore, you should not selet this option unless there i

Snformation inthe label that you relly ned to fe

‘oroo_pourey-nzguineD

‘implements the UNDO_POLICY option f SAS! SQL procedare witha setting of| REQUIRED, With thie setting, INSERT or UPDATE operations that fil are undone However, this actin is performed only for operations that afect multiple

‘records: a statement thatafletsa single ecord behaves the same regardless of {he UNDO POLICY seting When UNDO POLICY=REQUIRED, the associated statoment handie(hstat) of an UPDATE or INSERT statemont must be the ony factive het against the table If another user, or an hstat within the same users

‘pplication, hasan active SELECT statement, then the UPDATE or INSERT atenent fil

Trang 20

$6 balig See 2 Chap

uss Runbers at H Places

“pects the degree of precision to use when comparing numbers See “Fuss

‘Numbers at N Places Option” on page 41 for more information By defaul, this

‘option i selected, You ean change the default valu, 12, by typing over i

‘The SAS ODBC driver uses a SAS server to acess your data sources To acces local data, the driver uses a SAS ODBC server To acess remote data it uses SANSHARE, (See “SAS Servers" on page 6 for more information.)

"This setion explains how to provide the SAS ODBC driver with necessary information about the server(s) you will be using

2 In the wane field, enter a name for the SAS server that you are defining Ifyou

‘supply a one-part name such as shet, tho SAS ODBC driver infers tha the server {local SAS ODBC server Local (Single User) appear inthe SAS Server

Trang 21

Ifyou supply a two-part name such as maehine.ehe2, the driver infors that the forver is temote SAS/SHARE (Multi-User) appears in the SAS Server Type đan"

The difference between local and remote servers ia important and can cause errors if your configuration specifies the wrang typeof server See "SAS Servers”

tn page 6 for more information

I ser access tothe server is password protected, then enter the password in the Password feld This should be the same password that wae speefed forthe Uaswe option in PROC SERVER (lor a SASSHARE server, or in PROC ODBCSERV vor local access server,

Select (COT A configu

ion dialog box appears Ifyou specified a one-part server name in the Nawe fed ofthe Servers page (isplay 2-4 on page 16), then the SAS ODBC driver infers that you ae using 8 local SAS server The Léeal Options dialog box appear

When so sesses local SAS data sơmee rom an application that je ODBC

‘compliant, the SAS ODIC driver uses the information in this dialog box to invoke

1 SAS ODRC server, provided there isn't one already running (fa SAS ODBC server is already runing, the driver finds ital conmects toi.) Bach Geld

‘ontainn default values that you ean change by typing over them,

‘This fd specifics the fully qualifled path name for the SAS executable fle (SAS.EXP) that you use to start a SAS session The default path i

r\Propran Files\SAS\SA5 System\9.1\sus exe" Irthls Feld i empty, then no atlempt ie made to start « SAS ODBC server when you connect to your data souree

TU Sad Server Hype spss" @AS/SHARE” QIEL-Unor) shew sue open woe

‘Ths BAS ODI driver queries the roi forthe creat version of SAS ‘ice tated dt uh: T nt working dry ttle Ded a the neo Doka@ud ERO Ths vale ie

Trang 22

M4 tig Soe hope?

Working Directory:

‘This fold specif the flly qualified path name for the directory that you want to use aa the SAS working dirctoy: This directory is usually where {your SAS program Sle and doraments are located The def is

Ca\Progeam FLles\SAS\SAS syston\91

‘This fold specif the paramoters that are usd to invoke SAS, The default alios are: The initilization statement (-iaststat) exceutes a SAS maem, (Geasodbe), whi in tama invokes the ODBC server The shet value is ouly fam example Te is a SAS macro parameter whose valve i ken from the

‘nam that you refed inthe Wane Held ofthe Servers page (Display 2.6 on page 16) The -tes option specifies thatthe server section should be Invoked inieouited mode, because no internetion with the server is requited,

‘The -notoge option (not shown) species thatthe SAS season wil be invoked without displaying the SAS logo and copyright information,

“The Seaeedbe macro is shipped with SAS and is found in 'SASROOT \CORE\SASMACRO \SASODEC.SAS." The SASODECSAS file csechles the SAS procedure PROC ODBCSERV

‘The SASODBC SAS Se can be modified t add additonal SAS options oF SSAS statements euch as the LIBNAME statements mentioned in Defining Libraries at Server Startup Time” on page 22 You can also specify options for PROC ODBCSERV The available options are the same as those for PROC SERVER, See SAS/SHARE User's Gud fr details

‘An additional option, LOG=QUERY, is particularly relevant for servers that ate used by the SAS ODBC driver This option eases the server to log SQL queries (By default, tse server logs update aud output operations, bul fol queries) Hene, his option is useful when you need to see the quevie thatthe server renives from am ODBC clint application

Tyour SAS seston ie installed on @ network drive a ie shared by anldgle sers, then you probably don’ want individual users to modify the SASODRCSAS file, Instead, nsers cam make their own copies ofthe fle td fan sore them in their personal libraries Ta th ca, they muat also ade the -sasautes option either to the startup Paranctors fol orto their Joeal CONFIG SAS fie to indicate the pathname forthe brary as in the following example:

For more information about SAS system options and SAS statements, se

SA Conpanlon for Mndaes

“ha Beld speeile in seconds ow lang to wait fo the lai SAS ODBC seever

to start and \o register lief, The default is 60 senna son specified two-part server name before sleting (Canta, the 'SASASHAIEE Options dialog box appears

Trang 23

Daplny 26 SAISHARE Opis isog Box

‘Supply the requested information in these eld:

‘This eld is automaticaly Aled with the alias forthe TCPMP network

‘chine name that you specified in the wane Geldof the Servers page (Display 210m page 10), Ins complex networking envionment, xn might

‘eed to cuply fall qualifed domain address forthe server or example,

prompted fora paseword at connection tie The SAS ODBC driver

Sntohadieul enerypts the password, For more information about paseword tneryption, se “Encrypting Passwords” on page 3

connect options:

‘This Geld provides additional camnection options to nse when you debe a connection that will pont to an SPD SNE server You must leave Coanoet Options ’An SPD SNET server isan intermediate component between the ODBC bank fora connection to 8 SASSHARE server ta work proper Ariver and an actal SPD server

‘Spcify the eonnertion options as name value pairs delimited by white space Each ofthe values must be in single quotation marks For example,

where:

DB is the SPD server limame domain,

HOST isthe location of the hort computer on your network whore the SPD Tame server is running

‘SERV isthe port nunber ofthe SPD name server running on the HOST

‘See the documentation shipped with the SPD server far more detail

Trang 24

Userid/Pasevord override

‘This feld requests that the UID keyword and PWD keyword be used inthe ODBC client application, The ODBC driver will pass the value af the PWD keyword the ier login patsword, ad the vale of the UID leyword a the taser ID Otheree, the driver will ee the valve ofthe PWD keyword from the sorver defnition as the authentication password For more information bout using this option, see “Useid/Pastward Override” on page 28

5 When you have finished making any necessary changes to the Local Options or SASISIARE Options dialog box, select (OK) to return tothe Servers page (Display 24 on page 16,

6 Important’ Select -2ZXKZZ| to save your server definition The server name now appears inthe list of defined servers atthe let

7 To define another server, select

Car} and then repeat step 2

Deleting a Server Definition

‘To delete previously defined server, complete these ste

1 Select the server name from the Servers list atthe left ofthe Servers nage,

2 Select SSIES) (010A:

you delete a server, then any datasources thái se that server wil ao longer be accessible ull you redeine that server =

Modifying a Server Definition

‘To change the information for a previously defined server, complete these steps:

4 Selet the server name from the Servers list at the left of the Seevers page

2 To make tho desired changes, select [Cong] to make changes in the Local Options or SASISHARE Options dialog box (Display 2.5 on page 17 and Display 2B on page 19)

The mano fold i dimmed to indicate that you cannot change the name ofthe server The reason for this is that you may have already defined data sources that tse that gerverifyou changed the server name, then you would no longer be able teracces the data sores,

2 Select [ZEUBITEZ] to eave your changes

For instructions on how wo specify a dilerent server fo a data souree that you have already defined, soo “Speifying a Different Server for a Defined Data Source™ on pane 3m

Defining Data Libraries

Each datasource ean include multiple data Ubravies (See “SAS Data Libraries" on age 6 or information | Therefore, you peovie information about each Mary that You rant to acess

"This section describes how to us the Libraries page to define your data libraries, See "Defining Libraries at Server Startup Timo” an page 22 for information about an Sltemate way of defining data bene,

Trang 25

Lệnh ar Dat Sars? Dig Daler 21 tain the SAS ODBC Driver Configuration dialog box to go 3° (Display 27 on page 21 Supply the information described

Jn the flloving steps at any pont you Want to clear all of the felds on the

ight side ofthe dialog box and start again, select (Cle

main —

KỶ Library Settings

tne sage ||[Dmpe Fame

"The SAS data Morary ean inchade SAS data files, SAS data views, oF both, Se

“SAS Data Sts" on page 5 for more information

Note: Ifyou uso an ODBC application that exports databases using one-ovel

‘ames, you wil need to define ibrary called uae A

4 Inthe most Fite fl, enter the physical name ofthe library This must bea

‘ald pathname forthe operating sytem that your dats brary it stored in For

‘Sxample, ora brary that is stored on a PC inthe Windows environment,

fe\data\eostacct would be a valid pathname,

(Optional tn the Deseeiption fel, supply a description ofthe library, to remind

‘yourelf or other ners of what the library contains

{Optional In the Engtne field, enter the name of the SAS engine that is ruired for writing to and reading from this Hbrary This is necessary only ifyou do not want the SAS server to use the default engine for the version and release number

OT SAS that you are running (For SAS 8.1, the default engine would be ¥9.) For

Trang 26

information about other engines that might bo wesilabe, see the description ofthe LIBNAME statement in the SAS Companion for the operating system under which yourdata library is stored

(Optional) In the optsons field, you can eer the following option for the Uibeary that you are defining

4 To include another data library with your data sono repent steps 2:7,

Defining Libraries at Server Startup Time

Server administrators might prefer to define SAS data libraries at server startup

‘ime rather than defning them through tse SAS ODBC driver dialog boxes Dellning libraries at server starip time can make opening the data soure faster, Italo enables you to avoid banleeding the physical namet of your libraries in your SAS ODBC

‘ata-sonree definitions

‘As explained in “SAS Servers” on page 6, the SAS ODBC diver uses a SASSHARE server (invoked by PROC SERVER) to access remote data sources Te uses 9 SAS ODBC server invoked by PROC ODBCSERW) to acess loca datasources To define a data library at server startup time, you precede the PROC SERVER or PROC ODBCSERV satement with » SAS LIBNAME statement For example, you could define a Ubary of fost-accounting data toa SASSHARE server as flows:

"Tp dofino this library toa SAS ODBC server, you would add only the above

LIBNAME statement to te ISASROOTYCORE\SASMACROSASODBCSAS fle, See Startup Parameters on page 18 for more information

‘When a usee requests aevess lo thế pariculae SAS ODBC data soure fom an ODBC

‘sient appliration, the server would gutomatially make ths ibrary available, son

‘vith any libraries that were defined via the SAS ODBC Libraries page For mote information about the SAS LIBNAME statement, ae the SAS Companion for the operating system under which your data brary is stared

Deleting a Data Library Definition

‘Te doleto previously defined data library, complete these steps:

4 Select the library name from the Libearies list at the (Display 27 on page 21 lef ofthe Libraries page

2 Select SSRIS)

Trang 27

ning ar Dat Sorc) Sain Oil Se

Modifying a Data Library Definition

‘To change the information for a previously defined library, complete these stepe

1 Select the hbrary name from the LAbraries list on the Libraries page,

2 Make the desired changes tothe Bost Pie, Description, gine, and Options elds

4 Select UpATZz| to save your changes

“You can either add additional data soures, or select (OK) wo return to the Microsoft

‘Windows Control Panel cr tothe loeation froin which you entered the ODBC Data Songer Administrator dio box)

Modifying a Data Source Definition

‘To modify a proviously defined da ouree, complete these stop:

1 Select the name ofthe data soure fromthe ODBC Data Source Aduinistrator Aialog box Display 2.1 on page 12)

2 Select (Cotas) The SAS ODRC page 14) appear

4 Use the tab inthis dialog box to acon other SAS ODBC pages Use the other pages as descrited in previous sections to modify server definition, library Hetitions, oF SQL options

‘When you are fished, select [OK] to save your changes

ver Configuration dialog box Display 2.3.08

Specifying a Different Server for a Defined Data Source

Suppose a datasource named Papzott has heen moved from a server name CrCERO toono named pxvanex In this cae, you noed to change the server that you specified for the Payreld data source by completing theoe steps

4 Select the peyeot2 data soure from the ODBC Data Sousce Administrator dialog box (Display 2.1 ơn page 12,

2 Select Conta) The SAS ODBC Driver Configuration dialog box (Display 2.3 on page 14) appears, with exceRo listed in the Servers fl

4 Uso the Servers page ta define the DAVIN server, i it isnot already defined,

4 Prom the Gonerat page, if DAVIN is not already visible inthe Sorvers ld, select the drop-down Ist icon next to that feld, and then seleet DAVIN! from the Ist

Trang 28

5 Seleet [0K] lờ se your changes Lote: ‘The server name specif must be defined inthe TCPAP Serves file, Por

‘more information, see “The TCPAP Services File” on page 29

Deleting a Data Source Definition

"To delete a previously defined data soures complete these steps

41 Select the name ofthe datasource from the ODBC Data Source Adminstrator iol box (Display 2.1 om pane 12)

2 Select (Rama

Trang 29

Otter portant Use Ifrntion 98

‘ring SQL Statoment tv Aces SAS Det Sorc 1

Introduction to Using the SAS ODBC Driver

“This chapter provides an overview of how to use the SAS ODBC driver to acess your SAS data sburees It also provides information about the SAS servers and the

fcommunieations software that are used by the deivee and about SQL syntax and retum fees that are supported by the driver

Accessing Your Data Sources

‘The details of how you access your SAS data sources depend an which ODEC-ompliant application you are wing for example, MierosoN Access or Excel, and

fn whether yon are accessing local or remete dats However, here are the step that you follow:

1 Install the SAS ODBC driver (Refer to the installation instructions that are shipped with the driver) The installation program provides the SAS driver forthe ODAC Data Source Administrator to we,

2 Double-click on the Data Sources (ODBC) con in the Control Panel window to eeese the ODBC and SAS ODBC Data Source Defisition dilog boc,

Trang 30

2 Use these dialog bores to provide the SAS ODBC driver with tho necessary information about your SAS data soure(e) (See Chapter 2,"Deiting Your Dat Sources page II for instructions.) In addition to SAS data Mle, SAS data nreee san ielude DATA step views, PROC BQT, views, or SASVACCESS views,

‘of shih contain definitions of data that is wtored laewhere rather than the plisical data itself Soe “Types of Data Accessed with the SAS ODBC Driver” on page 3 and “SAS Data Sets" on page 5.)

4 The neat step depends on whether you want to accoas local data or remote date:

1 To access local data soo “Acossing Local SAS Data Sources" on page 26,

6 To aooess remote datasources, soe “Accetsing Remote (SASISHARE) Data Sources on page 27

'5 Consult the documentation for your Windows application for instructions on ow

lo access or import data from other soures Brom the lst af available data, ores, selector spcify the name that Sou assiged to sour SAS data source,

6 Select or enter the name of the desined SAS data Hbrary Gf required by your pplication,

7 Select or enter the name of the desined SAS datafile or view

Prerequisites for Communications

‘The SAS ODRC driver internets with ole software to provide you with acess to our data soures, Certain prerequisites apps, depending on whether you want to

‘access loeal data or remote data These prerequisites are described in the following

Accessing Local SAS Data Sources =

‘To accos lcal SAS data soures, the SAS ODBC driver uses a $AS ODBC sorvor in onjunetion with TCP/IP You must eit your TCPMP Services fe to define your cervers before starting the SAS ODBC server, Iti not necessary fr the server to be running

‘whan you define your datasources, However, the server must e running on yout PC in frder for you 1 aeons your SAS data sourees, For information abot editing the

‘TCPAP Services file, seo “The TCP/IP Services File" on page 28 Por more information about SAS corvers, ee "SAS Server” an page 6

Starting a SAS ODBC Server

If there ist alteady a SAS ODBC server mung on your PC, the SAS ODBC {river utes the information that you supplied in the Local Options dialog box (deseribed

in Display 25 on page 17) to automaticaly start one for you, That is, you donot need

to tako any action to star the sortor,

you already have a SAS session running on your PC, thon you can start the SAS (ODBC server bs that session by submitting the following statements

Ngày đăng: 24/03/2014, 14:20