AskSAM Advice – How do I change database schemas in a SAS/Access libname?

Andy Bowden
May 2, 2013

The Problem: Our database is setup to re-direct SAS connections to a database we don’t have read/write access to. Is there a way you can change the schema name so that the library is assigned to the correct one?
Solution: dbconinit libname option.

For DB2
libname edwtest DB2 dbconinit=”SET SCHEMA = SAS” datasrc=******* user=******** password=**********;
The dbconinit option passes any text after the ‘=’ sign to the database you’re using. Note that the commands in the text string are specific to the database you’re connecting to. The above example changes a DB2 session to use the schema called ‘SAS’. But there are other comands you can use.
This can also be used in SQL pass-thru.
Further information on the option and applicable database engines is available here

Copyright © 2019 OptimalBI LTD.