Syntax which can read data from the 'dat' file into an outpu

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

emahembe
Posts: 1
Joined: Fri Apr 13, 2012 7:09 am

Syntax which can read data from the 'dat' file into an outpu

Postby emahembe » Fri Apr 13, 2012 7:32 am

Hello,

I need help good people. I'm trying to write a syntax in SPSS which is able to read data from the 'dat' file into an output 'sav' file. The syntax should contain all variable and value labels. Can somebody help?

Eddie"
Penguin_Knight
Posts: 473
Joined: Thu Apr 05, 2012 5:58 pm

Re: Syntax which can read data from the 'dat' file into an o

Postby Penguin_Knight » Fri Apr 13, 2012 4:46 pm

emahembe wrote:Hello,

I need help good people. I'm trying to write a syntax in SPSS which is able to read data from the 'dat' file into an output 'sav' file. The syntax should contain all variable and value labels. Can somebody help?

Eddie"
I use SPSS 18 (PC) so the command can differ slightly.

To import:
- Go to "File > Open > Data"
- Go to the directory where you .dat data set is supposed to be
- At the "Files of type", it should say "PASW Statistics (*.sav)". Click that drop-down menu and choose "Text (*.txt, *.dat)"
- Follow the Wizard by telling SPSS how is the .dat file structured
- At the end (Step 6), check "Yes" under the box "Would you like to paste the syntax?", then click "Finish"

Note that .dat files are usually just a grid consisted of variable names and data. They seldom come with variable and value labels. You'll have to write the syntax for that. See this for an intro: http://statlab.stat.yale.edu/help/doco/spss_basics.jsp

To save:
- Go to "File > Save As"
- Pick your directory
- Decide your file name
- Click "Paste" for the syntax.

Who is online

Users browsing this forum: No registered users and 2 guests

cron