BookmarkSubscribeRSS Feed
vkrishna
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"
debug; 
libname CANDID json;

LOG:
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: 
 ["9ecc8ffa-f2b0-453a-a666-257128cf9e99","cd5fc783-7708-4aae-ae34-a06876951acf","2b0b37ab-05f3-478a-b68f-0e949395fc1d","ed24980
 0-fcdc-4cf5-89e8-abc90bc7209a","06c21540-5fd6-471d-a205-6eaa8b4a7eda","56c40204-7c1a-4c69-8a83-3aaa7543f954","
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.

 

Thanks,

Vamsi

 

2 REPLIES 2
ChrisHemedinger
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.

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
vkrishna
Quartz | Level 8

Hi @ChrisHemedinger,

 

Is it Sharepoint?

No

 

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?

 

Thanks,
Vamsi

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

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

View all other training opportunities.

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