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

Good evening.

 

I have been running the same code for about 6 months without issue. All of a sudden over the past 2 days I keep getting a new error. Nothing has changed in my code at all.... I'm not sure what to do.

 

Here is the note followed by the error I receive. Any advice?

 

88 data work.tfns34; set tfn.s34;
NOTE: Data file TFN.S34.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.
89
 
ERROR: Some character data was lost during transcoding in the dataset TFN.S34.
Either the data contains characters that are not representable in the
new encoding or truncation occurred during transcoding.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
anweinbe
Quartz | Level 8
found an article on WRDS:

2 options for those with the same issue:

Option 1: Add "inencoding=asciiany" to your custom libname statements

In your SAS code where you specify the library for your saved data, or if you have custom libname statements referencing WRDS data, simply add the option "inencoding=asciiany" to the end of the statements, for example:
libname mylib '~/' inencoding=asciiany;
libname complib '/wrds/comp/sasdata/d_na/' inencoding=asciiany;

Option 2: Change the encoding of your saved dataset to UTF-8 so it matches WRDS data encoding

You can change the encoding of your dataset to UTF-8 format with the following code:

proc datasets nolist library=mylib;
modify mydata / correctencoding=utf8;
quit;

View solution in original post

4 REPLIES 4
mkeintz
PROC Star
Are you using WRDS (your dataset name is used there)? They have recently converted data to UTF8, and you should have seen notifications. Contact them to confirm.
--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------
anweinbe
Quartz | Level 8

I am using WRDS... I didn't receive any notifications from my university...

 

Anything you can pass on?

mkeintz
PROC Star
Use the wrds website to find the info. If you can't find it, use their link to get help.
--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------
anweinbe
Quartz | Level 8
found an article on WRDS:

2 options for those with the same issue:

Option 1: Add "inencoding=asciiany" to your custom libname statements

In your SAS code where you specify the library for your saved data, or if you have custom libname statements referencing WRDS data, simply add the option "inencoding=asciiany" to the end of the statements, for example:
libname mylib '~/' inencoding=asciiany;
libname complib '/wrds/comp/sasdata/d_na/' inencoding=asciiany;

Option 2: Change the encoding of your saved dataset to UTF-8 so it matches WRDS data encoding

You can change the encoding of your dataset to UTF-8 format with the following code:

proc datasets nolist library=mylib;
modify mydata / correctencoding=utf8;
quit;

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 4 replies
  • 1183 views
  • 0 likes
  • 2 in conversation