BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
demi6od
Calcite | Level 5
I have 2 WRDS accounts with different rights. Can I connect to wrds with both account rights to access the database?
1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

You can define two macro variables to use as server names in the SIGNON Statement. Have both of them point to the WRDS server.

Issue SIGNON statements for both, using the different credentials, then issue RLS LIBNAMEs as needed.

View solution in original post

10 REPLIES 10
demi6od
Calcite | Level 5

I think the hard part is that in sas code, I can't make 2 connections simultaneously (with different account) to WRDS. At any time I can only access one database, and have no rights to access another. I think when I submit my SQL statements to WRDS sever, I will only execute it within one account's workspace.

SASKiwi
PROC Star

How do you connect to WRDS now? We can't really help unless you provide these details.

demi6od
Calcite | Level 5

I attach the sas file. It merge 3 different database compustat, crsp and IBES to calculate what I need.

One of my account have compustat and crsp rights, another account have IBES rights.

I use signon to connect WRDS, but any accout can't acess all 3 databases simultaneously.

SASKiwi
PROC Star

So what's the problem then? You can easily SIGNON to each of the three databases, download what you need, then combine results on local SAS if required.

demi6od
Calcite | Level 5

Thank you for your answer! It's what I'm trying, while I need to download a bit more data to local. For this question, I also try to find a way to do joint conditional selection from different database, and then only download the final results to local.

ChrisNZ
Tourmaline | Level 20

> only download the final results to local.

 

If you want to subset data A using data B, and data B is not accessible to data A, and you can't upload data B to location A, then you can't do that.

How could you?

 

So either you find a way to get data B where data A is (or at least the download criteria), or you must do the join and selection after downloading the full sets.

 

Typically, the way to download a subset is to put the selection criteria in a WHERE clause.

In other words: You don't bring data B to location A as data, you bring data B to location A as code.

 

The downside of course is that if you have a million values that you want to select, that's rather long piece of code.   

 

 

 

Kurt_Bremser
Super User

You can define two macro variables to use as server names in the SIGNON Statement. Have both of them point to the WRDS server.

Issue SIGNON statements for both, using the different credentials, then issue RLS LIBNAMEs as needed.

demi6od
Calcite | Level 5

I tried 2 ways as following but both failed:

 

%let wrds=wrds.wharton.upenn.edu 4016;options comamid=TCP remote=WRDS;
signon wrds macvar=rhost1;username=aaa password=xxx;
signon wrds macvar=rhost2;username=bbb password=xxx;

NOTE: A link to WRDS has been previously established. SIGNON is not necessary.

 

%let wrds1=wrds.wharton.upenn.edu 4016;options comamid=TCP remote=WRDS;

signon username=aaa password=xxx;

%let wrds2=wrds.wharton.upenn.edu 4016;options comamid=TCP remote=WRDS;

signon username=bbb password=xxx;

ERROR: A communication subsystem partner link setup request failure has occurred.
ERROR: Cannot locate TCP host 'WRDS'.

Kurt_Bremser
Super User

You need to use the separate definitions in the SIGNON.

signon wrds1 user=user1 password=pw1;
signon wrds2 user=user2 password=pw2;

If you still have problems, post your complete log by copy/pasting into a window opened with this button:

Bildschirmfoto 2020-04-07 um 08.32.59.jpg

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 10 replies
  • 608 views
  • 1 like
  • 4 in conversation