Questions tagged [wrds]
41 questions
0
votes
1 answer
How to fix errors connecting to 'wrds' database?
I'm trying to connect to 'wrds' database using the function 'WRDS.Connection()' from module 'wrds',I entered my username and password, but it recommends me to set up a .pgfile and raise error.
import wrds
conn = wrds.Connection()
Enter your WRDS…

Song Calderone Zhang
- 411
- 3
- 12
0
votes
1 answer
Save WRDS SQL query to file in python
My code is:
import wrds
db = wrds.Connection()
compustatq = db.raw_sql("""
select *
from comp.fundq
""")
compustatq.to_csv('path.csv',index=False)
The problem is that the dataset is so large that I run…

Chris
- 433
- 4
- 17
0
votes
1 answer
Run SAS batch jobs via SH files: SAS script contains export to csv - where is / how to get the output?
As university staff, I am allowed to run batch jobs on WRDS. I followed the instructions, also created the wrapper and send the job.
#!/bin/bash
#$ -cwd
#$ -m abe
#$ -M myemail@email.com
echo "Starting Job at `date`"
sas my_sas_script.sas
echo…

eternity1
- 651
- 2
- 15
- 31
0
votes
3 answers
SAS data step view and data wrap in a macro for loop
For a university research project I am retrieving data from WRDS via SAS and am relatively new to SAS. I am trying to retrieve data in a specific interval provided by WRDS which actually works very for me; the structure is as follows
[1]Define some…

eternity1
- 651
- 2
- 15
- 31
0
votes
1 answer
SAS auto log clear with rsubmit
I used to add dm "out;clear;log;clear;"; to clear the log and prevent the code from pausing for input. However, now I am using WRDS remote connection. This line after rsubmit does not work and the I lost connection to the server because I was not by…

Angel Chen
- 67
- 1
- 2
- 10
0
votes
1 answer
ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric operand is required
I am having errors as below.
ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric operand is required. The condition was: &N_GROUP
ERROR: The %TO value of the %DO I loop is invalid.
ERROR: The macro ORDERFLOW…

Jay
- 3
- 4
0
votes
2 answers
SAS NOTSORTED Equivalent
I was using the following code to analyze data:
set taq.cq_&yyyymmdd:;
by symbol date time NOTSORTED ex;
There are are thousands of datasets I am running the code on in the unit of days. When &yyyymmdd only specifies one dataset (for one day.…

Jinhua Wang
- 1,679
- 1
- 17
- 44
0
votes
3 answers
SAS Merge By Not Working
The following is a macro I wrote to left out join two datasets.
/*
* Macro to add the t-rate to the data
*/
%MACRO RFRATE(WITHOUT_RATE, WITH_RATE);
/*read the tbill rate data*/
data TBRATE;
INFILE "T-RATE/T-RATE-FORMATTED.csv"
DELIMITER = ","
…

Jinhua Wang
- 1,679
- 1
- 17
- 44
0
votes
3 answers
subtract rows from data frame in R with two factors using zoo or better package
I have a data.frame ordered by companies ("gvkey") and calendar quarters ("datafqtr") and and additional variable (for example, "day")
gvkey datafqtr dvy
1 1001 1983Q1 0.50
2 1001 1983Q2 1.50
3 1001 1983Q3 2.00
4 1001 1983Q4 4.50
5 …

dleal
- 2,244
- 6
- 27
- 49
0
votes
2 answers
linking crsp and compustat in R via WRDS
I am using R to connect to WRDS. Now, I would like to link compustat and crsp tables. In SAS, this would be achieved using macros and the CCM link table. What would be the best way to approach this topic in R?
PROGRESS UPDATE:
I downloaded crsp,…

Timo Predoehl
- 49
- 5
-1
votes
1 answer
Configure Stata 16 to work with Postgres WRDS Database on a Apple Silicon Mac
I am currently trying to run some Stata code related to the WRDS database for my Ph.D. It is a postgres database requiring some configuration via ODBC. While isql connection via Terminal works, the command odbc list in Stata returns the following…