*! version 1.0.1 JPR 9-Mar-93 updated 12-Mar-93. program define limport version 3.0 parse "`*'", parse(" ,") if "`*'"=="" | "`1'"=="," { error 198 } local fn "`1'" mac shift local options "CLEAR REPLACE" /* mean the same thing */ parse "`*'" if "`replace'"!="" { local clear "clear" /* clear subsumes replace */ } /* Look for transfer command */ local cmd "$S_LIMPO" local suffix "$S_LIMPO2" if "`cmd'"=="" { local cmd "c:\st\transfer" } if "`suffix'"=="" { local suffix "> nul" } capture confirm file `cmd'.exe if _rc { capture confirm file `cmd'.com if _rc { capture confirm fie `cmd'.bat if _rc { di in red "I cannot find Stat/Transfer (`cmd')" exit 799 } } } /* Eliminate existing file if replace */ confirm file `fn'.wk1 /* See similar code-fix in lexport.ado. if "`clear'"!="" { confirm new file `fn'.dta } else { capture erase `fn'.dta } */ if "`clear'"=="" & "`replace'"=="" { capture confirm file `fn'.dta if !_rc { di in red "file `fn'.dta already exists" exit 602 } } capture erase `fn'.dta /* Translate */ ! `cmd' `fn'.wk1 `fn'.dta `suffix' capture confirm file `fn'.dta if _rc { di in red "I issued the command:" _n di in red " `cmd' `fn'.wk1 `fn'.dta `suffix'" _n di in red "but it evidently was not successful because" di in red "`fn'.dta still does not exist." exit 799 } use `fn', `clear' end exit comments: $S_LIMPO is the transfer command, default "c:\st\transfer" $S_LIMPO2 is the suffix, default "> nul" The command is assumed to be: $S_LIMPO fn.wk1 fn.dta $S_LIMPO2 e.g., c:\st\transfer fn.wk1 fn.dta > nul