DATA Step, Macro, Functions and more

SAS import error

Frequent Learner
Posts: 1

SAS import error



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


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.

Super Contributor
Posts: 319

Re: SAS import error



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

Super User
Posts: 13,508

Re: SAS import error

[ Edited ]

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_;


to see what may be in your library.


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

Ask a Question
Discussion stats
  • 2 replies
  • 3 in conversation