<?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: How to join tables from different SAS servers in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-join-tables-from-different-SAS-servers/m-p/529367#M144620</link>
    <description>&lt;P&gt;Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your response. I've tried to reference to the other server with LIBNAME but I get the following error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;27         
28         libname rorilib slibref=ORILIB server=SERVER_B;
&lt;FONT color="#ff0000"&gt;ERROR: Attempt to connect to server SERVER_B failed.
ERROR: A communication subsystem partner link setup request failure has occurred.
ERROR: Cannot find TCP service 'server_b'.
ERROR: Error in the LIBNAME statement.&lt;/FONT&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 23 Jan 2019 10:23:49 GMT</pubDate>
    <dc:creator>PericoPalotes</dc:creator>
    <dc:date>2019-01-23T10:23:49Z</dc:date>
    <item>
      <title>How to join tables from different SAS servers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-join-tables-from-different-SAS-servers/m-p/529036#M144479</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've a two server SAS infrastructure and I want to join two tables from different servers.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've Server_A with an example table named PAYLIST_A inside the folder /data/PROCLIB&lt;/P&gt;&lt;P&gt;and I've Server_B&amp;nbsp;with an example table named PAYLIST_B inside the folder /data/ORIOLIB&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I try to join the tables using the query builder, what I get is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;%_eg_conditional_dropds(WORK.QUERY_FOR_PAYLIST);

PROC SQL;
   CREATE TABLE WORK.QUERY_FOR_PAYLIST AS 
   SELECT t1.IdNum, 
          t1.Gender, 
          t1.Jobcode, 
          t1.Salary, 
          t1.Birth, 
          t1.Hired, 
          t2.IdNum AS IdNum1, 
          t2.Gender AS Gender1, 
          t2.Jobcode AS Jobcode1, 
          t2.Salary AS Salary1, 
          t2.Birth AS Birth1, 
          t2.Hired AS Hired1
      FROM PROCLIB.PAYLIST_A t1
           INNER JOIN WORK.PAYLIST_B t2 ON (t1.IdNum = t2.IdNum);
QUIT;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So what Query Builder does, is to download PAYLIST_B from server B, and save it in server A WORK, but if I try to run this code without previously Query Builder download the PAYLIST_B table, it does not work. It simply says&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;FONT color="#FF0000"&gt;ERROR: File WORK.PAYLIST_B t2 does not exist.

&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I join to tables in different servers in a program without using the query builder?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jan 2019 13:41:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-join-tables-from-different-SAS-servers/m-p/529036#M144479</guid>
      <dc:creator>PericoPalotes</dc:creator>
      <dc:date>2019-01-22T13:41:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to join tables from different SAS servers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-join-tables-from-different-SAS-servers/m-p/529040#M144481</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/216408"&gt;@PericoPalotes&lt;/a&gt; you say that &lt;SPAN&gt;Server_B&amp;nbsp;with an example table named PAYLIST_B.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Server_B is not the same as work.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;have you tried changing this&amp;nbsp;WORK.PAYLIST_B t2 to this Server_B.PAYLIST_B t2&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jan 2019 13:59:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-join-tables-from-different-SAS-servers/m-p/529040#M144481</guid>
      <dc:creator>VDD</dc:creator>
      <dc:date>2019-01-22T13:59:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to join tables from different SAS servers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-join-tables-from-different-SAS-servers/m-p/529095#M144503</link>
      <description>&lt;P&gt;Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/122002"&gt;@VDD&lt;/a&gt;&amp;nbsp;, thanks for your response.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunatelly, this does not work, I'm running the program in the SERVER_A, and if I change the WORK to the name of the library ORIOLIB in SERVER_B, it simply says:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;42               FROM PROCLIB.PAYLIST t1
43                    INNER JOIN ORIOLIB.PAYLIST t2 ON (t1.IdNum = t2.IdNum);
&lt;FONT color="#ff0000"&gt;ERROR: File ORIOLIB.PAYLIST.DATA does not exist.&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;If I try something like SEVER_B.ORIOLIB.PAYLIST it says:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;42               FROM PROCLIB.PAYLIST t1
43                    INNER JOIN SERVER_B.ORIOLIB.PAYLIST t2 ON (t1.IdNum = t2.IdNum);
                                                 _
                                                 22
                                                 76
&lt;FONT color="#ff0000"&gt;ERROR 22-322: Syntax error, expecting one of the following: a name, (, AS, ON.  

ERROR 76-322: Syntax error, statement will be ignored.&lt;/FONT&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jan 2019 15:48:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-join-tables-from-different-SAS-servers/m-p/529095#M144503</guid>
      <dc:creator>PericoPalotes</dc:creator>
      <dc:date>2019-01-22T15:48:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to join tables from different SAS servers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-join-tables-from-different-SAS-servers/m-p/529150#M144524</link>
      <description>&lt;P&gt;I would say "Show use your LIBNAME statements". Especially for your ORIOLIB.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Likely one of those libname statements needs a UNC or similar address to tell your SAS session which server is handling requests.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If your libname does not reference the other server than likely your SAS session is assuming that the library is "local" or on the default server.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jan 2019 17:54:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-join-tables-from-different-SAS-servers/m-p/529150#M144524</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-01-22T17:54:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to join tables from different SAS servers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-join-tables-from-different-SAS-servers/m-p/529367#M144620</link>
      <description>&lt;P&gt;Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your response. I've tried to reference to the other server with LIBNAME but I get the following error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;27         
28         libname rorilib slibref=ORILIB server=SERVER_B;
&lt;FONT color="#ff0000"&gt;ERROR: Attempt to connect to server SERVER_B failed.
ERROR: A communication subsystem partner link setup request failure has occurred.
ERROR: Cannot find TCP service 'server_b'.
ERROR: Error in the LIBNAME statement.&lt;/FONT&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 23 Jan 2019 10:23:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-join-tables-from-different-SAS-servers/m-p/529367#M144620</guid>
      <dc:creator>PericoPalotes</dc:creator>
      <dc:date>2019-01-23T10:23:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to join tables from different SAS servers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-join-tables-from-different-SAS-servers/m-p/529485#M144681</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/216408"&gt;@PericoPalotes&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your response. I've tried to reference to the other server with LIBNAME but I get the following error:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;27         
28         libname rorilib slibref=ORILIB server=SERVER_B;
&lt;FONT color="#ff0000"&gt;ERROR: Attempt to connect to server SERVER_B failed.
ERROR: A communication subsystem partner link setup request failure has occurred.
ERROR: Cannot find TCP service 'server_b'.
ERROR: Error in the LIBNAME statement.&lt;/FONT&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Network communications is not my strength but perhaps you have a SAS admin to talk to about how to connect to your different servers. Perhaps you need to provide some credentials such as username and/or password. By any chance is the ORILIB actually an Oracle database? You may need SAS/Access for Oracle&amp;nbsp;installed and configured in that case and the libname may look more like&lt;/P&gt;
&lt;PRE&gt;libname myoralib oracle user=myusr1 password=mypwd1 path='mysrv1';&lt;/PRE&gt;</description>
      <pubDate>Wed, 23 Jan 2019 18:26:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-join-tables-from-different-SAS-servers/m-p/529485#M144681</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-01-23T18:26:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to join tables from different SAS servers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-join-tables-from-different-SAS-servers/m-p/529488#M144684</link>
      <description>&lt;P&gt;do you also need to have schema=&lt;EM&gt;schema_to_the_DB&amp;nbsp;&lt;/EM&gt;for Oracle&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jan 2019 18:39:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-join-tables-from-different-SAS-servers/m-p/529488#M144684</guid>
      <dc:creator>VDD</dc:creator>
      <dc:date>2019-01-23T18:39:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to join tables from different SAS servers libname rorilib slibref=ORILIB server=SERVER_B;</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-join-tables-from-different-SAS-servers/m-p/529598#M144724</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;gt;So what Query Builder does, is to download PAYLIST_B from server B, and save it in server A WORK,&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your code runs in SERVER_A, so all the data must be available to SERVER_A.&lt;/P&gt;
&lt;P&gt;Four options:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1- Download it to the WORK library on SERVER_A using SAS/CONNECT and proc download.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;This seems to be the current working option.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2- Point to the remote path.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Under Windows this is done using SMB to create a UNC path&amp;nbsp; Your libname will be something like&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp;libname OR&lt;SPAN&gt;IOLIB&amp;nbsp;&lt;/SPAN&gt;'\\SERVER_B\&lt;SPAN&gt;folder\data\ORIOLIB&lt;/SPAN&gt;';&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Under unix you can use NFS. See your unix admin.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3- Use SAS/CONNECT to create RLS libraries.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;The syntax that you gave is correct:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp;libname rorilib slibref=ORILIB server=SERVER_B;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;The error you are showing points to your trying to connect using the wrong server name.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;How does Query Builder connect?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;4- Transfer the file outside of SAS, for example using FTP.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Note that all methods require downloading the table to SERVER_A for local processing. So you won't save any time there.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jan 2019 02:23:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-join-tables-from-different-SAS-servers/m-p/529598#M144724</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2019-01-24T02:23:20Z</dc:date>
    </item>
  </channel>
</rss>

