DATA Step, Macro, Functions and more

Filename URL -> ERROR: Unauthorized to retrieve URL. Use the debug option for more info.

Reply
Occasional Contributor
Posts: 10

Filename URL -> ERROR: Unauthorized to retrieve URL. Use the debug option for more info.

I am trying to access intranet site using SAS URL filename.


filename Candies URL "http://insite.xxxx.com/xxxx/xxxx.html" debug puser="abcdef" ppass="xxxxxx";


data _null_;
   infile Candies length=len;
   input record $varying200. len;
   put record $varying200. len;
   if _n_=15 then stop;
run;

log:

NOTE: >>> GET /xxxx/xxxx.html HTTP/1.0

NOTE: >>> Host: xxxx.xxxx.com

NOTE: >>> Accept: */*.

NOTE: >>> Proxy-Authorization: Basic YzY5MTkyOnh4eHh4eA==

NOTE: >>> Accept-Language: en

NOTE: >>> Accept-Charset: iso-8859-1,*,utf-8

NOTE: >>> User-Agent: SAS/URL

NOTE: >>>

NOTE: <<< HTTP/1.0 302 Object Moved

NOTE: <<< Expires: Thu, 01 Dec 1994 16:00:00 GMT

NOTE: <<< Location:

http://xxxx.xxxx.com/siteminderagent/ntlm/creds.ntc?CHALLENGE=&SMAGENTNAME=-SM-47H8Wn

NNzFyE3UZYD%2bIfBdnJKDkWWSzZs%2bhUkvpF7jRaPuKbfBYqQL0n%2bRzZmsti&TARGET=-SM-http%3a%2f%2fin

site%2exxxxt%2ecom%2fxxxx%2fdefault%2ehtml

NOTE: <<< Content-Length: 0

NOTE: <<<

NOTE: >>> GET

/sitemxxxeragent/ntlm/creds.ntc?CHALLENGE=&SMAGENTNAME=-SM-47H8WnNNzFyE3UZxx%2bIfBdnJKDkWWS

zZs%2bhUkvpF7jRaPuKbfBYqQL0n%2bRzZmsti&TARGET=-SM-http%3a%2f%2finsite%2exxet%2ecom%2fPxxj

ectxOxe%2fdxxxault%2ehtml HTTP/1.0

NOTE: >>> Host: ixxxxet.xxxx.com

NOTE: >>> Accept: */*.

NOTE: >>> Proxy-Authorization: Basic YzY5MTkyOnh4eHh4eA==

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: <<< Content-Length: 5064

NOTE: <<< Content-Type: text/html

NOTE: <<< Server: Microsoft-IIS/6.0

NOTE: <<< WWW-Authenticate: Negotiate

NOTE: <<< WWW-Authenticate: NTLM

NOTE: <<< X-Powered-By: ASP.NET

NOTE: <<< Date: Thu, 19 Mar 2015 19:12:46 GMT

NOTE: <<< Connection: close

NOTE: <<<

ERROR: Unauthorized to retrieve URL. Use the debug option for more info.

NOTE: The SAS System stopped processing this step because of errors.

NOTE: DATA statement used (Total process time):

real time 0.48 seconds

cpu time 0.04 seconds

Occasional Contributor
Posts: 10

Re: Filename URL -> ERROR: Unauthorized to retrieve URL. Use the debug option for more info.

I have contacted SAS tech support and they have pointed me to this SAS notes. This doesnt help. Please advise.

Usage Note 15692: URL filename engine only supports BASIC authentication on web server
  

When you attempt to read web server data using the URL filename engine, the following error message might appear

   ERROR: Unauthorized to retrieve URL

and with the DEBUG option

   NOTE: <<< HTTP/1.1 401 Unauthorized

even when supplying valid credentials with the USER and PASS options. Using the DEBUG option on the filename might show the cause to be the web server's use of an authentication method other than BASIC.  Notice
the DEBUG line below:

   NOTE: <<< WWW-Authenticate: NTLM

The URL engine will not properly authenticate to a web server unless it uses the BASIC authentication protocol.

Ask a Question
Discussion stats
  • 1 reply
  • 941 views
  • 1 like
  • 1 in conversation