BookmarkSubscribeRSS Feed
MAGG
Obsidian | Level 7

I get an error after submitting this code. How to fix this.
I could not find a proc http example with #rawUpload


%let baseurl=%sysfunc(getoption(SERVICESBASEURL)); proc http method=POST url="&baseurl./files/files/#rawUpload" in = 'sample file bytes' oauth_bearer = sas_services; debug level=1; headers 'Accept'= 'application/vnd.sas.collection+json'; run;

 

2 REPLIES 2
SASJedi
SAS Super FREQ

In the code you posted, the #rawupload is part of the URI: 

proc http

   method=POST

   url="&baseurl./files/files/#rawUpload"

 

In a URI, the # indicates a named anchor, expressed in the HTML as an ID tag, in an HTML document. I've never seen one used in an API URI before. You will need to refer to your API documentation to properly construct the URI for your PROC HTTP step. 

To clarify what I mean by a named anchor, this URL leads to the SAS documentation for the DOLLAR format:
https://go.documentation.sas.com/doc/en/pgmsascdc/v_026/leforinforref/p03sgbuduqemljn1nqj7qm1leql9.h...

But I want to send you a link that will take you straight to the Syntax portion of the page:

SASJedi_1-1666094849139.png

I inspect the page source and see the named anchor (ID) encoded in the HTML:

<h2 class="xisDoc-title" id="p13eaxol6sdchqn1atunoasthxge">Syntax</h2>

So I add the named anchor to the URL:

https://go.documentation.sas.com/doc/en/pgmsascdc/v_026/leforinforref/p03sgbuduqemljn1nqj7qm1leql9.h...#p13eaxol6sdchqn1atunoasthxge

And the link now leads straight to the Syntax section:

SASJedi_2-1666095097450.png

 

Check out my Jedi SAS Tricks for SAS Users
MAGG
Obsidian | Level 7

 

Thank you for the the suggestion!

 

 

The official api-documentation is as follows:

 

I'am still interpreting this in a strict literal manner. In the documention there is nothing  one should replace the # with something else. But maybe I'm wrong

MAGG_0-1666119937213.png

 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 664 views
  • 1 like
  • 2 in conversation