BookmarkSubscribeRSS Feed
ankitshah_15
Calcite | Level 5

Hi All,

 

I have a column which has a Image URL. I would like to write a SAS Stored Process which will give me the actual image from the corresponding Image URL in a new column "Image". Is this feasible in SAS Stored Process?

 

Thanks in advance!!!

6 REPLIES 6
Reeza
Super User

Does your database support storing images in a column? AFAIK SAS does not natively but many DBs support this option. 

ankitshah_15
Calcite | Level 5

Hi Reeza,

 

I have the image URLs stored in Netezza DB. It allows storing of URLs in columns

Reeza
Super User

@ankitshah_15 wrote:

Hi Reeza,

 

I have the image URLs stored in Netezza DB. It allows storing of URLs in columns


Unless I'm mistaken, your question seems like you're asking to store the image, not the image URL? Does Netezza support image type columns?

If that's incorrect, what are you trying to do?

ankitshah_15
Calcite | Level 5
Hi Reeza,

Image URL is already stored in one of the columns in the Netezza table. My ask is to automatically fetch the images from the URL and display the image as SAS Output in one of the columns possibly via proc report
Reeza
Super User
That's significantly different than your initial question to store it in a data set. You can use PROC HTTP to download the image and store it locally and reference it or your HTML can reference the URL to include. It depends a bit on your output format, since an HTML report just links usually, HTML5, PDF, RTF, PowerPoint will embed the images. So you need to provide more details on what you're trying to do.

https://blogs.sas.com/content/sasdummy/2012/12/18/using-sas-to-access-data-stored-on-dropbox/

A similar idea to the blog post above can be used to download the file. But not you have it stored locally and still need to reference it somehow.
Vince_SAS
Rhodochrosite | Level 12

Using PROC HTTP to retrieve the image seems to be the correct answer.

 

Use DATA step code to get the desired URL from the Netezza database, store it in a global macro variable, and then use that macro variable in the URL option of PROC HTTP.

 

Vince DelGobbo

SAS R&D

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
  • 6 replies
  • 1404 views
  • 2 likes
  • 3 in conversation