converting a syntax file to a data file

Moderators: statman, Analyst Techy, andris, Fierce, GerineL, Smash

gmckenna
Posts: 4
Joined: Wed Feb 08, 2012 12:28 pm

converting a syntax file to a data file

Postby gmckenna » Wed Feb 08, 2012 12:48 pm

Hello all,
I have acquired a large public use micro-data file (PUMF) - the IALSS data set. It was provided to me as a syntax file. I have been trying to open it as/convert it to a data file but I am completely unfamiliar with how this might work. The file would have been originally saved by the vendor in 2007 in whatever the current SPSS version would have been and the file extension is .sps. The file is also saved as an ASCII file with extension .txt. I am using SPSS version 19. Any suggestions on how to convert this to a data file would be appreciated.
Greg
apeape
Posts: 56
Joined: Mon May 02, 2011 6:07 pm

Re: converting a syntax file to a data file

Postby apeape » Wed Feb 08, 2012 4:05 pm

If your files match what is typical, the syntax file will not contain the data. The data is in the text file.

The syntax file will be a set of instructions that tell SPSS how to read in the data from the text file with all the required labels and other variable information.

You should open SPSS and open the syntax file under the File -> Open Syntax command. At the top of the file you should see something like:

DATA LIST FREE
FILE ='c:\yourfile.txt'

Change the filepath so that it points to your file.

Go to Run -> All

If successful, SPSS will import the data from the text file. If not successful, carefully check the filename and filepath and try again. If still not successful, post back here with any error messages you get.
gmckenna
Posts: 4
Joined: Wed Feb 08, 2012 12:28 pm

Re: converting a syntax file to a data file

Postby gmckenna » Wed Feb 08, 2012 4:36 pm

Perfect! It worked. You were right about carefully checking the filename and filepath... I had to play with the placement of the quotation marks to get it to work properly.

Thanks for your help. I'd already lost a day trying to figure out how to get to the data. Very helpful!

Greg

Who is online

Users browsing this forum: No registered users and 1 guest

cron