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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 2056 views
  • 2 likes
  • 3 in conversation