BookmarkSubscribeRSS Feed
Fred_Gavin
Calcite | Level 5

LIBNAME library 'c:\MySASLib';

PROC IMPORT DATAFILE = 'c:\MySPSSDir\survey.sav'

OUT = library.sassurvey

DBMS = SAV

REPLACE;

FMTLIB = library.formats;

RUN;

I am experiencing SAS 9.3 at the moment.  This is the example I used to import SPSS (.sav) file to SAS.

However when I did this way, the error message appears that:

" ERROR: Unable to open the table library.sassurvey. library.sassurvey cannot be opened.

  Do you want to select a different table to open ?"

The error in the log is :

"ERROR: Format Q9_ not found or couldn't be loaded for variable Q9_."

This happened only when I specified the formats in "FMTLIB", which put SPSS formatted value in the personal library.

However without "FMTLIB", the formats would be put in "work" directory, and then I can open the data in the personal library. It seems weird.

I want to create formats in different library, because there are several SPSS files I have to import. If the formats file in the same "work" directory, when a new SPSS file imported, its format will overwrite the existing one.

Does anyone know about this, and How can I fix this problem?

Thanks and Regards

1 REPLY 1
Ksharp
Super User

I don't have experience about importing SPSS file.

But do you try to use wizard of import .  File -> Import Data-> .....

Ksharp

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

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
  • 1 reply
  • 1012 views
  • 0 likes
  • 2 in conversation