BookmarkSubscribeRSS Feed
Quartz | Level 8

Hello All,


I'm trying to run the following SAS code but struck with "Unauthorized to retrieve URL" error.

In SAS usage note :15692 it is reported as "FILENAME statement URL access method supports only BASIC authentication on a web server"

Can someone help me with this? 

How to pass this error?


filename CANDID url "http://xxxxxxxxxxxxxxxxxxxxxxxxx"
libname CANDID json;

filename CANDID url "http://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
27 debug;
28 libname CANDID json;
NOTE: JSON data is only read once. To read the JSON again, reassign the JSON LIBNAME.
NOTE: >>> GET xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx HTTP/1.0
NOTE: >>> Host: xxxxxxxxxxxxxx
NOTE: >>> Accept: */*
NOTE: >>> Accept-Language: en
NOTE: >>> Accept-Charset: iso-8859-1,*,utf-8
NOTE: >>> User-Agent: SAS/URL
NOTE: >>> 
NOTE: <<< HTTP/1.1 401 Unauthorized
NOTE: <<< Cache-Control: private
NOTE: <<< Content-Type: text/html; charset=utf-8
NOTE: <<< Server: Microsoft-IIS/8.5
NOTE: <<< X-MiniProfiler-Ids: 
NOTE: <<< WWW-Authenticate: Negotiate
NOTE: <<< WWW-Authenticate: NTLM
NOTE: <<< X-Powered-By: ASP.NET
NOTE: <<< X-UA-Compatible: IE=edge,chrome=1
NOTE: <<< Date: Wed, 31 Jan 2018 23:22:25 GMT
NOTE: <<< Connection: close
NOTE: <<< Content-Length: 6025
NOTE: <<< 
ERROR: Unauthorized to retrieve URL. Use the debug option for more info.
ERROR: Error in the LIBNAME statement.





Community Manager

I prefer PROC HTTP for this work -- it provides more authentication and debugging options.


What type of website are you accessing?  Is it Sharepoint?  That might require a special authentication.

Quartz | Level 8

Hi @ChrisHemedinger,


Is it Sharepoint?



What type of website are you accessing? 

The website I'm trying to access is using ASP.NET impersonation and windows authentication. We want to create data set directly from URL instead if creating Json file and again read that file into the SAS using Data step.


Is it possible to use Filename statement with URL for the authentication that I mentioned above or Is there any way to pass the credentials?





Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Get the $99 certification deal.jpg



Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 1 like
  • 2 in conversation