Try to use INCLUDE FILE instead of INSERT FILE.
From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] On Behalf Of
Sent: Monday, February 13, 2006 5:01 PM
Subject: ODBC connection string-- Macro
I am trying to implement a macro to carry ODBC connection information
across different syntax files. The macro has this form:
DEFINE !conn () "DSN=validdb;UID=validname;PWD=encryptedchars"
and is stored in the file c:\connect_string.sps .
I tried this sequence:
INSERT FILE = 'c:\connect_string.sps'.
GET DATA /TYPE=ODBC /CONNECT=
/SQL = 'SELECT var1, var2 var3 FROM table2'
The macro expansion appears correct-- it generates the entire string
with a single apostrophe on each side. However, the syntax produces two
>Error. Command name: GET DATA
>No backslash ("\") prior to the SQL token was found This command not
>Error # 1. Command name: /SQL
>The first word in the line is not recognized as an SPSS command.
>This command not executed.
The connection string appears to be ending the GET DATA command command.
"/SQL" is read as a separate command
I know the connection string and data base contents are good. If I copy
the connection string into the GET DATA command (with double or single
apostrophes) the syntax works as expected.
Any ideas? (I tried the / UNENCRYPTED subcommand, and that didn't work.)