24.04.2014 Views

Pratique de Sas Windows ...9.3 Volume 2 - Ined

Pratique de Sas Windows ...9.3 Volume 2 - Ined

Pratique de Sas Windows ...9.3 Volume 2 - Ined

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

4.3.4 Un exemple par rapport à MySQL en passant par l’odbc<br />

Ne disposant point du module <strong>Sas</strong> access to My SQL, tentons un accès par le module <strong>Sas</strong> access to Odbc.<br />

Il faut tout d’abord installer le driver correspondant pour My Sql, que vous trouverez sur internet.<br />

Le montage se fera ensuite selon les instructions <strong>de</strong> l’administrateur gérant les bases My SQL, qui m’a accordé<br />

un accès avec mot <strong>de</strong> passe<br />

pour aboutir à la source <strong>de</strong> données système<br />

Dans <strong>Sas</strong>, avec ce co<strong>de</strong> http://support.sas.com/documentation/cdl/en/acreldb/63647/HTML/<strong>de</strong>fault/a001355231.htm<br />

libname odbcmsql odbc required='DSN=mysqlodbc;DRIVER={ODBC 5.2(w) Driver};<br />

SERVER=xxxxxxxxxxx.ined.fr;<br />

DATABASE=<strong>Sas</strong>test;<br />

USER=<strong>Sas</strong>aw;"<br />

PASSWORD=xxxxxxxxxxxx';<br />

NOTE: Libref ODBCMSQL was successfully assigned as follows:<br />

Engine: ODBC<br />

Physical Name: mysqlodbc<br />

Ne pas oublier le libname odbsmsql clear; après emploi .<br />

Ou en mo<strong>de</strong> requête http://support.sas.com/documentation/cdl/en/acreldb/63647/HTML/<strong>de</strong>fault/a001355234.htm<br />

<br />

proc sql ;<br />

connect to odbc as source (DSN=mysqlodbc user=<strong>Sas</strong>aw password=<strong>Sas</strong>aw);<br />

create table mysqltable as<br />

select * from connection to source (select * from <strong>Sas</strong>_data);<br />

disconnect from source;<br />

quit;<br />

avec ces commentaires sur la log<br />

NOTE: The data value for column datnais (datnais) was truncated or was out of range 1 times<br />

when retrieving that data from the DBMS.<br />

NOTE: Table WORK.MYSQLTABLE created, with 17872 rows and 6 columns.<br />

21 disconnect from source;<br />

22 quit;<br />

NOTE: PROCEDURE SQL used (Total process time): real time 0.29 secon<strong>de</strong>s<br />

Voir :<br />

http://blogs.sas.com/content/<strong>Sas</strong>dummy/2012/05/18/using-proc-sql-to-get-the-schema-of-a-mysql-database/<br />

217 INED Service Informatique Wielki

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

Saved successfully!

Ooh no, something went wrong!