Execute a CONNECT statement
to connect from a SAS session to an SPD Server SQL server. After making
the connection, the first EXECUTE statement creates a table named
EMPLOYEE_INFO with three columns—EMPLOYEE_NO, EMPLOYEE_NAME,
and ANNUAL_SALARY. The second EXECUTE statement inserts an observation
into the table where EMPLOYEE_NO equals 1 and EMPLOYEE_NAME equals
The Prez.
The subsequent FROM
CONNECTION TO statement retrieves all of the records from the new
EMPLOYEE_INFO table. (In this example, it retrieves a single observation
inserted by the second EXECUTE statement.) The DISCONNECT statement
terminates the connection.
PROC SQL;
connect to sasspds
(dbq='mydomain'
host='workstation1'
serv='spdsname'
user='me'
passwd='noway');
execute (create table employee_info
(employee_no num, employee_name char(30),
annual_salary num) by sasspds;
execute (insert into employee_info
values (1, 'The Prez')) by sasspds;
select * from connection to sasspds
(select * from employee_info);
disconnect from sasspds;
quit;