DATA Step, Macro, Functions and more

Libname Connection Limitation

Reply
Occasional Contributor
Posts: 11

Libname Connection Limitation

Hi all,

Is there a max number of connection libnames in SAS 9.2, I have code that outputs reports to many seperate XLS connections using libname.

Some info on google about it regarding limit of 65 connections but nothing official from SAS.

The error I get is:
ERROR: Connect: Unspecified error

If will not go away unless i clear a a libname to free up the connection space.

Thanks

Colm
Community Manager
Posts: 2,757

Re: Libname Connection Limitation

Colm,

I've confirmed that's the limit (64 connections):
[pre]
%macro excelMany(howMany);
%do i = 1 %to &howMany;
libname test&i. excel path="c:\sas\data\test.xls";
%end;
%mend;

%excelMany(65);
[/pre]
This generates an error on the 65th assignment. The workaround is to clear the other libnames before you assign another one.

The MS Jet API (used for this type of connection) does have a limitation of 128 sessions, I've read. It might be that each libref connection uses 2 of those sessions in SAS, but that's a guess on my part.

Chris
Valued Guide
Posts: 2,174

Re: Libname Connection Limitation

and it is not an issue for base SAS library engine. I've tested 70 OK
Occasional Contributor
Posts: 11

Re: Libname Connection Limitation

It strange then as im running Base now and i get the error on 64...ohh well perhaps some installations are different ?

At any rate I have work around now so its ok.

Cheers
Occasional Contributor
Posts: 11

Re: Libname Connection Limitation

Thanks Chris...I have just moved my clear statements to after each out file so it clears as it goes.
Ask a Question
Discussion stats
  • 4 replies
  • 292 views
  • 0 likes
  • 3 in conversation