|Date: ||Thu, 21 Oct 2010 13:22:36 -0400|
|Reply-To: ||Michael Raithel <michaelraithel@WESTAT.COM>|
|Sender: ||"SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>|
|From: ||Michael Raithel <michaelraithel@WESTAT.COM>|
|Subject: ||Re: Reading DB2 tables with SAS|
|Content-Type: ||text/plain; charset="us-ascii"|
Last week, I posted the following reply to Amrita's DB2 question:
> Dear SAS-L-ers,
> Amrita posted, in part, the following:
> > .......... Now we want to try and use pass-thru to connect to the
> > db2 tables but no one seems to know the SSID, user name or password.
> > person responsible is no longer with the company so we are trying to
> > see how we can get this information.
> <<Amrita's entire original posting can be found beneath the Sig line>>
> Amrita, I would suggest finding out where that person ended up and then
> sending him a very nice Hallmark card with note explaining the
> situation and including a crisp, new $20 bill in it. I would bet that
> would do the trick!
> But, seriously though; your friendly DB2 DBA should be able to provide
> that information to you. Of course, s/he would be even friendlier if
> you provided that nice Hallmark card with said contents along with your
> Amrita, best of luck in all your SAS endeavors!
Look! Up in the sky!"
"It's a birdie!"
"It's a plane!"
"It's Super SAS Institute lurker!"
Okay, so maybe it wasn't Superman, but a very clever birdie who sent me the following for both Amrita's and your consideration on this topic:
1.If you have libname assignment then you have Implicit PROC SQL support for accessing DB2 using the SAS/ACCESS engine. The following syntax with appropriate values would work:
select * from x.my_db_tab where ...;
Some debugging options to consider to see what SQL is generated from the Implicit PROC SQL query and passed to the DBMS would be -
To turn the tracing option off you would -
2.Once you have found your SSID you should be able to libname to DB2 on the mainframe with something like:
libname x db2 ssid=xxx;
Note your connection credentials do not require a user/password since your logon id is used as authentication to the DB2 server.
I would expect that the libname statement is part of a pre-assigned library when SAS is started. Your SAS admin should be able to get you the SSID connection info. Once you have the connection info then PROC SQL explicit passthu would be open to you.
Well, birdies may not be able to "Faster than a speeding bullet! More powerful than a locomotive! Able to leap tall buildings in a single bound!", but they do monitor the 'L and their input is always welcomed!
All, best of luck in all your SAS endeavors!
I hope that this suggestion proves helpful now, and in the future!
Of course, all of these opinions and insights are my own, and do not reflect those of my organization or my associates. All SAS code and/or methodologies specified in this posting are for illustrative purposes only and no warranty is stated or implied as to their accuracy or applicability. People deciding to use information in this posting do so at their own risk.
Michael A. Raithel
"The man who wrote the book on performance"
Author: Tuning SAS Applications in the MVS Environment
Author: Tuning SAS Applications in the OS/390 and z/OS Environments, Second Edition
Author: The Complete Guide to SAS Indexes