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
Ammonite | Level 13

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

 

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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