Help using Base SAS procedures

json into a SAS datset

Posts: 37

json into a SAS datset

[ Edited ]

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
Posts: 3,432

Re: json into a SAS datset

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.

Posts: 37

Re: json into a SAS datset

[ Edited ]
Posted in reply to ChrisHemedinger

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?



Ask a Question
Discussion stats
  • 2 replies
  • 1 like
  • 2 in conversation