BookmarkSubscribeRSS Feed
Batta
Obsidian | Level 7

Hi SAS experts,

 

I was routinely converting DATE given in the format:

Number ID Old_Format
1 12MAR2025:00:00:00.000
2 17MAR2025:00:00:00.000

 

using 

proc sql;

select datepart(Old_Format) as New_Format format=mmddyy10. 

from DATASET;

 

And that was working well, but suddenly I've started receiving the following error:

 

ERROR: Some character data was lost during transcoding in the dataset DATESET. Either the data contains characters that are not representable in the new encoding or truncation occurred during transcoding.

 

I am not able to see what changed. 

Any ideas are appreciated. 

Thank you very much for your time. 

Batta 

 

1 REPLY 1
Tom
Super User Tom
Super User

Either the data being read has changed and it now has characters that cannot be converted into the encoding being used by the SAS session.

 

Or you switched to a new SAS session that is using a different setting of the ENCODING system option.

 

Check the ENCODING system option. Check the encoding of the dataset you are reading from.

%put ENCODING=%sysfunc(getoption(encoding));
proc contents data=DATASET;
run;

 

Catch up on SAS Innovate 2026

Nearly 200 sessions are now available on demand with the SAS Innovate Digital Pass.

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
  • 1 reply
  • 62 views
  • 1 like
  • 2 in conversation