please try this code.
I think the Excel file was created on a PC with wlatin1 character encoding. So, the encoding of the first filename needs to be wlatin1. The encoding of the next filename needs to be utf-8 so that emoji can be imported into SAS.
You can use any file name you want, even temp.dat. The following code will create the file in the work library.
filename mon_f "%sysfunc(pathname(work))\temp.dat" encoding='wlatin1';
libname x xlsx "XXXXX\data_act.xlsx";
data _null_;
set x.TWEET_ACTIVITY_METRICS_AG2RLMP_;
file mon_f lrecl=1000000;
if notdigit(scan(Identifiant_du_Tweet__Permalien,1,',')) and length(scan(Identifiant_du_Tweet__Permalien,1,','))>1 then
put '|' @;
else if length(scan(Identifiant_du_Tweet__Permalien,1,','))>1 then
do;
put;
end;
len=lengthn(Identifiant_du_Tweet__Permalien);
put Identifiant_du_Tweet__Permalien $varying32767. len @;
run;
filename mon_f;
filename mon_f "%sysfunc(pathname(work))\temp.dat" encoding='utf-8' nobom;
proc import datafile=mon_f dbms=csv out=donnee replace;
getnames=no;
run;
filename mon_f;
libname x;
... View more