Hi all,
I have downloaded a SAS dataset but as soon as I open it, I get this error:
NOTE: Data file TMP1.CORE.DATA is in a format that is native to another host, or the file
encoding does not match the session encoding. Cross Environment Data Access will be used,
which might require additional CPU resources and might reduce performance.
If I try to do any further analyses, I get this error:
ERROR: Some character data was lost during transcoding in the dataset TMP1.CORE. Either the data
contains characters that are not representable in the new encoding or truncation occurred
during transcoding.
Please let me know how do I fix this.
Thanks!!
The note about "Cross Environment Data Access" warns you that the dataset
So first step: Use proc contents to check the encoding used to create the dataset and compare that with the encoding your sas session using. If you can, try changing the encoding of you session.
Please note that nothing you post in the body of your question says "Format error" or references a format. Since Formats are a very specific concept in SAS you want to use "format error" when an actual format is giving problems or you get an error or warning referencing a format name.
You have issue with data content.
Hi,
I guess you've got unicode signs in your datasets.
1.Start SAS with unicode support and
2. Run this to identify the variables:
%let libname=TMP1;
DATA _NULL_;
SET sashelp.vtable(keep=libname memname);
WHERE libname eq "%upcase(&libname.)";
call execute("DATA WORK."||strip(memname)||"; set &libname.."||strip(memname));
call execute(compbl('ARRAY chars _CHARACTER_;
DO OVER chars;
if prxmatch("/[^\x20-\x7E]/",chars) then put "W" "ARNING:# special character detected in '||strip(memname)||' dataset " chars=;
END;')
);
call execute('RUN;');
RUN;
- Cheers -
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.