Skip to content

Instantly share code, notes, and snippets.

@tmwatchanan
Created September 24, 2020 03:49
Show Gist options
  • Save tmwatchanan/2439d3bf2cf1c9d7439377a0e80510be to your computer and use it in GitHub Desktop.
Save tmwatchanan/2439d3bf2cf1c9d7439377a0e80510be to your computer and use it in GitHub Desktop.
libname mydata 'C:\Users\PhotonUser\My Files\Temporary Files';
proc import datafile="C:\Users\PhotonUser\My Files\Temporary Files\pcp_mean-2010_2014-all_counties.csv"
out=mydata.pcp dbms=CSV;
run;
proc import datafile="C:\Users\PhotonUser\My Files\Temporary Files\farmers.csv"
out=mydata.farmers dbms=CSV;
run;
proc sort data=mydata.pcp;
by state county;
run;
proc sort data=mydata.farmers;
by state county;
run;
data mydata.merged;
merge mydata.farmers(in=a keep=State County farmer_id) mydata.pcp(in=b keep=State County pcp__2010_2014_mean_);
by state county;
if a and b;
run;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment