Hello All,
I am trying to import d.ta file and append them, what is wrong with this code? For some reason it only uses the first file from 1995, but does not continue with the subsequent years. Thanks in advance
clear all
cd "mydir"
save file_all_green, replace emptyok
forvalues i= 1995(1)2018 {
use country_partner_hsproduct6digit_year_`i',clear
keep year export_value location_code partner_code hs_product_code
append using "file_all_green"
save file_all_green,replace
}
Related Posts with Loop and Append .dta files
Update to -robreg- available from SSCThanks to Kit Baum, an update to the -robreg- package is available from SSC. To install the update, …
generating series variable with specific conditionhello and good day to all, this is a part of my data : Code: date country wpui_code wpui …
how to drop a bar like this , thanks!How to drop a bar like this ,thanks very much! * Example generated by -dataex-. To install: ssc ins…
merging multiple files in a folderHi, I am merging multiple files in a folder, using the code below. the master file (named PED_DAY_A…
Dates: conversion and formattingDear Statalists, I am using monthly data that are like "01jan1980" "01feb1980" etc. After the upload…
Subscribe to:
Post Comments (Atom)
0 Response to Loop and Append .dta files
Post a Comment