Problems with SAS and wrds

Reply
N/A
Posts: 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. 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!

A

Super User
Posts: 10,483

Re: Problems with SAS and wrds

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;

The bold code above shows the program is expecting a dataset named MSEALL to be stored in the Library CRSP. If you have not created the library the program will fail with the error message.

You need to define a library name and location before trying to use one. Also, if you are using a server version of SAS then the location of the library has to be expressed in a way that the server can see the dataset.

Ask a Question
Discussion stats
  • 1 reply
  • 498 views
  • 0 likes
  • 2 in conversation