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.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

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