WSID Values for Database Queries

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

WSID Values for Database Queries

Ben Cohen
All:
 
We access databases using SPSS through an ODBC connection. We'd like to use the same SPSS query to access the data, but it seems that the WSID value specified in our code (see below) must change for each network user.  Can a generic or universal value for WSID be used for all users on our network? Otherwise, it seems we need to change the WSID value for each user and have different versions of code.
 
Thanks for any feedback.
 
____
 
GET DATA /TYPE=ODBC /CONNECT=

'DSN=ELECT_New_IP;UID=**ysj**s;PWD=.n/w,*.($b-`,E;APP=SPSS For'+

' Windows;WSID=BCOHEN_NB'

/SQL = 'SELECT StudentID, SchoolID, UserID, FormDate, EnrollmentDate, '+

' TerminationDate, lastUpdate, GPAupdated, SSN, '

 

___

 

 

 

__________________________________________
Benjamin A. Cohen, Ph.D.
Statewide Evaluation Director
Center for Schools and Communities
275 Grandview Ave., Camp Hill, PA 17011
[hidden email]
717-763-1661 x159
 


This message may contain privileged, confidential information that is exempt from disclosure under applicable law. If you are not the addressee indicated in this message or if it does not apply to you or your organization, you may not copy or deliver this message to anyone. In such a case, please delete this message and reply to the sender immediately. Thank you.
Reply | Threaded
Open this post in threaded view
|

Re: WSID Values for Database Queries

Marks, Jim
Ben:

You can standardize the code as follows:

INCLUDE file = :\spss\connections.sps.

GET DATA /TYPE=ODBC   /CONNECT= !c_db1 /
.... Rest of command.

(notice that " /CONNECT= !c_db1 / " is one one line-- the macro will insert a line break).

Each user needs to create their own version of the "connections.sps" file with something like this:

DEFINE !c_db1 ()
 !QUOTE( 'DSN=ELECT_New_IP;UID=**ysj**s;PWD=.n/w,*.($b-`,E;APP=SPSS For Windows;WSID=BCOHEN_NB')
!ENDDEFINE.

The INCLUDE statement reads the user's connection string into spss and the GET DATA uses the connection string to run the GET DATA


(Smarter people can me can tell you how to run the INCLUDE statement when you launch spss... I think you will find it in the archives.)

--jim


-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Ben Cohen
Sent: Monday, October 23, 2006 10:16 AM
To: [hidden email]
Subject: WSID Values for Database Queries

All:

We access databases using SPSS through an ODBC connection. We'd like to use the same SPSS query to access the data, but it seems that the WSID value specified in our code (see below) must change for each network user.  Can a generic or universal value for WSID be used for all users on our network? Otherwise, it seems we need to change the WSID value for each user and have different versions of code.

Thanks for any feedback.

____

GET DATA /TYPE=ODBC /CONNECT=

'DSN=ELECT_New_IP;UID=**ysj**s;PWD=.n/w,*.($b-`,E;APP=SPSS For'+

' Windows;WSID=BCOHEN_NB'

/SQL = 'SELECT StudentID, SchoolID, UserID, FormDate, EnrollmentDate, '+

' TerminationDate, lastUpdate, GPAupdated, SSN, '



___







__________________________________________
Benjamin A. Cohen, Ph.D.
Statewide Evaluation Director
Center for Schools and Communities
275 Grandview Ave., Camp Hill, PA 17011
[hidden email]
717-763-1661 x159



This message may contain privileged, confidential information that is exempt from disclosure under applicable law. If you are not the addressee indicated in this message or if it does not apply to you or your organization, you may not copy or deliver this message to anyone. In such a case, please delete this message and reply to the sender immediately. Thank you.