A SERVICE OF

logo

244 Reading Data from Multiple DBMS Tables Chapter 13
Output 13.2 Combining DBMS Data and SAS Data
Salary Analysis 1
OBS IDNUM JOBCODE SALARY CATEGORY
1 1919 TA2 $34,376.00 Avg
2 1653 ME2 $35,108.00 Avg
3 1400 ME1 $29,769.00 Low
4 1350 FA3 $32,886.00 Avg
5 1401 TA3 $38,822.00 Avg
6 1499 ME3 $43,025.00 Avg
7 1101 SCP $18,723.00 Low
8 1333 PT2 $88,606.00 High
9 1402 TA2 $32,615.00 Avg
10 1479 TA3 $38,785.00 Avg
11 1403 ME1 $28,072.00 Low
12 1739 PT1 $66,517.00 High
13 1658 SCP $17,943.00 Low
14 1428 PT1 $68,767.00 High
15 1782 ME2 $35,345.00 Avg
16 1244 ME2 $36,925.00 Avg
17 1383 BCK $25,823.00 Low
18 1574 FA2 $28,572.00 Low
19 1789 SCP $18,326.00 Low
20 1404 PT2 $91,376.00 High
Reading Data from Multiple DBMS Tables
You can use the DATA step to read data from multiple data sets. This example
merges data from the two Oracle tables Staff and SuperV in the SAS data set
Work.Combined.
libname mydblib oracle user=testuser password=testpass path=’@alias’;
data combined;
merge mydblib.staff mydblib.superv(in=super
rename=(supid=idnum));
by idnum;
if super;
run;
proc print data=combined;
title "Supervisor Information";
run;
Output for this example is shown here.