SPSS 19 writing Stata files

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

SPSS 19 writing Stata files

Maclennan, Graeme S.
Dear SPSSers, I was just upgraded to SPSS 19 by our IT department (version 19.0.0). I tried to run some version 18 code which used to successfully write Stata's .dta files no probs.  Tracking this down it appears that 19 is not writing the .dta file. Not sure if this is something to do with me, or something in general? It is no biggy as Stata has an ado that reads SPSS, but I was just curious to see if the syntax below works for others?
Regards, Graeme.

**Begin***


dataset close all.
FILE HANDLE temp NAME = "c:\temp".
DATA LIST LIST
 / make (A15) mpg weight price .
BEGIN DATA.
"AMC Concord",22,2930,4099
"AMC Pacer",17,3350,4749
"AMC Spirit",22,2640,3799
"Buick Century",20, 3250,4816
"Buick Electra",15,4080,7827
END DATA.

SAVE TRANSLATE OUTFILE='temp\test.dta'
  /TYPE=STATA
  /VERSION=8
  /EDITION=SE
  /MAP
  /REPLACE.
GET
  STATA FILE='temp\test.dta'.

**End***

Returns:
>Error # 7228.  Command name: GET STATA
>Cannot open data file.
>Execution of this command stops.


The University of Aberdeen is a charity registered in Scotland, No SC013683.

=====================
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: SPSS 19 writing Stata files

Jon K Peck
I tried this with 19.0.0.1, and it worked correctly.  I don't know whether the fixpack makes a difference, but it would be a good idea to install it anyway.

Jon Peck (no "h")
Senior Software Engineer, IBM
[hidden email]
new phone: 720-342-5621




From:        "MacLennan, Graeme" <[hidden email]>
To:        [hidden email]
Date:        09/05/2011 09:08 AM
Subject:        [SPSSX-L] SPSS 19 writing Stata files
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




Dear SPSSers, I was just upgraded to SPSS 19 by our IT department (version 19.0.0). I tried to run some version 18 code which used to successfully write Stata's .dta files no probs.  Tracking this down it appears that 19 is not writing the .dta file. Not sure if this is something to do with me, or something in general? It is no biggy as Stata has an ado that reads SPSS, but I was just curious to see if the syntax below works for others?
Regards, Graeme.

**Begin***


dataset close all.
FILE HANDLE temp NAME = "c:\temp".
DATA LIST LIST
/ make (A15) mpg weight price .
BEGIN DATA.
"AMC Concord",22,2930,4099
"AMC Pacer",17,3350,4749
"AMC Spirit",22,2640,3799
"Buick Century",20, 3250,4816
"Buick Electra",15,4080,7827
END DATA.

SAVE TRANSLATE OUTFILE='temp\test.dta'
 /TYPE=STATA
 /VERSION=8
 /EDITION=SE
 /MAP
 /REPLACE.
GET
 STATA FILE='temp\test.dta'.

**End***

Returns:
>Error # 7228.  Command name: GET STATA
>Cannot open data file.
>Execution of this command stops.


The University of Aberdeen is a charity registered in Scotland, No SC013683.

=====================
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: SPSS 19 writing Stata files

San K
It is easier to read the SPSS file from Stata instead of exporting
from SPSS to Stata.

You can use the  USESPSS (Stata module) to import *.sav files.

Regards,
San





On Tue, Sep 6, 2011 at 5:19 AM, Jon K Peck <[hidden email]> wrote:

> I tried this with 19.0.0.1, and it worked correctly.  I don't know whether
> the fixpack makes a difference, but it would be a good idea to install it
> anyway.
>
> Jon Peck (no "h")
> Senior Software Engineer, IBM
> [hidden email]
> new phone: 720-342-5621
>
>
>
>
> From:        "MacLennan, Graeme" <[hidden email]>
> To:        [hidden email]
> Date:        09/05/2011 09:08 AM
> Subject:        [SPSSX-L] SPSS 19 writing Stata files
> Sent by:        "SPSSX(r) Discussion" <[hidden email]>
> ________________________________
>
>
> Dear SPSSers, I was just upgraded to SPSS 19 by our IT department (version
> 19.0.0). I tried to run some version 18 code which used to successfully
> write Stata's .dta files no probs.  Tracking this down it appears that 19 is
> not writing the .dta file. Not sure if this is something to do with me, or
> something in general? It is no biggy as Stata has an ado that reads SPSS,
> but I was just curious to see if the syntax below works for others?
> Regards, Graeme.
>
> **Begin***
>
>
> dataset close all.
> FILE HANDLE temp NAME = "c:\temp".
> DATA LIST LIST
> / make (A15) mpg weight price .
> BEGIN DATA.
> "AMC Concord",22,2930,4099
> "AMC Pacer",17,3350,4749
> "AMC Spirit",22,2640,3799
> "Buick Century",20, 3250,4816
> "Buick Electra",15,4080,7827
> END DATA.
>
> SAVE TRANSLATE OUTFILE='temp\test.dta'
>  /TYPE=STATA
>  /VERSION=8
>  /EDITION=SE
>  /MAP
>  /REPLACE.
> GET
>  STATA FILE='temp\test.dta'.
>
> **End***
>
> Returns:
>>Error # 7228.  Command name: GET STATA
>>Cannot open data file.
>>Execution of this command stops.
>
>
> The University of Aberdeen is a charity registered in Scotland, No SC013683.
>
> =====================
> 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
>
>

=====================
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: SPSS 19 writing Stata files

Maclennan, Graeme S.
In reply to this post by Jon K Peck
Dear SPSSers, Jon's advice to install the fixpack to version 19.0.0.1 resolves the issue I had with the syntax at the foot of this email. Point and click works also.  I consider this thread closed.
Regards, . g.
 
**** Jon wrote***
I tried this with 19.0.0.1, and it worked correctly.  I don't know whether the fixpack makes a difference, but it would be a good idea to install it anyway.

Jon Peck (no "h")
Senior Software Engineer, IBM
[hidden email]
new phone: 720-342-5621


 ****** 



Dear SPSSers, I was just upgraded to SPSS 19 by our IT department (version 19.0.0). I tried to run some version 18 code which used to successfully write Stata's .dta files no probs.  Tracking this down it appears that 19 is not writing the .dta file. Not sure if this is something to do with me, or something in general? It is no biggy as Stata has an ado that reads SPSS, but I was just curious to see if the syntax below works for others?
Regards, Graeme.

**Begin***


dataset close all.
FILE HANDLE temp NAME = "c:\temp".
DATA LIST LIST
/ make (A15) mpg weight price .
BEGIN DATA.
"AMC Concord",22,2930,4099
"AMC Pacer",17,3350,4749
"AMC Spirit",22,2640,3799
"Buick Century",20, 3250,4816
"Buick Electra",15,4080,7827
END DATA.

SAVE TRANSLATE OUTFILE='temp\test.dta'
 /TYPE=STATA
 /VERSION=8
 /EDITION=SE
 /MAP
 /REPLACE.
GET
 STATA FILE='temp\test.dta'.

**End***

Returns:
>Error # 7228.  Command name: GET STATA
>Cannot open data file.
>Execution of this command stops.





The University of Aberdeen is a charity registered in Scotland, No SC013683.