LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (September 2005)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 7 Sep 2005 10:19:58 -0700
Reply-To:     michael healy <healym@earthlink.net>
Sender:       "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:         michael healy <healym@earthlink.net>
Subject:      Re: SPSS to SAS version 9.1
Comments: To: William Dudley <william.dudley@nurs.utah.edu>
Content-Type: text/plain; charset=us-ascii

My workaround for this problem is to export the SPSS file as a .sas7bdat and .por file. I then read in the .por file and apply the formatting statements...I'm not sas whiz but it works...

let me know if you need code examples...

Mike

-----Original Message----- From: William Dudley <william.dudley@nurs.utah.edu> Sent: Sep 7, 2005 9:05 AM To: SPSSX-L@LISTSERV.UGA.EDU Subject: SPSS to SAS version 9.1

I am trying to transport SPSS (version 13) data files to SAS (version 9.1). I have used the SPSS "save as" option and selected SAS with long extension. This gives me the following syntax in SPSS

SAVE TRANSLATE OUTFILE='R:\test\mydata.sas7bdat' /TYPE=SAS /VERSION=7 /PLATFORM=WINDOWS /MAP /REPLACE /VALFILE='R:\test\mydata.sas' .

The data set appears to be valid when I open it in SAS using the viewer, But when I run the SAS syntax created by SPSS I get a: " divide by zero" error in my SAS run.

Program is below.

I think this is due to an error in the SAS program created by SPSS. Does anyone have a suggestion?

Thanks Bill

Here is the SAS program

libname library 'r:\test\' ;

proc format library = library ; value type /* Session Type */ 1 = 'Prenatal' 2 = 'Cancer' ; value FemaleNa /* Name of Client */ 1 = 'Clara' 2 = 'Stephanie' 3 = 'Vanya' 4 = 'Ayodola' 5 = 'Ines' 6 = 'Jeanet' ; value RaceR /* Client Race */ 1 = 'Caucasian' 2 = 'African American' 3 = 'Hispanic' ; value dyad /* Single or Dyad */ 1 = 'No Spouse' 2 = 'Spouse Present' ; value SpouseNa /* Name of Spouse */ 0 = 'No Spouse' 1 = 'Dave' 2 = 'Michael' 3 = 'Romel' ; value WeekDayA 1 = 'Friday' 2 = 'Saturday' 3 = 'Sunday' 4 = 'Monday' 5 = 'Tuesday' 6 = 'Local Baltimore' 7 = 'Local Philadelphia' ; value GC_gende /* Genetic Counselor Gender */ 1 = 'Male' 2 = 'Female' ; value GC_Pre_A /* Genetic Counselor Age */ 1 = '21-25' 2 = '26-30' 3 = '31-35' 4 = '36-40' 5 = '41-45' 6 = '46-50' 7 = '51-55' 8 = '56-60' 9 = '61-65' 10 = '66+' ; value GC_Pre_E /* Genetic Counselor Ethnicity */ 1 = 'Caucasian' 2 = 'African American' 3 = 'Hispanic' 4 = 'Asian' 5 = 'Native American' 6 = 'Eastern European/Jewish' 7 = 'Other' ; value GC_Pre_G /* Genetic Counselor Years as Genetic Counselor */ 1 = '0-2' 2 = '2-5' 3 = '5-10' 4 = '10-15' 5 = '15-20' 6 = '20-25' 7 = '25+' ; value GC_Pre_P /* Genetic Counselor Years as Prenatal Counselor */ 1 = '0-2' 2 = '2-5' 3 = '5-10' 4 = '10-15' 5 = '15-20' 6 = '20-25' 7 = '25+' ; value GC_Pre_C /* Genetic Counselor Years as Cancer Counselor */ 1 = '0-2' 2 = '2-5' 3 = '5-10' 4 = '10-15' 5 = '15-20' 6 = '20-25' 7 = '25+' ; value GC_Pre_P 1 = 'None' 2 = 'Less than half' 3 = 'About half' 4 = 'More than half' 5 = 'All' ; value GC_Pre_P 1 = 'None' 2 = 'Less than half' 3 = 'About half' 4 = 'More than half' 5 = 'All' ; value GC_Pre_C 1 = 'None' 2 = 'Less than half' 3 = 'About half' 4 = 'More than half' 5 = 'All' ; value GC_Pre_A 1 = 'None' 2 = 'Less than half' 3 = 'About half' 4 = 'More than half' 5 = 'All' ; value GC_Pre_O 1 = 'None' 2 = 'Less than half' 3 = 'About half' 4 = 'More than half' 5 = 'All' ; value GC_Pre_R 1 = 'None' 2 = 'Slight' 3 = 'Moderate' 4 = 'Extensive' ; value GC_Pre_A 0 = 'No' 1 = 'Yes' ; value GC_Pre_V 0 = 'No' 1 = 'Yes' ; value GC_Pre_P 1 = 'Extremely comfortable' 2 = 'Somewhat comfortable' 3 = 'Somewhat uncomfortable' 4 = 'Extremely uncomfortable' ; value GC_Pre_P 1 = 'Extremely helpful' 2 = 'Moderately helpful' 3 = 'Slightly helpful' 4 = 'Not at all helpful' ; value GC_Post_ /* To what extent were you able to think of this client as real? */ 1 = 'Not at all' 2 = 'Somewhat real' 3 = 'Moderately real' 4 = 'completely real' ; value GC_Post_ /* If your clients husband was present, to what extent were you able to think of him as real? */ 1 = 'Not at all' 2 = 'Somewhat real' 3 = 'Moderately real' 4 = 'Completely real' 5 = 'N/A' ; value GC_Post_ /* To what extent had you discussed this case with other counselors before coming today? */ 1 = 'Not at all' 2 = 'I had talked about some aspects' 3 = 'I had talked about many aspects' ; value GC_Post_ /* Would you be willing to participate in a similar study in the future if asked? */ 0 = 'No' 1 = 'Yes' 2 = 'Maybe' ; value GC_Post_ /* Would you recommend that your friends/colleagues participate in a study like this? */ 0 = 'No' 1 = 'Yes' 2 = 'Maybe' ; value SCW_Ques /* What degree of confidence would you say you have in this genetic counselor? */ 1 = 'Very Much' 2 = 'Moderately' 3 = 'Somewhat' 4 = 'Slightly' 5 = 'None' ; value SCW_Ques /* Would you come back to see this genetic counselor? */ 1 = 'Definitely' 2 = 'Maybe' 3 = 'Reluctantly' 4 = 'Not at all' ; value SCW_Ques /* Did you feel the genetic counselor was aware of your emotional state? */ 1 = 'Very much' 2 = 'Moderately' 3 = 'Somewhat' 4 = 'Slight' 5 = 'None' ; value SCW_Ques /* Did you feel the genetic counselor was interested in your emotional state? */ 1 = 'Very much' 2 = 'Moderately' 3 = 'Somewhat' 4 = 'Slight' 5 = 'None' ; value SCW_Ques /* To what extent did you feel comfortable disclosing your emotional state to this genetic counselor? */ 1 = 'Very much' 2 = 'Moderately' 3 = 'Somewhat' 4 = 'Slight' 5 = 'None' ; value SCW_Ques /* To what extend did you feel comfortable overall with this genetic counselor? */ 1 = 'Very much' 2 = 'Moderately' 3 = 'Somewhat' 4 = 'Slight' 5 = 'None' ; value SCW_Ques /* Did you feel the genetic counselor understood how you felt emotionally? */ 1 = 'Very much' 2 = 'Moderately' 3 = 'Somewhat' 4 = 'Slight' 5 = 'None' ; value SCW_Ques /* Did anything the genetic counselor do or say help you feel any better emotionally? */ 0 = 'No' 1 = 'Yes' ; value SCW_Ques /* Did anything the genetic counselor do or say help you feel any worse emotionally? */ 0 = 'No' 1 = 'Yes' ; value SCM_Ques /* What degree of confidence would you say you have in this genetic counselor? */ 1 = 'Very Much' 2 = 'Moderately' 3 = 'Somewhat' 4 = 'Slightly' 5 = 'None' ; value SCM_Ques /* Would you come back to see this genetic counselor? */ 1 = 'Definitely' 2 = 'Maybe' 3 = 'Reluctantly' 4 = 'Not at all' ; value SCM_Ques /* Did you feel the genetic counselor was aware of your emotional state? */ 1 = 'Very much' 2 = 'Moderately' 3 = 'Somewhat' 4 = 'Slight' 5 = 'None' ; value SCM_Ques /* Did you feel the genetic counselor was interested in your emotional state? */ 1 = 'Very much' 2 = 'Moderately' 3 = 'Somewhat' 4 = 'Slight' 5 = 'None' ; value SCM_Ques /* To what extent did you feel comfortable disclosing your emotional state to this genetic counselor? */ 1 = 'Very much' 2 = 'Moderately' 3 = 'Somewhat' 4 = 'Slight' 5 = 'None' ; value SCM_Ques /* To what extend did you feel comfortable overall with this genetic counselor? */ 1 = 'Very much' 2 = 'Moderately' 3 = 'Somewhat' 4 = 'Slight' 5 = 'None' ; value SCM_Ques /* Did you feel the genetic counselor understood how you felt emotionally? */ 1 = 'Very much' 2 = 'Moderately' 3 = 'Somewhat' 4 = 'Slight' 5 = 'None' ; value SCM_Ques /* Did anything the genetic counselor do or say help you feel any better emotionally? */ 0 = 'No' 1 = 'Yes' ; value SCM_Ques /* Did anything the genetic counselor do or say help you feel any worse emotionally? */ 0 = 'No' 1 = 'Yes' ; value GC_Regio /* Genetic Counselor NSGC Region */ 1 = 'I' 2 = 'II' 3 = 'III' 4 = 'IV' 5 = 'V' 6 = 'VI' ;

proc datasets library = library ; modify mydata; format type type.; format FemaleNameR FemaleNa.; format RaceR RaceR.; format dyad dyad.; format SpouseNameR SpouseNa.; format WeekDayR WeekDayA.; format GC_gender GC_gende.; format GC_Pre_AgeR GC_Pre_A.; format GC_Pre_EthnicityR GC_Pre_E.; format GC_Pre_GCYrsR GC_Pre_G.; format GC_Pre_PrenatalYrsR GC_Pre_P.; format GC_Pre_CancerYrsR GC_Pre_C.; format GC_Pre_PrenatalPortionR GC_Pre_P.; format GC_Pre_PediatricPortionR GC_Pre_P.; format GC_Pre_CancerPortionR GC_Pre_C.; format GC_Pre_AdultPortionR GC_Pre_A.; format GC_Pre_OtherPortionR GC_Pre_O.; format GC_Pre_RolePlayExpR GC_Pre_R.; format GC_Pre_ActorExpR GC_Pre_A.; format GC_Pre_VideoExpR GC_Pre_V.; format GC_Pre_PastComfR GC_Pre_P.; format GC_Pre_PastHelpR GC_Pre_P.; format GC_Post_Question29R GC_Post_.; format GC_Post_Question30R GC_Post_.; format GC_Post_Question31R GC_Post_.; format GC_Post_Question33R GC_Post_.; format GC_Post_Question34R GC_Post_.; format SCW_Question2R SCW_Ques.; format SCW_Question3R SCW_Ques.; format SCW_Question19R SCW_Ques.; format SCW_Question20R SCW_Ques.; format SCW_Question21R SCW_Ques.; format SCW_Question22R SCW_Ques.; format SCW_Question23R SCW_Ques.; format SCW_Question24aR SCW_Ques.; format SCW_Question25aR SCW_Ques.; format SCM_Question2R SCM_Ques.; format SCM_Question3R SCM_Ques.; format SCM_Question19R SCM_Ques.; format SCM_Question20R SCM_Ques.; format SCM_Question21R SCM_Ques.; format SCM_Question22R SCM_Ques.; format SCM_Question23R SCM_Ques.; format SCM_Question24aR SCM_Ques.; format SCM_Question25aR SCM_Ques.; format GC_Region GC_Regio.; quit;

**********************************************************************

William N. Dudley, PhD Emma Eccles Jones Nursing Research Center

University of Utah

College of Nursing

10 South 2000 East

Salt Lake City, UT 84122-5880

http://www.nurs.utah.edu/faculty/william_dudley.htm

**********************************************************************


Back to: Top of message | Previous page | Main SPSSX-L page