Hello, I have an XML file to import into SAS BASE. The line to import this file are into the enclosed zip in attachment.
The error is "Some code points did not tanscode ..."
The XML is encoding in ISO-8159-1 with some HMTL caracters like &#____ as pattern;
Someone have an idea to import all line of the XML ?
Thank you for your reponse
The encoded values are multibyte. You need to run your SAS session in multibyte mode in order to transcode these values and write them as multibyte to a SAS table.
Your code as such works for me in a multibyte session. I can replicate the error you get when running SAS in single byte mode.
Running below code will tell you what's set for your SAS session. Talk to your SAS admin/support person to get the info how to create a SAS session in multibyte mode.
proc options group=LANGUAGECONTROL;
run;
.
You could remove these &#___; before importing xml file , if these &#___; were useless.
data _null_;
infile "C:\temp\a\Test.xml";
file "%sysfunc(pathname(work))\Test.xml";
input;
_infile_=prxchange('s/&#\w+;//',-1,_infile_);
put _infile_;
run;
libname tempxml xmlv2 "%sysfunc(pathname(work))\Test.xml" xmlmap ="C:\temp\a\map.map" ;
proc copy in=tempxml out=work noclone;
run;
The encoded values are multibyte. You need to run your SAS session in multibyte mode in order to transcode these values and write them as multibyte to a SAS table.
Your code as such works for me in a multibyte session. I can replicate the error you get when running SAS in single byte mode.
Running below code will tell you what's set for your SAS session. Talk to your SAS admin/support person to get the info how to create a SAS session in multibyte mode.
proc options group=LANGUAGECONTROL;
run;
.
/*
@Patrick is right.
If you were using UNICODE SAS to run code,
you would get right result.
*/
libname tempxml xmlv2 "C:\temp\x\Test.xml" xmlmap ="C:\temp\x\map.map" ;
proc copy in=tempxml out=work noclone;
run;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.