Solution ID: 100009718 Product: SPSS Base Version: 10.0 Question Type: Data Import-Export Question Subtype: ODBC Title: Writing SPSS data back to a database. Q. I've read data into SPSS 10 from a database. I've made various changes to the file, and I'd like to write my results back into my database as a new table. Can I do that with SPSS 10? A. Using the SAVE TRANSLATE command in syntax, you can write back to any database where you have a working ODBC connection. Please follow these instructions: 1. Before using SAVE TRANSLATE, you must have an ODBC data source defined, and it must be able to read data into SPSS. 2. Using the Database Wizard, read in a table from the database you want to write data back into. At step 6, choose to paste the syntax. You will need a portion of this syntax to create the SAVE TRANSLATE command. Here is an example of the type of syntax the wizard will build: GET DATA /TYPE=ODBC /CONNECT= 'DSN=Oracle8;UID=SCOTT;PWD=,T$M-y,v.c' /SQL = 'SELECT "T4"."EMPNO" AS "EMPNO", "T4"."ENAME" AS "ENAME", "T4"."JOB" AS ' '"JOB", "T4"."MGR" AS "MGR", "T4"."HIREDATE" AS "HIREDATE", "T4"."SAL" ' 'AS "SAL", "T4"."COMM" AS "COMM", "T4"."DEPTNO" AS "DEPTNO" FROM ' '"SCOTT"."EMP" "T4"' . 3. Copy the entire /CONNECT string. This string is used in the SAVE TRANSLATE syntax. For example, this is how the edited SAVE TRANSLATE command looks after adding the connect string from above: SAVE TRANSLATE TYPE=ODBC /connect='DSN=Oracle8;UID=SCOTT;PWD=tiger' /table="EMP3" /unselect=retain /replace /map. Every connect string will be different, depending on the driver. The connect string needs to match exactly the connect string in the GET DATA command, including all of the line breaks. If the password is encoded, the plain text password should be substituted. 4. For the table subcommand, use the name you want the table to have in the database, and make sure it is surrounded by quotes. The table name should not currently exist in the database. The rest of the syntax does not need to be edited. 5. Run the syntax. You should receive a listing of which variables and their type that was written to the database.