- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi!
I'm using the code below to generate the XML file from API and I want to save it to C:\Users\Desktop\Sample1\From URL\curl\savedfile.xml as an xml file. But after the execution the windows explorer of the path just popping up and no file was created
May I know what is the best way to save the xml file in my computer?
Thank you!
x "curl -k https://root:Tr3nd512345@rbc-svr-pi/webacs/api/v1/data/ClientDetails?.full=true > C:\Users\Desktop\Sample1\From URL\curl\savedfile.xml";
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
What happens when you run the command:
curl -k https://root:Tr3nd512345@rbc-svr-pi/webacs/api/v1/data/ClientDetails?.full=true > C:\Users\Desktop\Sample1\From URL\curl\savedfile.xml
From the command prompt? Its likely you, or the place where SAS is installed is missing a permission, or the location. You can try:
filename tmp pipe 'curl -k https://root:Tr3nd512345@rbc-svr-pi/webacs/api/v1/data/ClientDetails?.full=true > C:\Users\Desktop\Sample1\From URL\curl\savedfile.xml'; data test; length buff $2000; infile tmp dlm="¬"; input buff $; run;
That should get the messages back from the system. Maybe there is no path like that on C: (which is where SAS is installed not necessarily your local machine) or maybe you (or the SAS install) doesn't have permission to access that https site.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi @RW9,
When using the X statement, the command shows the exact details of the XML file. That is, we have a peermission to access the https. Do you know where I can check the SAS missing permission that you are saying?
Also, the log resulted 0 obs using the filename pipe as the image shows.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I would check with your IT group. It sounds like SAS is installed on a network, and may need to be given the same permissions as your local machine.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Two other things you could try - turn xwait on:
options xwait;
Any OS window that opens will not close automatically, so you may see further information. Also try running it from %sysexec:
http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#a000171045.htm
And just to check again, if you goto the OS window, and run that command it does work? It just seems strange as SAS local would just push the text out to the OS to run, so it should be exactly the same.
Also, you have spaces inside the path (never recommended!) so you might need to quote the path (i have quoted both the https and path, try either if that doesn't work):
x 'curl -k "https://root:Tr3nd512345@rbc-svr-pi/webacs/api/v1/data/ClientDetails?.full=true" > "C:\Users\Desktop\Sample1\From URL\curl\savedfile.xml"';
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
If you could run
x "curl -k https://root:Tr3nd512345@rbc-svr-pi/webacs/api/v1/data/ClientDetails?.full=true > want.xml";
then WANT.XML should be under the same folder/directory with curl.exe , Check Where CURL is installed .