BookmarkSubscribeRSS Feed
Darshan_Saini
Calcite | Level 5

Hi All,

 

Is it possible to extract the BLOB (Binary large objects) data from database (DB2/ORACLE/POSTGRES) and convert it into the actual file either it is pdf/excel/word or jpg using SAS Code?

 

I have tried to write the code and I am able to extract the BLOB into actual file where the BLOB length is less than 32767 however for some records the length is greater than 3L so in those cases i have created multiple variables of max length that SAS supports and concatenated these variables while writting to the output file stream. Still the file generated as corrupt. 

 

If anyone of you had faced the similar kind of issue and got the solution already please provide your inputs it will be very helpful.

 

Thanks and Regards,

Darshan Saini

5 REPLIES 5
Ksharp
Super User
Can you transform BLOB into Character type column and import SAS ?


Darshan_Saini
Calcite | Level 5

In that case also SAS can accept maximum 32767 length only for a variable. I have tried that approach earlier however when I am concatenating the variables and setting to file there it seems to have some problem and the actual file is not getting generated.

LinusH
Tourmaline | Level 20
Short answer: no.
What benefit is it use SAS for this?
I think that there is some support for BLOBs in Viya, but that's too far away for your requirement I assume...
Data never sleeps
Darshan_Saini
Calcite | Level 5
Thanks LinusH for the response.

Let me clarify for you here.

I am migrating SAS Oprisk Monitor 3.4 to latest SAS Enterprise GRC 6.1 so I was just trying to extract all the attachments from older version and migrate to newer version on content server.

Benefit is No need to use the custom java or javascript code if we can achieve the solution in SAS itself
LinusH
Tourmaline | Level 20
Ok. If the BLOBs are a part of a SAS solution you may want some guidelines from them how to do the migration.
Data never sleeps

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 5 replies
  • 2254 views
  • 0 likes
  • 3 in conversation