BookmarkSubscribeRSS Feed
Luisafhc
Calcite | Level 5

Dear all, 

 

I have txt file, delimited by '¬' and with spanish accents like 'á', 'é' or 'ñ'

 

Everytime i've tried to encode as wlatin1, it doesn't worked due to the delimiter type but using UTF-8, is well-recognized the fields but all the accents appear in the same and weird form "�".

 

Code:

__________________________________________________________________________________________________

options compress=yes;
LIBNAME RETAIL 'G:\SASData\Riesgos\Herramientas y Metodologías\Cosechas';
FILENAME MR "G:\SASData\RCI_Compartida\Riesgos\Mina de Riesgos\RCI_MR_20191231.txt"
ENCODING='UTF-8'
LRECL=32767;

 

PROC IMPORT
DATAFILE= MR
OUT=WORK.MINARIESGOS
DBMS=DLM
REPLACE;
DELIMITER="¬";
GETNAMES=YES;
RUN;

__________________________________________________________________________________________________

 

I looked for some solutions in several posts without success. Also, i don't have admin rights to modify SAS parameters.

 

Appreciate any kind of help in this topic.

 

Thank you. Luisa.

 

3 REPLIES 3
andreas_lds
Jade | Level 19

Your sas-session uses utf-8?

Luisafhc
Calcite | Level 5
Hello @andreas_lds, yes it uses utf-8.

Thanks.
andreas_lds
Jade | Level 19

Strange. The problem could be the encoding of the file. If it is in utf-8-bom then importing it should not be a problem, sas should even recognize the encoding automatically.

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