Accessing DBMS Data with the LIBNAME Statement Updating DBMS Data 251
Output 13.10 Querying Multiple DBMS Tables
Payrolls 1 & 2 1
IDNUM SEX JOBCODE SALARY BIRTH HIRED
---------------------------------------------------
1009 M TA1 28880 02MAR1959 26MAR1992
1017 M TA3 40858 28DEC1957 16OCT1981
1036 F TA3 39392 19MAY1965 23OCT1984
1036 F TA3 42465 19MAY1965 23OCT1984
1037 F TA1 28558 10APR1964 13SEP1992
1038 F TA1 26533 09NOV1969 23NOV1991
1050 M ME2 35167 14JUL1963 24AUG1986
1065 M ME2 35090 26JAN1944 07JAN1987
1065 M ME3 38090 26JAN1944 07JAN1987
1076 M PT1 66558 14OCT1955 03OCT1991
1076 M PT1 69742 14OCT1955 03OCT1991
1094 M FA1 22268 02APR1970 17APR1991
1100 M BCK 25004 01DEC1960 07MAY1988
1101 M SCP 18723 06JUN1962 01OCT1990
1102 M TA2 34542 01OCT1959 15APR1991
1103 F FA1 23738 16FEB1968 23JUL1992
1104 M SCP 17946 25APR1963 10JUN1991
1105 M ME2 34805 01MAR1962 13AUG1990
Updating DBMS Data
In addition to querying data, you can also update data directly in your DBMS. You
can update rows, columns, and tables by using the SQL procedure. The following
example adds a new row to the DB2 table SuperV.
libname mydblib db2 ssid=db2;
proc sql;
insert into mydblib.superv
values(’1588’,’NY’,’FA’);
quit;
proc print data=mydblib.superv;
title "New Row in AIRLINE.SUPERV";
run;
Note: Depending on how your DBMS processes inserts, the new row might not be
added as the last physical row of the table.
Output for this example is shown here.