Amut
Amut

Reputation: 1

Problems with SAS and WRDS

I am new on SAS and I have a problem when I connect my computer with SAS to WRDS (Wharton Research Data Services). I want to compute some portfolios and I am running this code.

*****************************************************************************
Program Description  : MOMENTUM PORTFOLIOS OF JEGADEESH AND TITMAN (JF, 1993) 
                       USING MONTHLY RETURNS FROM CRSP
     Created by  : G. Cici, WRDS
     Modified by : R. Moussawi, WRDS
     Date Created  : November 2004
     Date Modified  : May 2007


*****************************************************************************;

 %let wrds = wrds.wharton.upenn.edu 4016;
 options comamid=TCP remote=WRDS;
 signon username=_prompt_;

 rsubmit;
*****************************************************************************
1. Specifying Options
*****************************************************************************;
*** NUMBER OF PRIOR MONTHS USED TO CREATE MOMENTUM PORTFOLIOS;
%let J=6; * J can be between 3 to 12 months;
*** HOLDING PERIOD IN MONTHS AFTER PORTFOLIO CREATION;
%let K=6; * K can be between 3 to 12 months;
*** Footnote 4 page 69: 1965-1989 are the dates of portfolio holding periods;
*** BEGINING SAMPLE PERIOD;
%let begyear=1965; 
*** ENDING SAMPLE PERIOD;
%let endyear=1989; 



*****************************************************************************
2. Get Historical Exchange Codes and Share Codes for Common Stocks
 *****************************************************************************    ;
* Merge historical codes with CRSP Monthly Stock File;
proc sql;
create table msex1
as select a.permno, a.date, a.ret, b.exchcd, b.shrcd
from crsp.msf(keep=date permno ret) as a
left join crsp.mseall(keep=date permno exchcd shrcd) as b
on a.permno=b.permno and a.date= b.date;
quit;

First I provide my username and password to connect to wrds, and then, it gives an error message that reads as follows:

 Libname CRSP is not assigned

Any idea why this may be happening? Thanks!

Upvotes: 0

Views: 794

Answers (1)

DWal
DWal

Reputation: 2762

The code you submit to be run remotely needs to be sandwiched in between rsubmit; and endrsubmit;. You are missing endrsubmit;. It seems SAS is trying to run the code locally where the libname crsp has not been assigned.

Upvotes: 1

Related Questions