BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Good Morning,

I'm trying to access different tables from different servers, but when I connect to the 'second' server I lose the connection from the first!

I connect to the 'first' server with:

%let rsas=xxx.xxx.xxx.xxx;
options comamid=tcp;
signon rsas.spwn user=_prompt_;

TABLE1 is on my own library stated as:
rsubmit;
libname lib1 'ucdmpwk.dw.lib1' disp=old;
endrsubmit;
libname lib1 server=rsas.spwn;

After creating a table (TABLE1) in lib1 library with this connection, I want to be able to access another table. Then I connect to this:

%let rsasaix=xxx.xxx.xxx.xxx xxxx;
options remote=rsasaix comamid=tcp;
filename rlink "!sasroot\connect\saslink\tcpunix.scr";
signon rsasaix user=_prompt_;

TABLE2 is in this library:
rsubmit;
LIBNAME DEP DB2 USER=XXXXXXX PASSWORD=XXXXXXX
PRESERVE_COL_NAMES=YES PRESERVE_TAB_NAMES=YES
SCHEMA=prod DATASRC=prod;
endrsubmit;
libname DEP server=rsasaix;


let's say I have the same column in the two tables.
what I want to do is something like this:

select *
from
lib1.TABLE1 a,
DEP.TABLE2 b,
where
a.col1 = b.col1


ERROR: Libname LIB1 is not assigned.
ERROR: File DEP.TABLE2.DATA does not exist.


Thanks in advance

Pintarolas
4 REPLIES 4
Leo
SAS Employee Leo
SAS Employee
Hi Pintarolas, I see your libref is not consistent. You said your table1 is in dmprs library but you define the libref called lib1. You should use the same libref as what you used in your last SQL.

Leo
deleted_user
Not applicable
sorry m8!
my bad!
I've made some changes to what I've posted but now I've edited the previous post. it has nothing to do with inconsistent libref.

I believe that when I connect to the rsasaix I lose the previous connection to rsas.spwn.
Bill
Quartz | Level 8
Pintarolas;

In situations similar to this, I upload the extract from the one server to the other server and do the "join" there.
DanielSantos
Barite | Level 11
Hi Pintarolas,

I do not see any wrong about your script, at leas with the syntax and options.

Wouldn't you be working at CGD?

Because your nick is definitively a portuguese nick and your signon script is very similar to the one we use here.

Cheers from Portugal.

Daniel Santos @ www.cgd.pt

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 1035 views
  • 0 likes
  • 4 in conversation