BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Yayoi_Kurikyu
Fluorite | Level 6

Hello,

 

I am a beginner of SAS studio and I tried to get access to CRSP database which is supposed to be in 'Libraries'. 

 

https://wrds-www.wharton.upenn.edu/pages/support/programming-wrds/programming-sas/querying-wrds-data...

 

According to this page, these datasets should take place automatically. However, I think because I wrongly reset SAS session, I cannot find any WRDS datasets now and have no idea how to make it back.

 

Now my local library looks like this.

 

捕获.PNG

 

 

 

 

And when I try to import data from dataset such as compustat, it shows: 

 
data compustat;
set comp.funda;
ERROR: Libref COMP is not assigned.
if indfmt='INDL' and datafmt='STD' and popsrc='D' and consol='C';
keep gvkeyn fyear fyr datadate act lt pstkc conm sich;
run;
 

I am sorry to bother you with this basic question. And I am really thankful for all your help.

 

Best,

Yayoi

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Yayoi_Kurikyu
Fluorite | Level 6

I have found the missing code for autoexec:

 

* The library name definitions below are used by SAS;
* Assign default libref for WRDS (Wharton Research Data Services);

%include '/wrds/lib/utility/wrdslib.sas' ;
options sasautos=('/wrds/wrdsmacros/', SASAUTOS) MAUTOSOURCE;

 

Thank you for help.

View solution in original post

3 REPLIES 3
Tom
Super User Tom
Super User

Just re-run the LIBNAME statement you used before to create the libref COMP.

It should probably look something like:

libname comp 'some path on your SAS server';

Just figure out where you pointed the libref before and recreate it.

If you really created a dataset named FUNDA then there should be a file named 'funda.sas7bdat' in the directory.

Yayoi_Kurikyu
Fluorite | Level 6

Hello Tom.

 

Thank you for replying. However, the problem is that when I first time get access to SAS Studio, it has all access to the libraries on the WRDS and I do not have to type into the command such as libname crsp ''/wrds/crsp/sasdata/m_ccm'';

 

And I have another problem when I tried to create the CRSP library. When I try to run 

 

libname crsp '/wrds/crsp/sasdata/m_ccm';

data permnolist;
set crsp.msf;
keep permno;
if year(date)>1969;
run;

 

it says ERROR: User does not have appropriate authorization level for file CRSP.MSF.DATA.

 

But I am pretty sure my university has subscribed the CRSP and I just used it a few days ago before I restore my libraries.

 

Thank you very much.

 

Yayoi

Yayoi_Kurikyu
Fluorite | Level 6

I have found the missing code for autoexec:

 

* The library name definitions below are used by SAS;
* Assign default libref for WRDS (Wharton Research Data Services);

%include '/wrds/lib/utility/wrdslib.sas' ;
options sasautos=('/wrds/wrdsmacros/', SASAUTOS) MAUTOSOURCE;

 

Thank you for help.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 3 replies
  • 3974 views
  • 0 likes
  • 2 in conversation