Hi!
I would like to ask if SAS have a tool to pull an XML file automatically OR are there scripts that can pull the XML file?
Thank you!
What do you mean by 'pull an XML file'? Are you trying to read it into a dataset?
If so, try the XML Mapper tool.
So you have an XML file that your adding to? Please explain in detail what your trying to do. The terminology isn't clear to me, but XML isn't my area. However, I have used SAS to both create and read XML file.
Okay,here's the scenario. The XML file is from the Cisco Prime API. What I am doing in order to get the XML file is by right clicking and then "save page as...".
Now, what I am askin' / want to know is if there's a way in SAS in order to automatically generate the XML file.
Ok. So you want to automatically reference an XML file generated by an API. There should be a URL or http method to access the data.
See the links below, the second is probably closer to what you want.
http://blogs.sas.com/content/sasdummy/2012/12/18/using-sas-to-access-data-stored-on-dropbox/
Hi,
I followed the query
filename nhl url 'http://www.a.com/Nhl.xml';
filename map 'C:\My Documents\XML\Nhl.map';
libname nhl xml xmlmap=map;
proc copy indd=nhl outdd=work;
select nhl;
run;
But the resulted data set has no rows as shown in the image below. Do you have any idea about it?
If that is a HTML file , you don't need to transform it into XML , read HTML directly . Like :
filename x url 'http://www.sas.com';
data want;
infile x recfm=n dlm='<>' ;
input @'>' x : $2000. @@;
run;
Hi!
I used this script and I successfully generate an xml file.
FILENAME outfile "C:\Users\jgmanalo\Desktop\Sample1\From URL\OutXML.xml";
LIBNAME source XML 'C:\Users\jgmanalo\Desktop\Sample1\From URL\outxml.xml';
PROC HTTP
OUT = outfile
URL = 'https://rbc-svr-pi/webacs/api/v1/data/ClientDetails?.full=true'
METHOD = 'GET';
RUN;
The XML file that I want is this
But what I'm only getting is this
Is there something wrong with the script?
Thank you!
Since you can download XML file, Try this code :
FILENAME outfile "C:\Users\jgmanalo\Desktop\Sample1\From URL\OutXML.xml";
LIBNAME source XML 'C:\Users\jgmanalo\Desktop\Sample1\From URL\outxml.xml';
PROC HTTP
OUT = outfile
URL = 'https://rbc-svr-pi/webacs/api/v1/data/ClientDetails?.full=true'
METHOD = 'GET';
RUN;
filename xx temp;
libname xx xmlv2 'C:\Users\jgmanalo\Desktop\Sample1\From URL\OutXML.xml' automap=replace xmlmap=xx;
proc copy in=xx out=work;
run;
Hi,
I tried the code that you gave but an error occured
That is encoding problem. Maybe try this :
FILENAME outfile "C:\Users\jgmanalo\Desktop\Sample1\From URL\OutXML.xml" encoding='utf-8';
FILENAME outfile "C:\Users\jgmanalo\Desktop\Sample1\From URL\OutXML.xml" encoding='utf-16le';
This should be the content of dataset or the dataset should be look like the image below
But the URL is not accessible outside.
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.