![](https://pdfstore-manualsonline.prod.a.ki/pdfasset/b/da/bda6fccb-b246-43e7-a520-a01ed647b8cf/bda6fccb-b246-43e7-a520-a01ed647b8cf-bgfd.png)
Accessing DBMS Data with the LIBNAME Statement Combining DBMS Data and SAS Data 243
Output 13.1 Using the PRINT Procedure with DBMS Data
New Jersey Phone List 1
Obs LNAME FNAME STATE HPHONE
1 ALVAREZ CARLOS NJ 201/732-8787
2 BAREFOOT JOSEPH NJ 201/812-5665
3 DACKO JASON NJ 201/732-2323
4 FUJIHARA KYOKO NJ 201/812-0902
5 HENDERSON WILLIAM NJ 201/812-4789
6 JOHNSON JACKSON NJ 201/732-3678
7 LAWRENCE KATHY NJ 201/812-3337
8 MURPHEY JOHN NJ 201/812-4414
9 NEWKIRK SANDRA NJ 201/812-3331
10 NEWKIRK WILLIAM NJ 201/732-6611
11 PETERS RANDALL NJ 201/812-2478
12 RHODES JEREMY NJ 201/812-1837
13 ROUSE JEREMY NJ 201/732-9834
14 VICK THERESA NJ 201/812-2424
15 YANCEY ROBIN NJ 201/812-1874
Combining DBMS Data and SAS Data
The following example shows how to read DBMS data into SAS and create
additional variables to perform calculations or subsetting operations on the data. The
example creates the SAS data set Work.HighWage from the DB2 table Payroll and adds
a new variable, Category. The Category variable is based on the value of the salary
column in the DB2 table Payroll. The Payroll table is not modiļ¬ed.
libname mydblib db2 ssid=db2;
data highwage;
set mydblib.payroll(drop=sex birth hired);
if salary>60000 then
CATEGORY="High";
else if salary<30000 then
CATEGORY="Low";
else
CATEGORY="Avg";
run;
options obs=20;
proc print data=highwage;
title "Salary Analysis";
format salary dollar10.2;
run;
Partial output for this example is shown here.