📄 merge.dlg
字号:
/*
merge.dlg
*! VERSION 2.0.0 04apr2005
*/
VERSION 9.0
INCLUDE _std_large
INCLUDE header
HELP hlp1, view("help merge")
RESET res1
DIALOG main, tabtitle("Main") ///
label("merge - Merge dataset in memory with dataset on disk")
BEGIN
GROUPBOX gb_type _lft _top _iwd _ht8, ///
label("Type of merge")
RADIO rb_1_to_1 _ilft _ss _inwd ., ///
first ///
label("One-to-one on key variables") ///
onclickon(script main_1to1_on) option(unique)
RADIO rb_1_to_m @ _ss @ ., ///
onclickon(script main_1tom_on) option(uniqmaster) ///
label("One-to-many on key variables (unique key for data in memory)")
RADIO rb_m_to_1 @ _ss @ ., ///
onclickon(script main_mto1_on) option(uniqusing) ///
label("Many-to-one on key variables (unique key for data on disk)")
RADIO rb_1_to_1_ob @ _ss @ ., ///
last ///
label("One-to-one by observation") ///
onclickon(script main_1_to_1_ob_on)
GROUPBOX gb_merge _lft _xls _iwd _ht12, ///
label("Merge dataset in memory with dataset on disk")
TEXT tx_filename _ilft _ss _ibwd ., ///
label("Filename of dataset on disk:")
FILE fi_filename @ _ss @ ., ///
error("Filename of dataset on disk") ///
filter("Stata Dataset (*.dta)|*.dta|All Files (*.*)|*.*") ///
defext(dta) label("Browse...")
TEXT tx_var @ _ls @ ., ///
label("Key variables: (match variables)")
VARLIST vl_varlist @ _ss @ ., ///
label("Key variables")
CHECKBOX ck_sort @ _ls @ ., ///
label("Sort key variables when necessary") option(sort) ///
onclickon(program main_sort_on) ///
onclickoff(program main_sort_off)
END
SCRIPT main_1to1_on
BEGIN
main.tx_var.show
main.ck_sort.show
main.vl_varlist.show
END
SCRIPT main_1tom_on
BEGIN
main.tx_var.show
main.ck_sort.hide
main.vl_varlist.show
END
SCRIPT main_mto1_on
BEGIN
main.tx_var.show
main.ck_sort.hide
main.vl_varlist.show
END
SCRIPT main_1_to_1_ob_on
BEGIN
main.tx_var.hide
main.ck_sort.hide
main.vl_varlist.hide
END
DIALOG opt, tabtitle("Options")
BEGIN
TEXT tx_keep _lft _top _iwd ., ///
label("Keep the following variables: (If not specified, all variables are kept)")
VARLIST vl_keep _lft _ss _iwd ., ///
option(keep) label("Keep the following variables")
TEXT tx_merge _lft _ls _iwd ., ///
label("Specify name of new variable to mark result of merge:")
EDIT ed_merge _lft _ss _vnwd ., ///
max(32) option(_merge) default("_merge") ///
label("Specify name of new variable to mark result of merge")
CHECKBOX ck_nolabel _lft _ls _iwd ., ///
option(nolabel) label("Do not copy value label definitions from file")
DEFINE _y @y
CHECKBOX ck_nonotes @ _ms @ ., ///
label("Do not copy notes from file") option(nonotes)
CHECKBOX ck_update @ _ms @ ., ///
option(update) ///
label("Replace missing data in memory with data from file") ///
onclickon(opt.ck_replace.enable) ///
onclickoff(opt.ck_replace.disable)
CHECKBOX ck_replace @ _ms @ ., ///
option(replace) nomem label("Replace nonmissing data in memory with data from file")
CHECKBOX ck_nokeep @ _ms @ ., ///
option(nokeep) label("Drop observations in dataset on disk that do not match")
END
PROGRAM command
BEGIN
require main.fi_filename
put "merge "
if main.rb_1_to_1 | main.rb_1_to_m | main.rb_m_to_1 {
require main.vl_varlist
put " " main.vl_varlist
}
put " " "using "
put `"""'
put main.fi_filename
put `"""'
beginoptions
option radio(main rb_1_to_1 rb_1_to_m rb_m_to_1)
option main.ck_sort
optionarg opt.vl_keep
option opt.ck_nolabel
option opt.ck_nonotes
option opt.ck_update
option opt.ck_replace
option opt.ck_nokeep
optionarg /hidedefault opt.ed_merge
endoptions
END
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -