Hello everyone:
I have a question, I trying read an xml file from a webservice, all is ok until I want load result into a dataset. The problem occurrs by an accent into xml tag, by example <country>México</country>.
This is the code:
filename response '/tmp/Output.xml';
filename respmap '/tmp/Output.map';
Libname response xmlv2 xmlmap=respmap automap=replace;
Libname clmfile XMLV2 '/tmp/Output.xml' XMLMAP='/tmp/Output.map';
The error is:
ERROR: The creation of the XML Mapper file failed.
ERROR: Error in the LIBNAME statement.
Thanks in advance.
Hello everyone:
I can resolve the problem with this lines
proc soap in=<filein> out=<fileout> url=<url> soapaction=<soapaction> envelope;
envelop is an option of proc soap that store complete soap result in the outputfile, fileout in this case. The complete result include
<?xml version="1.0" encoding="iso-8859-1" ?>
Thanks very much.
What encoding is your SAS session using? Run either of these lines of code to find out.
proc options option=encoding; run;
%put %sysfunc(getoption(encoding));
Hello Tom:
Thanks for your help the result was:
%put %sysfunc(getoption(encoding));
LATIN1
Thanks in advance.
You will probably need to run SAS with unicode support so that it can handle the characters.
You might be able to just get away with adding an ENCODING=option to the filename statement that points to the XML file.
filename x temp;
Libname response xmlv2 '/tmp/Output.xml' xmlmap=x automap=replace;
proc copy in=response out=work noclone;
run;
Hello everyone:
I add manually
<?xml version="1.0" encoding="iso-8859-1" ?>
to the out file of proc soap, and work very well. ¿proc soap can add this automatically?
Thanks in advance.
Hello everyone:
I can resolve the problem with this lines
proc soap in=<filein> out=<fileout> url=<url> soapaction=<soapaction> envelope;
envelop is an option of proc soap that store complete soap result in the outputfile, fileout in this case. The complete result include
<?xml version="1.0" encoding="iso-8859-1" ?>
Thanks very much.
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.