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.
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
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.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.