BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Batman
Quartz | Level 8

I'm getting this error in SAS EG

 

27 proc sql;
28 create table Only_P as
29 select *
30 from DAT.UPDATED_DIRECTORY (obs=&obs)
31 where RecType='P';
NOTE: Data file DAT.UPDATED_DIRECTORY.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.
ERROR: Some character data was lost during transcoding in the dataset
DAT.UPDATED_DIRECTORY. Either the data contains characters that are not
representable in the new encoding or truncation occurred during
transcoding.

 
27 proc sql;
28 create table Only_P as
29 select *
30 from DAT.UPDATED_DIRECTORY (obs=&obs)
31 where RecType='P';
NOTE: Data file DAT.UPDATED_DIRECTORY.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.
ERROR: Some character data was lost during transcoding in the dataset
DAT.UPDATED_DIRECTORY. Either the data contains characters that are not
representable in the new encoding or truncation occurred during
transcoding.

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User
That issue is due to the encoding of "DAT.UPDATED_DIRECTORY" is different with SAS encoding.
Make SAS encoding be same with your dataset.

You could use the following code to check your dataset encoding:
proc contents data=DAT.UPDATED_DIRECTORY;
run;

View solution in original post

2 REPLIES 2
A_Kh
Barite | Level 11

Did you try dataset option ENCODING= ANY?

Ksharp
Super User
That issue is due to the encoding of "DAT.UPDATED_DIRECTORY" is different with SAS encoding.
Make SAS encoding be same with your dataset.

You could use the following code to check your dataset encoding:
proc contents data=DAT.UPDATED_DIRECTORY;
run;

Catch up on SAS Innovate 2026

Dive into keynotes, announcements and breakthroughs on demand.

Explore 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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 332 views
  • 0 likes
  • 3 in conversation