Custom Search

Tutorial:
SQL
VBA

SPSS

Data Extraction
MS-Server2005 To SPSS
Access To SPSS
Txt File To SPSS

Home >> SPSS

Before performaing any analysis you need to bring data into SPSS. Data may be located at different location for example MS-Server, Oracle, Access and more. It is also possible data need to be entered directly into SPSS. Here are the instructions to extract data from popular databases.

MS-Server2005 To SPSS

Use the following instructions to extract data from MS-Server 2005 into SPSS.
Click on file menu > Open Database > New Query as show below.

In the Database Wizard click on data source button to define new database.

From ODBC Soruce Administrator click on Add button to add new data source as shown below

In the Create New Data source dialog box select the driver corresponding to MS-Server/SQL Server and click on Finish as shown below

In the Create New Data Source SQL Server dialog box enter the Name for the connection, Description and locate the server in Server combo box and click on next button

The next dialog box will ask you to define username and password for the connection. You can either use Window NT authentication mode. In this case you no need to specify username and password, window will automatically select username and password set for the window. Or you can use sql server authentication mode where you have to specify username and password. After selecting authentication mode click on next button.

In the next window select the database that you want to use to extract the data. Leave other options as it is and click on next

Leave the option as it is in this dialog box as well and click on finish

In next dialog box you can check the connection by clicking on Test Data Source. Finally click on ok.

In the following window you can see the new data source "SQLServer-SPSS" that we just created. Now click on next.

Next dialog box is Limit Retrived Cases. As the name suggests in this dialog box you can define the criteria that satisfied your requirements by limiting other records. After defining selection criteria click on Next.

In next dialog box you can see all the variable you are extracting from ms server. Spss also provide option to convert or record string datatype variables as Numeric.

In the following dialog box SPSS will show you the SQL query corresponding to your selection criteria. You can save the query if you want to use in future. Finally click on Finish to view the extracted data.


Access To SPSS










Txt File to SPSS

Click on File > Read Text Data as shown below.

In the following text box check No and click on Next button

Next dialog box will ask you two questions. First is specify how the variables are arranged Delimited or Fixed. second is does first line contains field or variable name? Then click next

In the following dialog box click the row number where your data actually starts in text file. In the next frame specify does one record is corresponding to whole line or number of variable. Finally specify number of records you want to extract interms of number or percentage or all records. Then click on next button

In the next dialog box specify how variables are seprated in the text file i.e. comma, tab, space etc and click on next.

In the next dialog box you can select the data type for each variable. After setting variable data types click on next button.

In the next dialog box you can save the extracted setting for future use or you can simply click on finish to preview the data into SPSS.

Excel

Go to Top