/* Append Example #1 */ cd "C:\Documents and Settings\HP_Owner\Desktop" clear input pid str9 datestamp bglevel site 1525 "03/17/06" 64 4 1525 "03/17/06" 165 4 1525 "03/17/06" 72 4 1525 "03/17/06" 123 4 1683 "05/05/08" 156 4 1683 "05/05/08" 141 4 1683 "05/06/08" 121 4 end save site4, replace clear input pid str9 datestamp bglevel site 1634 "04/22/05" 213 1 1634 "04/27/05" 117 1 1701 "04/09/08" 232 1 1701 "04/09/08" 324 1 1701 "04/10/08" 250 1 1701 "04/11/08" 213 1 end save site1, replace use site1, clear append using site4 list, sepby(pid site) noobs erase site1.dta erase site4.dta /* Append Example #2 */ clear input pid str9 datestamp bglevel site 1525 "03/17/06" 64 4 1525 "03/17/06" 165 4 1525 "03/17/06" 72 4 1525 "03/17/06" 123 4 1683 "05/05/08" 156 4 1683 "05/05/08" 141 4 1683 "05/06/08" 121 4 end save site4, replace clear input pid str9 datestamp bglevel site hba1c 1634 "04/22/05" 213 1 8.4 1634 "04/27/05" 117 1 7.3 1701 "04/09/08" 232 1 8.1 1701 "04/09/08" 324 1 12.4 1701 "04/10/08" 250 1 9.0 1701 "04/11/08" 213 1 8.4 end save site1, replace use site1, clear append using site4 list, sepby(pid site) noobs erase site1.dta erase site4.dta