stata 当前日期时间作为文件名
global root="d:\statashu" local wjm=subinstr(subinstr("`c(current_date)'",":","",.)," ","",.) local year=year(date("`wjm'","DMY")) local month= substr("00"+string(month(date("`wjm'","DMY"))),-2,2) local day= day(date("`wjm'","DMY")) local sj=subinstr(subinstr("`c(current_time)'",":","",.)," ","",.) local wjma="`year'`month'`day'`sj'" disp "`wjma'" mkdir "`wjma'" global work="$root\"+"`wjma'" use chfs\chfs2015_hh_20191120_version14,clear keep hhid track keep if track==0 save $work\new1,replace