Fix for invalid characters in data

January 30, 2017
By

This post was kindly contributed by SAS & Statistics - go there to comment and to read the full post.

For “ERROR: Some character data was lost during transcoding in the dataset DB.XXXDAT. Either the data contains characters that are not representable in the new encoding or truncation occurred during transcoding.” use the following code in program:

proc options option=config; run;
proc options group=languagecontrol; run;

/* Show the encoding value for the problematic data set */
%let dsn=cd.xxxdat;
%let dsid=%sysfunc(open(&dsn,i));
%put &dsn ENCODING is: %sysfunc(attrc(&dsid,encoding));

/*Renaming item desc file  (encoding=any) allowed reading */
data temp;
set db.xxxdat (encoding=any);
run;

This post was kindly contributed by SAS & Statistics - go there to comment and to read the full post.

Tags: ,

Welcome!

SAS-X.com offers news and tutorials about the various SAS® software packages, contributed by bloggers. You are welcome to subscribe to e-mail updates, or add your SAS-blog to the site.

Sponsors







Dear readers, proc-x is looking for sponsors who would be willing to support the site in exchange for banner ads in the right sidebar of the site. If you are interested, please e-mail me at: tal.galili@gmail.com
SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration.