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
标签:subinstr,wjm,wjma,文件名,month,日期,stata,date,local From: https://www.cnblogs.com/xkdn/p/17442225.html