BookmarkSubscribeRSS Feed
fa04
Fluorite | Level 6

I have a large SAS dataset, but when I convert it to SPSS, a few variables have incorrect format values and labels. For example, the time variable shows the correct time format (eg. 7:30 AM) in SAS, but is incorrectly displayed in SPSS (. Another variable loses its values.  But more than 95% of the formats are displayed correctly.  It's not an issue of format names being more than 8 char, as there are several formats with longer names that are displayed correctly in SPSS.  Please help solve this issue- Thank you!

4 REPLIES 4
ballardw
Super User

Without concrete examples this is an exercise in "guessing". Such as explicit values in SAS, with information about variable type, length and assigned format, and the characteristics of the resulting SPSS variable?

 

I never worked with time variables in SPSS so I haven't specific examples. SAS TIME values are the numbers of seconds since midnight. So if your 7:30 AM looks like 27000 then that is the number of seconds and the value is correct the display is just not what is expected by you.

 

Did any of the SAS variables have custom formats assigned?

 

fa04
Fluorite | Level 6

If it makes things easier, this is the format for the time variable:

fa04_0-1610556628332.png

This is what it looks like in SAS

fa04_1-1610556682099.png

It fails to take on the format in SPSS, and looks like this:

fa04_3-1610556764866.png

Thanks for your help!

ballardw
Super User

In that first picture there is a value that looks like "9: 45 AM". What application is that from? The space between the : and 45 is very suspicious.

 

You should run Proc Contents on the SAS data set in SAS and show the results. You may have to tell us the actual names of variables as you are currently not providing that information. Your "what it looks like in SAS" picture looks like the output of proc freq???

 

Another question: How did you convert the data to SPSS?

Tom
Super User Tom
Super User

Note that data is best shared as TEXT not photographs.

This is what I think you are trying to show:  Te first picture was trying to express the definition for the format attached to the variable (format name not displayed) that is saying to display values like 31 as '7:30 AM'.  And the last picture is trying to express that when you look at the SPSS variable (using what?) the raw values are there.  Do you know to display value "labels" in SPSS?  Can you display both the value and the value label at once?

 

So in the dataset you converted to SPSS was the format actually attached to the variable?  Is the format definition actually accessible in your SAS session?

 

When you converted the SAS dataset to SPSS did the process that did the conversion know where to find the format definition?  SAS formats live in format catalogs, not in the same file as where the actual values are stored.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

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

View all other training opportunities.

Discussion stats
  • 4 replies
  • 542 views
  • 0 likes
  • 3 in conversation