The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Merging data files » Merging DHS data in Stata
Re: Merging DHS data in Stata [message #5501 is a reply to message #5493] Mon, 01 June 2015 13:00 Go to previous messageGo to previous message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 3214
Registered: February 2013
Senior Member
Our SPSS Specialist, Ladys Ortiz, took a closer look at your syntax, and had the following comments:

You are missing a period after the "save" command, and the 1st "execute" command. Also, you are referencing "dataset6" where you are expected to be referencing "dataset1". Following is the syntax that you can use or compare to yours:

GET
FILE='C:\Tanzania2011\TZAR6AFL.SAV'.
SORT CASES BY hivCLUST(A) hivNUMB(A) hivLINE(A).
SAVE OUTFILE='C:\Tanzania2011\TZAR6AFL.SAV'.

GET
FILE='C:\Tanzania2011\TZIR6AFL.SAV'.
SORT CASES BY V001(A) V002(A) V003(A).

RENAME VARIABLES (V001 V002 V003 =
hivCLUST hivNUMB hivLINE).
EXECUTE.

MATCH FILES /FILE=*
/FILE='C:\Tanzania2011\TZAR6AFL.SAV'
/BY hivCLUST hivNUMB hivLINE.
EXECUTE.

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to match women to their husbands
Next Topic: Merging HR and PR Files
Goto Forum:
  


Current Time: Wed Dec 25 21:30:35 Coordinated Universal Time 2024