BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
karlbang
Fluorite | Level 6

I exported a data set to SPSS. Had to change

proc format;
	value degree 1=GOOD 2-5=POOR;
run;

into

proc format;
	value degree 1=GOOD 2=POOR 3=POOR 4=POOR 5=POOR;
run;

in order to get the formatted variable displayed correctly in SPSS. Any clue why ?

 

I used

proc export 
	data=sasuser.hernior(keep=(patient age PSTAT LOS))
	outfile='p:\public_html\SPSS\hernior.sav' 
	dbms=spss
	replace;
run;

(dbms=sav does not change results).

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

I think that PROC EXPORT does not know how to translate ranges of values into the individual records.  Either SPSS does not support applying the same "label" (decode) to multiple values, or PROC EXPORT doesn't know how to generate that syntax. 

 

Part of the problem is that to SAS 2-5 includes ALL values from 2 to 5, not just the integer values you used in your second format.  So a value like 2.5 or 4.3 would also be displayed as POOR.

 

You can save yourself some typing:

proc format;
	value degree 1='GOOD' 2,3,4,5='POOR';
run;

View solution in original post

2 REPLIES 2
Tom
Super User Tom
Super User

I think that PROC EXPORT does not know how to translate ranges of values into the individual records.  Either SPSS does not support applying the same "label" (decode) to multiple values, or PROC EXPORT doesn't know how to generate that syntax. 

 

Part of the problem is that to SAS 2-5 includes ALL values from 2 to 5, not just the integer values you used in your second format.  So a value like 2.5 or 4.3 would also be displayed as POOR.

 

You can save yourself some typing:

proc format;
	value degree 1='GOOD' 2,3,4,5='POOR';
run;
karlbang
Fluorite | Level 6

Thank you for the reply

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 400 views
  • 0 likes
  • 2 in conversation