BookmarkSubscribeRSS Feed
ColmSmyth
Fluorite | Level 6
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
4 REPLIES 4
ChrisHemedinger
Community Manager
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
SAS For Dummies 3rd Edition! Check out the new edition, covering SAS 9.4, SAS Viya, and all of the modern ways to use SAS!
Peter_C
Rhodochrosite | Level 12
and it is not an issue for base SAS library engine. I've tested 70 OK
ColmSmyth
Fluorite | Level 6
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
ColmSmyth
Fluorite | Level 6
Thanks Chris...I have just moved my clear statements to after each out file so it clears as it goes.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 2062 views
  • 0 likes
  • 3 in conversation