Converting SAS files with SPSS syntax

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

Converting SAS files with SPSS syntax

rmjdgeh
Dear SPSSX-L users

Does anyone know if it is possible to convert and merge SAS files in SPSS
using SPSS syntax?

For example, I have two SAS files and want to link by ID and combine age,
sex, a1-a10, b1-b10.

data1.sas7bdat (variables ID, age, sex, a1 to a10)
data2.sas7bdat (variables ID, b1 to b10)

Any suggestions would be appreciated greatly.

Gareth

=====================
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: Converting SAS files with SPSS syntax

Gerard van Meurs-2
Hi Gareth,

Yes, that's rather simple: read in the SAS-data in SPSS and save the
file as SPSS-sav-file. In syntax:


GET SAS DATA = 'file1.sas7bdat'.
SAVE OUTFILE = 'file1.sav'.


Kind regards,

Gerard van Meurs
-----Oorspronkelijk bericht-----
Van: SPSSX(r) Discussion [mailto:[hidden email]] Namens Gareth
Verzonden: dinsdag 19 juli 2011 10:15
Aan: [hidden email]
Onderwerp: Converting SAS files with SPSS syntax

Dear SPSSX-L users

Does anyone know if it is possible to convert and merge SAS files in
SPSS
using SPSS syntax?

For example, I have two SAS files and want to link by ID and combine
age,
sex, a1-a10, b1-b10.

data1.sas7bdat (variables ID, age, sex, a1 to a10)
data2.sas7bdat (variables ID, b1 to b10)

Any suggestions would be appreciated greatly.

Gareth

=====================
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: Converting SAS files with SPSS syntax

Garry Gelade
In reply to this post by rmjdgeh
Hi Gareth

GET SAS DATA='mydirectory\data1.sas7bdat'.
DATASET NAME DataSet1 WINDOW=FRONT.
SORT CASES by ID.

GET  SAS DATA='mydirectory\data2.sas7bdat'.
DATASET NAME DataSet2 WINDOW=FRONT.
SORT CASES by ID.

MATCH FILES /FILE=*   /TABLE='DataSet1'  /BY ID.
EXECUTE.



Garry Gelade



-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Gareth
Sent: 19 July 2011 09:15
To: [hidden email]
Subject: Converting SAS files with SPSS syntax

Dear SPSSX-L users

Does anyone know if it is possible to convert and merge SAS files in SPSS
using SPSS syntax?

For example, I have two SAS files and want to link by ID and combine age,
sex, a1-a10, b1-b10.

data1.sas7bdat (variables ID, age, sex, a1 to a10)
data2.sas7bdat (variables ID, b1 to b10)

Any suggestions would be appreciated greatly.

Gareth

=====================
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