BookmarkSubscribeRSS Feed
Fung
Calcite | Level 5

Hello, 

 

I have a SAS question related to reading character variables from an SPSS file into SAS.  As is known that SAS truncates character variables to about 255 characters with spaces. In my case I have a character variable with much more characters in SPSS’s SAV format. I read adding “cvp’” in the libname statement would expand the character variable engine but I am getting an error message as noted below. Any idea if there is another code to use or whether it is better to get the SPSS file in POR as opposed to SAV format would make things better? Thanks!  

 

libname F1 cvp "H:\NP_narratives_F1" cvpbytes=2;

NOTE: Libref F1 was successfully assigned as follows:

      Engine:        CVP

      Physical Name: H:\NP_narratives_F1; run;

proc import  datafile='H:\NP_narratives_F1\NP_F1_CP_narratives201506.sav'

out= f1.NP_F1_CP_narratives

dbms=SAV

replace; run;

ERROR: Import cancelled. The dataset F1.NP_F1_CP_NARRATIVES is being used and cannot be replaced.

NOTE: The SAS System stopped processing this step because of errors.

2 REPLIES 2
Loko
Barite | Level 11

Hello,

 

The error refers to F1.NP_F1_CP_NARRATIVES being in use.

Either you have it opened or others that have access to F1 library

ballardw
Super User

If you have the Library successfully assigned use SAS Explorer to open library. See if your dataset is there. You may not need to "import" something that is accessible using a library.

Or run

 

proc contents data=F1._all_;

run;

to see what may be in your library.

 

Also the Error could be occuring because the Library statement is "using" the file.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 2 replies
  • 3466 views
  • 0 likes
  • 3 in conversation