BookmarkSubscribeRSS Feed
raajdesaii
Fluorite | Level 6

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!!

4 REPLIES 4
andreas_lds
Jade | Level 19

The note about "Cross Environment Data Access" warns you that the dataset

  1. is in a format that is native to another host => more time is necessary to process the data
  2. the file encoding does not match the session encoding => problems could arise if chars are used that don't exist in the encoding of your session

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.

 

ballardw
Super User

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.

Oligolas
Barite | Level 11

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 -

Ksharp
Super User
That is because the encoding of your sas is different than the dataset's encoding.
Therefore, try start a sas with 'utf-8' (unicode sas) from START menu .and see if the problem is solved.

https://blogs.sas.com/content/sgf/2021/07/12/subchar-option-sas-access/

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 4 replies
  • 1088 views
  • 0 likes
  • 5 in conversation