Skip to content

Commit

Permalink
Create cams_data_dump.do
Browse files Browse the repository at this point in the history
  • Loading branch information
mle2718 committed Sep 13, 2024
1 parent 0f3f9fb commit 357416e
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions stata_code/data_extraction_processing/extraction/cams_data_dump.do
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#delimit ;

global firstyr 2000;
global lastyr = 2004;
clear;

/* landings */
/* leave off schema for TTS */
odbc load, exec("select * from cams_land cl
where year>=$firstyr and year<=$lastyr;") $myNEFSC_USERS_conn;

save $data_main/cams_land_$today_date_string.dta, replace;
export delimited using $data_main/cams_land_$today_date_string.csv, replace;


clear;
/*subtrip */
odbc load, exec("select * from cams_subtrip cst
where year>=$firstyr and year<=$lastyr;") $myNEFSC_USERS_conn;

save $data_main/cams_subtrip_$today_date_string.dta, replace;

export delimited using $data_main/cams_subtrip_$today_date_string.csv, replace;





/* orphan subtrip */
clear;
odbc load, exec("select * from CAMS_VTR_ORPHANS_SUBTRIP where year>=$firstyr and year<=$lastyr;") $myNEFSC_USERS_conn;

save $data_main/cams_orphan_subtrip_$today_date_string.dta, replace;
export delimited using $data_main/cams_orphan_subtrip_$today_date_string.csv, replace;

0 comments on commit 357416e

Please sign in to comment.