Upload data in MS_xlsx format onto SPSS

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

Upload data in MS_xlsx format onto SPSS

jing zhang-2
I tried to upload data in MS_xlsx format onto SPSS by using the "open
database" sequence in SPSS. However, it failed to connect.



Here is error message:

"SQLExecDirect failed :[Microsoft][ODBC Excel Driver] The connection for
viewing your linked Microsoft Excel worksheet was lost".



Your help will be appreciated!



Jing

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: Upload data in MS_xlsx format onto SPSS

jing zhang-2
I am trying to use Recode to create a categorical variable. However, I need
to do so by treating  "RespondentId" as a string variable, not a numeric one
as shown below. Your help will be highly appreciated.

 Thanks,
Jason
-------------------------------------------------------
(Example by treating  "RespondentId" as a numeric variable.)
RECODE

  RespondentId

(0 thru 59999=1) (60000 thru 69999=2) (70000 thru 97085 =3)     (ELSE=4)
INTO  IDNEW .

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: Recoding a string variable

Richard Ristow
NOTE: The original inquiry was posted with subject line
"Re: Upload data in MS_xlsx format onto SPSS".
I remind us all that it's very helpful, when posting, to use subject
lines that reflect the subject.

At 02:08 PM 8/21/2008, jing zhang wrote:

>I am trying to use Recode to create a categorical variable. However,
>I need to do so by treating  "RespondentId" as a string variable,
>not a numeric one.
>-------------------------------------------------------
>(Example by treating  "RespondentId" as a numeric variable.)
>RECODE
>   RespondentId
>  (0     thru 59999=1) (60000 thru 69999=2)
>  (70000 thru 97085=3) (ELSE=4)
>  INTO  IDNEW .

RECODE works fine with string variables. Assuming that "RespondentId"
is a string whose values have *exactly* the form you've given and are
left-justified (beware of '0', on both counts), it's simply

>RECODE
>   RespondentId
>  ('0'     thru '59999'=1) ('60000' thru '69999'=2)
>  ('70000' thru '97085'=3) (ELSE=4)
>  INTO  IDNEW .

If "RespondentId" is always a string representation of a number, but
its exact format cannot be guaranteed, convert it to a number and
then recode the number:

COMPUTE #IdNum = NUMBER(RespondentId,F8).
>RECODE
>   #IdNum
>  (0     thru 59999=1) (60000 thru 69999=2)
>  (70000 thru 97085=3) (ELSE=4)
>  INTO  IDNEW .

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD