title: Import blob through SAS from ORACLE DB
body: <p>Good time of a day to everyone.
  I face with a huge problem during my work on previous week. 
  Here ia the deal:</p>
  
  <p>I need to download exel file (blob) from ORACLE database through SAS.
  I am using:</p>
  
  <ol>
  <li><p>First step i need to get data from oracle. I used the construction (blob file is nearly 100kb):</p>
  
  <pre><code>proc sql;
  connect to oracle;
  create table SASTBL as 
  select * from connection to oracle (
  select dbms_lob.substr(myblobfield,1,32767) as blob_1,
  dbms_lob.substr(myblobfield,32768,32767) as blob_2,
  dbms_lob.substr(myblobfield,65535,32767) as blob_3,
  dbms_lob.substr(myblobfield,97302,32767) as blob_4
  
    from my_tbl;
  );
  quit;
  </code></pre></li>
  </ol>
  
  <p>And the result is:</p>
  
  <pre><code>    blob_1 = 70020202020202...02
      blob_2 = 02020202020...02
      blob_3 = 02020202...02
  </code></pre>
  
  <p>I do not understand why the field consists from "02"(the whole file)</p>
  
  <p>And the length of any variable in sas is 1024 (instead of 37767) $HEX2024 format.
  If I ll take:</p>
  
  <p>dbms_lob.substr(my_blob_field,2000,900) from the same object the result will mush more similar to the truth: 
            blob = "A234ABC4536AE7...."</p>
  
  <p>The question is: 1. how can i get binary data from blob field correctly trough SAS? What is my mistake?</p>
  
  <p>Thank you.</p>
  
  <p><strong>EDIT 1:</strong></p>
  
  <p>I get the information but  max string is 2000 kb. </p>