In this example, we
issue a CONNECT statement to connect from a SAS session to an SPD
Server SQL server. After the connection is made, 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
,
EMPLOYEE_NAME equals
The Prez
, and ANNUAL_SALARY
equals 10,000.
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,
which was 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', 10000)) by sasspds;
select * from connection to sasspds
(select * from employee_info);
disconnect from sasspds;
quit;