BookmarkSubscribeRSS Feed
Emma_at_SAS
Lapis Lazuli | Level 10

Hello, 

 

I want to import an SPSS data set into SAS but my SPSS version of the data set has a password. I assume the reason I cannot import the data successfully is that I did not add the password. I appreciate it if you help me add the password, or if you have other suggestions.

 

proc import datafile = "&proj_loc\SPSS_data.sav"
dbms = spss replace
out = SAS_data;
run;

 

Thanks

3 REPLIES 3
sbxkoenk
SAS Super FREQ

Hello,

 

Can you create a SPSS export file (named 'myspss.por') without password?

 

Then you can import it in the dataset work.temp by means of these 2 pieces of code (anyone out of the 2).

Both pieces of code use the SPSS interface library engine.

filename myfile 'myspss.por';
proc convert spss=myfile out=temp;
run;

OR

libname myfile spss 'myspss.por';
data temp;
    set myfile._first_;
run;

I don't have SAS/ACCESS Interface to PC Files installed locally (on my laptop-SAS) so I cannot check the proc import with DBMS=spss.

 

Cheers,

Koen

 

Emma_at_SAS
Lapis Lazuli | Level 10
Thank you, Koen.
How do I replace the ''myspss.por''? I tried this --> path_to_the_data_file\SPSS_data_name.sav
but did not work.
Also, what does this part do --> set myfile._first_;

Thanks
Mary
sbxkoenk
SAS Super FREQ

The .por file is to be made in SPSS. It's an SPSS export file format.

The PROC CONVERT doesn't accept .sav files, it needs to be a file in the SPSS export file format.

When having this .por file, you can indeed put the full path in between quotes:

filename myfile 'C:\...\myfolder\myspss.por';

 

Koen

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1345 views
  • 0 likes
  • 2 in conversation