Discussion:
Complete Noob here, but have SPSS questions...
(too old to reply)
r***@gmail.com
2020-01-09 19:41:45 UTC
Permalink
My apologies if this is not the correct forum for questions, like this. If so, please point me in the right direction as to where to ask?

I have never used SPSS.

I am a programmer by trade. I have been tasked with creating an application that will have a SQL Server data store. Someone at that client wants to use SPSS for reporting on that data store.

Simple enough so far.

Can SPSS handle foreign keys in tables? That is, if I have a Parent table, and a Children table with multiple Children records pointing back to a single Parent record, how does SPSS handle that? Will SPSS see that connection in the database schema, or does the user have to do that manually?
Bruce Weaver
2020-01-09 21:43:01 UTC
Permalink
Post by r***@gmail.com
My apologies if this is not the correct forum for questions, like this. If so, please point me in the right direction as to where to ask?
I have never used SPSS.
I am a programmer by trade. I have been tasked with creating an application that will have a SQL Server data store. Someone at that client wants to use SPSS for reporting on that data store.
Simple enough so far.
Can SPSS handle foreign keys in tables? That is, if I have a Parent table, and a Children table with multiple Children records pointing back to a single Parent record, how does SPSS handle that? Will SPSS see that connection in the database schema, or does the user have to do that manually?
If I follow you, the SPSS user will have two datasets open, Parent & Children. For any analysis involving variables from both datasets, one would have to merge the two files. The most common way to do that is via the MATCH FILES command. Here is the Command Syntax Reference manual info for MATCH FILES:

https://www.ibm.com/support/knowledgecenter/en/SSLVMB_26.0.0/statistics_reference_project_ddita/spss/base/syn_match_files.html

Notice the distinction between the FILE and TABLE sub-commands. The former is used for doing 1-to-1 matches, the latter for 1-to-many or many-to-1 matches. You can see some simple examples of both on this UCLA tutorial page:

https://stats.idre.ucla.edu/spss/modules/match-merging-data-files/

I hope I have understood your question.

Finally, note that this old usenet discussion forum is not terribly active any more. A better place to post SPSS questions these days is the SPSSX-L mailing list. An easy way to get access to it is via the Nabble archive:

http://spssx-discussion.1045642.n5.nabble.com/

Click the <more options> link at the top of that page for instructions on how to join the actual mailing list.

HTH.
Rich Ulrich
2020-01-09 22:49:07 UTC
Permalink
Post by r***@gmail.com
My apologies if this is not the correct forum for questions, like this. If so, please point me in the right direction as to where to ask?
I have never used SPSS.
I am a programmer by trade. I have been tasked with creating an application that will have a SQL Server data store. Someone at that client wants to use SPSS for reporting on that data store.
Simple enough so far.
Can SPSS handle foreign keys in tables? That is, if I have a Parent table, and a Children table with multiple Children records pointing back to a single Parent record, how does SPSS handle that? Will SPSS see that connection in the database schema, or does the user have to do that manually?
I agree with Bruce, that you should check the Nabble
archive for an answer, and if you need to ask more, (join
the list, then) pose the question to the SPSS List. I
remember questions asked about using SQL in the past,
but I don't remember recent ones. But I think there are
still folks there who know about it. Whereas, Bruce and
I know little.

I have /never/ used SPSS to access SQL but I think
I recall a different answer than what Bruce provided.
Bruce suggests that two or more files might be separately
imported to SPSS. That should be possible, but it might
not be necessary.

I /think/ that I recall that SPSS can invoke an "SQL engine"
to which the user passes, in quotes, most of the SQL-native
commands for linking and selecting cases and variables.

I think there were limitations and specifics that were
important, concerning particular outside products.
--
Rich Ulrich
Loading...