Connects to WRDS servers via SSH, runs SAS code with qsas, executes PostgreSQL queries, submits batch jobs, and transfers files to/from WRDS.
Ships in ai-asset-pricing. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
This skill provides guidance on connecting to and working with WRDS (Wharton Research Data Services) servers via SSH.
/wrds-ssh -- connect to WRDS and explore the server/wrds-ssh submit analysis.sas -- upload and submit a SAS job/wrds-ssh download ~/scratch/output.csv -- transfer results backThe SSH connection to WRDS is pre-configured. Connect using:
ssh wrds
This connects to the WRDS cloud server (wrds-cloud-sshkey.wharton.upenn.edu) via the ~/.ssh/config host alias.
~ (on WRDS)~/scratch (symlink — see CLAUDE.md setup instructions)All SSH commands use single quotes to avoid local shell expansion. Paths like ~/scratch/ expand on the remote side.
For quick commands or testing:
ssh wrds "command_here"
IMPORTANT: On WRDS Cloud, you cannot run sas directly. You must use qsas which submits jobs to the Grid Engine queue. Jobs run asynchronously.
Step 1: Create the SAS program file on WRDS:
ssh wrds 'cat > ~/scratch/myprogram.sas << EOF
options nonotes nosource;
proc contents data=crsp.dsf; run;
EOF'
Step 2: Submit the job:
ssh wrds 'qsas ~/scratch/myprogram.sas'
This returns immediately with a job ID (e.g., Your job 12345678 ("myprogram.sas") has been submitted).
Step 3: Wait for completion and check output:
# Check if job is still running
ssh wrds 'qstat -u $(whoami)'
# Once complete, check the log for errors
ssh wrds 'tail -50 ~/scratch/myprogram.log'
# View the listing output
ssh wrds 'cat ~/scratch/myprogram.lst'
Output files: SAS creates .log and .lst files in the same directory as the .sas file.
NOTE: The -sync y option does NOT work on WRDS Cloud. Jobs are always asynchronous. Use sleep or poll qstat to wait for completion.
Note: Direct local
psql service=wrdsis always preferred over SSH-tunneled psql. The SSH SQL examples below are a fallback for when local psql is not available. The specialist agents (crsp-wrds-expert, optionmetrics-wrds-expert) always use local psql.
Use psql directly with ~/.pgpass for automatic authentication:
# Single query
psql service=wrds \
-c "SELECT * FROM crsp.dsf WHERE date > '2025-01-01' LIMIT 10;"
# Output to CSV
psql service=wrds \
-c "COPY (SELECT * FROM optionm.securd LIMIT 100) TO STDOUT WITH CSV HEADER" > output.csv
Via SSH (fallback):
ssh wrds "psql -h wrds-pgdata.wharton.upenn.edu -d wrds -c 'SELECT * FROM crsp.dsf LIMIT 10;'"
ssh wrds 'qpython ~/myscript.py'
scp local_file.sas wrds:~/scratch/
scp wrds:~/scratch/results.csv ./
rsync -avz wrds:~/scratch/output/ ./local_output/
| Path | Purpose | Notes |
|---|---|---|
~ | Home directory | Permanent storage, limited quota |
~/scratch | Scratch space (symlink) | Large temporary storage, auto-deleted after 48 hours |
/wrds/ | Data libraries | SAS libraries for all WRDS databases |
| Library | Database |
|---|---|
crsp | CRSP Stock/Index |
comp | Compustat |
optionm | OptionMetrics |
taq | TAQ Monthly |
taqmsec | TAQ Millisecond |
ibes | I/B/E/S |
tfn | Thomson Reuters |
wrdsapps | WRDS-created linking tables |
Always write large intermediate files to ~/scratch/ rather than home directory.
After submitting a batch job:
ssh wrds "qstat"
For long-running interactive sessions:
ssh wrds "screen -S mysession"
Detach with Ctrl+A, D. Reattach with:
ssh wrds "screen -r mysession"
Never download raw WRDS data. Process on the server and download only aggregated results.
ssh wrds 'gzip ~/scratch/large_file.csv'
scp wrds:~/scratch/large_file.csv.gz ./
Option A: Upload existing SAS file
# 1. Upload SAS program
scp analysis.sas wrds:~/scratch/
# 2. Submit job (returns immediately)
ssh wrds 'qsas ~/scratch/analysis.sas'
# 3. Wait and check job status
ssh wrds 'sleep 60 && qstat -u $(whoami)'
# 4. Check log for errors
ssh wrds 'tail -50 ~/scratch/analysis.log'
# 5. View results or download
ssh wrds 'cat ~/scratch/analysis.lst'
scp wrds:~/scratch/results.csv ./
Option B: Create and run SAS code remotely
# 1. Create SAS file via heredoc
ssh wrds 'cat > ~/scratch/analysis.sas << EOF
options nonotes nosource;
proc sql;
create table out as
select * from crsp.dsf where date > "01JAN2025"d;
quit;
proc export data=out outfile="~/scratch/results.csv" dbms=csv replace; run;
EOF'
# 2. Submit and wait
ssh wrds 'qsas ~/scratch/analysis.sas'
ssh wrds 'sleep 90 && grep -E "ERROR|WARNING|NOTE:.*created" ~/scratch/analysis.log'
# 3. Download results
scp wrds:~/scratch/results.csv ./
Connection timeout:
Permission denied:
Job stuck in queue:
ssh wrds "qstat -u username"Out of disk space:
ssh wrds 'rm -rf ~/scratch/temp*'ssh wrds "quota -s"What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/ai-asset-pricing:wrds-sshfrom ai-asset-pricing
ai-asset-pricing@fin-skills is listed by howard-lynn-ye/fin-rsi — review the source before installing
npx claudepluginhub howard-lynn-ye/fin-rsi --plugin ai-asset-pricing38 skills in this plugin
/bond-dataReference for the Dickerson corporate bond dataset: column mappings between WRDS and PyBondLab, rating encoding, return definitions, signal clusters, and data gotchas. Auto-apply when loading bond data for PyBondLab analysis.Other plugins' skills for the same job