BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
BenConner
Pyrite | Level 9

Hi,

 

I see the insertbuff= option for libname statements for relational databases but don't see a corresponding option for arguments available for the pass-through facility.  Read buffers are available but not write buffers?  I must not be looking at it correctly.

 

FWIW, this is using Oracle with SAS 9.4 M5.

 

Thanks!

 

--Ben

1 ACCEPTED SOLUTION

Accepted Solutions
SASKiwi
PROC Star

INSERTBUFF is only relevant when inserting rows into a database table from a SAS table. You don't do that in SQL passthru but usually via a LIBNAME like so:

libname sqlsrvr ODBC noprompt = "<sql connection string>" insertbuff = 10000;

proc datasets library = sqlsrvr;
  append base = MyDatabaseTable data = WORK.MySASTable;
run;
quit;

Having said that you can do this which will apply relevant LIBNAME options:

libname sqlsrvr ODBC noprompt = "<sql connection string>" insertbuff = 10000;

proc sql;
  connect using sqlsrvr;
  <put your passthru query here>
quit;

View solution in original post

11 REPLIES 11
SASKiwi
PROC Star

INSERTBUFF is only relevant when inserting rows into a database table from a SAS table. You don't do that in SQL passthru but usually via a LIBNAME like so:

libname sqlsrvr ODBC noprompt = "<sql connection string>" insertbuff = 10000;

proc datasets library = sqlsrvr;
  append base = MyDatabaseTable data = WORK.MySASTable;
run;
quit;

Having said that you can do this which will apply relevant LIBNAME options:

libname sqlsrvr ODBC noprompt = "<sql connection string>" insertbuff = 10000;

proc sql;
  connect using sqlsrvr;
  <put your passthru query here>
quit;
BenConner
Pyrite | Level 9
Sorry for the delay; SAS T.S. looped in and suggested some changes. Resulted in updates to a lot of programs. That said, the root cause hasn't really been found, esp. on pass-throughs. I'll run this by the folks who can decide to try this. I like it. Kind of back-doors the use of a libname statement. 🙂

Will let you know how this goes.

--Ben
ChrisNZ
Tourmaline | Level 20

On top of @SASKiwi 's perfect explanations, don't forget to consider the DBCOMMIT option when inserting data.

When retrieving data, the READBUFF option can be used.

Other options exist too, depending on the database and the connection method, such as FASTLOAD.

BenConner
Pyrite | Level 9
Sigh. They don't have SAS Access for ODBC licensed.
SASKiwi
PROC Star

@BenConner  - What SAS/ACCESS products are installed / licensed? The suggestions I've posted will work equally as well with SAS/ACCESS to Oracle.

BenConner
Pyrite | Level 9
Oh! They do have Access for Oracle. I'll put together a test case for them to try.

Thanks much!
--Ben
ChrisNZ
Tourmaline | Level 20

>  They do have Access for Oracle

Look at option  FASTLOAD then.

BenConner
Pyrite | Level 9

Thanks to all for your help.  This will alleviate the remaining problem the client has been having with failures through the pass-through facility. 

Using a pass-through via a libname is not something I would have thought possible.  Nice!

 

--Ben

BenConner
Pyrite | Level 9
As a followup to this, one of the common parameters we use in the Connect To Oracle statement is a (preservecomments) argument.
I don't see a way to enter this on a connect using <libname> ; statement. Are the comments (in this case, Oracle hints) discarded as they appear to be comments to SAS?
SASKiwi
PROC Star

According to this link, PRESERVE_COMMENTS works on LIBNAMEs: https://documentation.sas.com/?cdcId=pgmsascdc&cdcVersion=9.4_3.5&docsetId=acreldb&docsetTarget=p1qf...

 

And yes you need to use this when including Oracle hints.

BenConner
Pyrite | Level 9
Thanks for catching that. I'd searched but hadn't seen it. Obviously flunked the reading test. 🙂

--Ben

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