LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (February 2006)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Mon, 13 Feb 2006 17:08:51 -0500
Reply-To:   Siraj Ur-rehman <Siraj.Ur-rehman@Ipsos-ASI.com>
Sender:   "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:   Siraj Ur-rehman <Siraj.Ur-rehman@Ipsos-ASI.com>
Subject:   Re: ODBC connection string-- Macro
Content-Type:   text/plain; charset="us-ascii"

Try to use INCLUDE FILE instead of INSERT FILE.

-----Original Message----- From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] On Behalf Of Marks, Jim Sent: Monday, February 13, 2006 5:01 PM To: SPSSX-L@LISTSERV.UGA.EDU 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" !ENDDEFINE.

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= !conn /SQL = 'SELECT var1, var2 var3 FROM table2' /ASSUMEDSTRWIDTH=255 . CACHE. EXECUTE.

The macro expansion appears correct-- it generates the entire string with a single apostrophe on each side. However, the syntax produces two errors:

>Error. Command name: GET DATA >No backslash ("\") prior to the SQL token was found This command not >executed.

>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.)

TIA

--jim


Back to: Top of message | Previous page | Main SPSSX-L page