0xFED5550
0xFED5550

Reputation: 576

How to handle UTF-8 characters when reading a file in SAS?

How to handle UTF-8 characters when reading a file in SAS?

Such as spanish characters like ó í é á among other special characters within UTF-8 so it doesn't display garbage strings like

é instead of é

Upvotes: 0

Views: 3870

Answers (2)

Hugs
Hugs

Reputation: 543

From SAS Documentation:

To specify which encoding to use when reading the external file, specify the ENCODING= option:

libname myfiles  'SAS data-library';        
filename extfile 'external-file' encoding="utf-8";

data myfiles.unicode;                                                                                                                           
   infile extfile;                                                                                                     
   input Make $ Model $ Year;                                                                                                           
run;

Upvotes: 0

0xFED5550
0xFED5550

Reputation: 576

The simple way to achieve this is Right click your file's metadata step -> Properties

enter image description here

File Parameters -> Advanced

enter image description here

Now type UTF-8 in the encoding options. Press OK and it should be enabled for that file.

enter image description here

Upvotes: 1

Related Questions