<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: As which database user am I connected to my RDBMS? in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/As-which-database-user-am-I-connected-to-my-RDBMS/m-p/470769#M14752</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13625"&gt;@bheinsius&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;So what does the libname ... list; command return in your case?&lt;/P&gt;</description>
    <pubDate>Sat, 16 Jun 2018 08:18:51 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2018-06-16T08:18:51Z</dc:date>
    <item>
      <title>As which database user am I connected to my RDBMS?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/As-which-database-user-am-I-connected-to-my-RDBMS/m-p/470564#M14720</link>
      <description>&lt;P&gt;I have a Postgres libname assigned&amp;nbsp;from metadata.&lt;/P&gt;&lt;P&gt;How can I see with which database user I am connected to the database?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;libname wikdimon list;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;only shows this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;22         libname wikdimon list;

NOTE: Libref=   WIKDIMON
      Scope=    Object Server
      Engine=   POSTGRES
      Physical Name= mydb.example.com
      Schema/Owner= public&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jun 2018 11:41:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/As-which-database-user-am-I-connected-to-my-RDBMS/m-p/470564#M14720</guid>
      <dc:creator>bheinsius</dc:creator>
      <dc:date>2018-06-15T11:41:25Z</dc:date>
    </item>
    <item>
      <title>Re: As which database user am I connected to my RDBMS?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/As-which-database-user-am-I-connected-to-my-RDBMS/m-p/470576#M14723</link>
      <description>&lt;P&gt;Probably a generic read only account.&amp;nbsp; Best to ask you SAS or Database admin.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jun 2018 12:35:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/As-which-database-user-am-I-connected-to-my-RDBMS/m-p/470576#M14723</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-06-15T12:35:47Z</dc:date>
    </item>
    <item>
      <title>Re: As which database user am I connected to my RDBMS?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/As-which-database-user-am-I-connected-to-my-RDBMS/m-p/470585#M14725</link>
      <description>&lt;P&gt;I am a developer, i am trying to debug a problem with RDBMS access and I have multiple groups that I a m a member of and I am ytrying to find out which database user is being used in my case.&lt;/P&gt;&lt;P&gt;I know I can find it from Management Console by logging into it with my metadata credential, switch off the auto-assign option and select Display libname statement, but there must be an easier way than that.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jun 2018 13:03:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/As-which-database-user-am-I-connected-to-my-RDBMS/m-p/470585#M14725</guid>
      <dc:creator>bheinsius</dc:creator>
      <dc:date>2018-06-15T13:03:53Z</dc:date>
    </item>
    <item>
      <title>Re: As which database user am I connected to my RDBMS?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/As-which-database-user-am-I-connected-to-my-RDBMS/m-p/470586#M14726</link>
      <description>&lt;P&gt;If your libraries are pre-assigned then, your SAS admin might created authentication domain definitions while creating a user definition with the user manager in SAS Management Console. That means your credentials will be added to metadata repository and your libnames might be pre-assigned using external configuration or auto execute file. Simply if the Library is assigned to you then your the user.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;AUTHDOMAIN=option enables you to avoid exiplicitly specifying a database user ID and password in a SAS Program. You can manually connect using the authdomain. Contact your SAS admin for the authdomain details.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jun 2018 13:06:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/As-which-database-user-am-I-connected-to-my-RDBMS/m-p/470586#M14726</guid>
      <dc:creator>SuryaKiran</dc:creator>
      <dc:date>2018-06-15T13:06:46Z</dc:date>
    </item>
    <item>
      <title>Re: As which database user am I connected to my RDBMS?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/As-which-database-user-am-I-connected-to-my-RDBMS/m-p/470609#M14728</link>
      <description>&lt;P&gt;Thank you but that is not my question.&lt;/P&gt;&lt;P&gt;My question is that I want to submit a line of SAS code, like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;LIBNAME WIKDIMON LIST;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;that will list which user is used to connect to the database.&lt;/P&gt;&lt;P&gt;I mean for real - not what is listed in metadata.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jun 2018 14:27:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/As-which-database-user-am-I-connected-to-my-RDBMS/m-p/470609#M14728</guid>
      <dc:creator>bheinsius</dc:creator>
      <dc:date>2018-06-15T14:27:55Z</dc:date>
    </item>
    <item>
      <title>Re: As which database user am I connected to my RDBMS?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/As-which-database-user-am-I-connected-to-my-RDBMS/m-p/470738#M14750</link>
      <description>&lt;P&gt;So what are the user credentials being supplied in the metadata definition? You should be able to figure it out by looking through the Management Console data library properties. I'm not aware of anyway of doing this in code.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jun 2018 22:57:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/As-which-database-user-am-I-connected-to-my-RDBMS/m-p/470738#M14750</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2018-06-15T22:57:46Z</dc:date>
    </item>
    <item>
      <title>Re: As which database user am I connected to my RDBMS?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/As-which-database-user-am-I-connected-to-my-RDBMS/m-p/470769#M14752</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13625"&gt;@bheinsius&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;So what does the libname ... list; command return in your case?&lt;/P&gt;</description>
      <pubDate>Sat, 16 Jun 2018 08:18:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/As-which-database-user-am-I-connected-to-my-RDBMS/m-p/470769#M14752</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2018-06-16T08:18:51Z</dc:date>
    </item>
    <item>
      <title>Re: As which database user am I connected to my RDBMS?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/As-which-database-user-am-I-connected-to-my-RDBMS/m-p/470782#M14753</link>
      <description>&lt;PRE&gt;22         libname wikdimon list;

NOTE: Libref=   WIKDIMON
      Scope=    Object Server
      Engine=   POSTGRES
      Physical Name= mydb.example.com
      Schema/Owner= public&lt;/PRE&gt;</description>
      <pubDate>Sat, 16 Jun 2018 13:13:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/As-which-database-user-am-I-connected-to-my-RDBMS/m-p/470782#M14753</guid>
      <dc:creator>bheinsius</dc:creator>
      <dc:date>2018-06-16T13:13:33Z</dc:date>
    </item>
    <item>
      <title>Re: As which database user am I connected to my RDBMS?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/As-which-database-user-am-I-connected-to-my-RDBMS/m-p/470789#M14754</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13625"&gt;@bheinsius&lt;/a&gt;&amp;nbsp;- I know you just want the current user info.&amp;nbsp; Maybe there is a passthrough method to get it, or it can be inferred by querying the INFORMATION_SCHEMA (supported in Postgres, I think).&amp;nbsp; I &lt;A href="https://blogs.sas.com/content/sasdummy/2012/05/18/using-proc-sql-to-get-the-schema-of-a-mysql-database/" target="_self"&gt;have a blog post here that has a MySQL example&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/51161"&gt;@JBailey&lt;/a&gt;&amp;nbsp;might have a more definitive answer.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Jun 2018 14:08:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/As-which-database-user-am-I-connected-to-my-RDBMS/m-p/470789#M14754</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2018-06-16T14:08:13Z</dc:date>
    </item>
    <item>
      <title>Re: As which database user am I connected to my RDBMS?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/As-which-database-user-am-I-connected-to-my-RDBMS/m-p/470791#M14755</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4"&gt;@ChrisHemedinger&lt;/a&gt;&amp;nbsp;I will look into that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Actually obtaining the user was only part of my question, as I would also like to obtain&amp;nbsp;the options that my library was assigned with.&lt;/P&gt;&lt;P&gt;From metadata I see that it will be assigned as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;LIBNAME wikdimon POSTGRES  PRESERVE_COL_NAMES=NO  PRESERVE_TAB_NAMES=NO  &lt;BR /&gt;DATABASE=dimon  SERVER="mydb.example.com"  SCHEMA=public  &lt;BR /&gt;USER=my_user  PASSWORD="{SAS002}xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;where, like I posted before, libname list i only gives me this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;22         libname wikdimon list;

NOTE: Libref=   WIKDIMON
      Scope=    Object Server
      Engine=   POSTGRES
      Physical Name= mydb.example.com
      Schema/Owner= public&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The only way I know to obtain this information is to go to&amp;nbsp;SAS Management Console, disable the advanced option "Library is pre-assigned" option from the library, select the "Display LIBNAME statement" option from the library's context menu, then revert the &lt;SPAN&gt;"Library is pre-assigned" setting. But&amp;nbsp;I am not allowed to do this in our production environment.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you have suggestions how to get that information as well?&lt;/P&gt;</description>
      <pubDate>Sat, 16 Jun 2018 15:10:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/As-which-database-user-am-I-connected-to-my-RDBMS/m-p/470791#M14755</guid>
      <dc:creator>bheinsius</dc:creator>
      <dc:date>2018-06-16T15:10:06Z</dc:date>
    </item>
    <item>
      <title>Re: As which database user am I connected to my RDBMS?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/As-which-database-user-am-I-connected-to-my-RDBMS/m-p/471133#M14761</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13625"&gt;@bheinsius&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This may be what you are looking for...&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname pglib postgres user=myuser pw=Mypass1 server="postgres.mycompany.com" schema=myschema db=mygpdb
                      conopts="UseServerSidePrepare=1";

proc sql;
   connect using pglib;
   select * from connection to pglib (select current_user, current_schema(), current_database(););
quit;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The semicolon inside the explicit pass-through is optional but useful if you cut-and-paste between SAS and pgsql.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best wishes,&lt;/P&gt;
&lt;P&gt;Jeff&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jun 2018 17:33:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/As-which-database-user-am-I-connected-to-my-RDBMS/m-p/471133#M14761</guid>
      <dc:creator>JBailey</dc:creator>
      <dc:date>2018-06-18T17:33:08Z</dc:date>
    </item>
    <item>
      <title>Re: As which database user am I connected to my RDBMS?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/As-which-database-user-am-I-connected-to-my-RDBMS/m-p/471202#M14763</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/51161"&gt;@JBailey&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From the answers so far I assume there is no way to get this information from SAS, including the connection options I listed before?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jun 2018 19:24:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/As-which-database-user-am-I-connected-to-my-RDBMS/m-p/471202#M14763</guid>
      <dc:creator>bheinsius</dc:creator>
      <dc:date>2018-06-18T19:24:28Z</dc:date>
    </item>
    <item>
      <title>Re: As which database user am I connected to my RDBMS?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/As-which-database-user-am-I-connected-to-my-RDBMS/m-p/471234#M14765</link>
      <description>&lt;P&gt;All of the data source setup is stored in SAS metadata. So in theory it should be possible to extract this with SAS metadata functions. However the metadata model is complicated and very hard to unpick. I've never seen an example metadata read program for data sources but I've seen some for other types.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jun 2018 21:10:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/As-which-database-user-am-I-connected-to-my-RDBMS/m-p/471234#M14765</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2018-06-18T21:10:20Z</dc:date>
    </item>
    <item>
      <title>Re: As which database user am I connected to my RDBMS?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/As-which-database-user-am-I-connected-to-my-RDBMS/m-p/471342#M14777</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13625"&gt;@bheinsius&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;At one point I actually requested your request as a feature. It didn't go anywhere. I will take a look at it again. I doubt it will be implemented...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For right now, the solution to your problem lies in the code I posted.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best wishes,&lt;/P&gt;
&lt;P&gt;Jeff&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jun 2018 12:29:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/As-which-database-user-am-I-connected-to-my-RDBMS/m-p/471342#M14777</guid>
      <dc:creator>JBailey</dc:creator>
      <dc:date>2018-06-19T12:29:31Z</dc:date>
    </item>
  </channel>
</rss>

