Join two files together (add variables)

The Join option of Tools|Combine, Sort and Merge SAV Files allows you to join two data files (SPSS (*.sav) or comma delimited (*.csv)) and save the joined files as an SPSS (*.sav) data file. As an example, the Join option would be useful if you have a primary data file that contains all closed end questions for each respondent and a secondary file that contains coded open end questions for the same set of respondents. You can use this option to join the closed end and open end questions together in one file with one record for each respondent.

 

Primary file

Choose Browse to select the primary data file. Use the Take variable names from first line of data file (*.csv data files only) option to use the variable names from the first line of the data file for comma delimited (*.csv) files. You can choose an SPSS (*.sav) or comma delimited (*.csv) data file as the Primary file.

 

 

Secondary file

Choose Browse to select the secondary data file. Use the Take variable names from first line of data file (*.csv data files only) option to use the variable names from the first line of the data file for comma delimited (*.csv) files. You can choose an SPSS (*.sav) or comma delimited (*.csv) data file as the Secondary file.

 

 

Output file

Choose Browse to navigate to the file path and folder destination for the Output file. The Output file can only be saved as an SPSS (*.sav) data file. You can enter a file name only without browsing to a file path/folder destination and WinCross will default the file path and folder for the output file to the path of the primary data file.

 

Variable list

The Variable list box displays variables from both the Primary file and the Secondary file.

 

File

The File column identifies where the variable resides, in Both files, in the Primary file or in the Secondary file.

 

Variable

The Variable column contains the variable name for all variables in either the Primary or Secondary files.

 

Include

 

Use data from

Find a variable

Allows you to enter search criteria to locate a specific variable. This is especially useful when there are many variables in your data files and you only want to find a specific variable or group of variables.

 

Next

Finds the next occurrence of the search value specified in Find a variable.

 

Show Next Duplicate

Finds the next variable that is found in both the Primary and Secondary files and has a File status of Both.

 

Merge if primary and secondary keys match

Choose the Merge if primary and secondary keys match option to base your output file on those records that have matching key fields.

 

Allow duplicate primary keys

If the Merge if primary and secondary keys match option is selected, you can choose to Allow duplicate primary keys being written to your output file. This option is not applicable unless the Merge if primary and secondary keys match option is selected.

 

Output primary records when no secondary record is found

Choose this option to write all primary records to the output file if there are more primary records than secondary records. If for example, the primary data file has 207 records but the secondary data file has 200 records, selecting this option will write all 207 records to the output file. This option can be used without selecting the Merge if primary and secondary keys match option. WinCross will always return the number of primary records when no secondary record is found but will only write the primary records to the output file when this option is selected.

 

Output secondary records when no primary record is found

Choose this option to write all secondary records to the output file if there are more secondary records than primary records. If for example, the secondary data file has 401 records but the primary data file has 397 records, selecting this option will write all 401 records to the output file. This option can be used without selecting the Merge if primary and secondary keys match option. WinCross will always return the number of secondary records when no primary record is found but will only write the secondary records to the output file when this option is selected.

 

Join

Choose Join to create the output file and display the applicable record counts.

 

Close

Selecting the Close button will close the Join dialog box.

 

Related topics:

Merge two or more files together

Sort a file by one or more variables