version 14
drop _all
cap mkdir temp

if ( `c(MP)' ) set processors 1
local 0 `0'
local 0: subinstr local 0 ";" ","


cap program drop sc_est
program sc_est
    syntax, [database(str) neg_w rpath(str)]
    log using temp/sc_`database'`neg_w'.log, replace
    quietly do source/lib/stata/sc/programSynthEst.do

    local dir_simulations "../datastore/analysis/release_large/simulation"
    local dir_dataout     "../datastore/analysis/release_large/estimation/SyntheticControl"

    synth_est, runs(1000)                 ///
               database(`database')       ///
               dir_sim(`dir_simulations') ///
               dir_dataout(`dir_dataout') ///
               rpath(`rpath')             ///
               `neg_w'

end


disp "`0'"
sc_est `0'

exit
