BookmarkSubscribeRSS Feed
alepage
Barite | Level 11

Hello,

 

I have elaborate a simple macro to get the dataset list in a library as well as the number of observations.

However depending on the engine use into the base or spde, my macro need to be adapted.

For the first call, the library use base engine so I need to eliminate the spde wording from the macro, while the second

library use spde engine and the macro work perfectly.

 

Is there a way to check which engine is use in a library in other the make this macro more versatile.

Regards,

Alain

 

 

 

%MACRO nbobsindataset(path=);
libname SOURCE spde "&path.";

Proc sql;
create table want as
select libname,memname, nobs
from dictionary.tables
where libname='SOURCE'
;
QUIT;
%mend nbobsindataset;

/*%nbobsindataset(path=/.../data/bkp);*/
%nbobsindataset(path=/.../sas20206/wc/folder1);

2 REPLIES 2
Reeza
Super User
Have you checked the dictionary.libname table to see what metadata is stored on libraries? I would start there - I may have the name of the table wrong but there's a table in SASHELP that has the libraries and the metadata for said libraries.
ballardw
Super User

Close SASHELP.VLIBNAM

 

or

14   Proc sql;
15      describe table dictionary.libnames;
NOTE: SQL table DICTIONARY.LIBNAMES was created like:

create table DICTIONARY.LIBNAMES
  (
   libname char(8) label='Library Name',
   engine char(8) label='Engine Name',
   path char(1024) label='Pathname',
   level num label='Library Concatenation Level',
   fileformat char(8) label='Default File Format',
   readonly char(3) label='Read-only?',
   sequential char(3) label='Sequential?',
   sysdesc char(1024) label='System Information Description',
   sysname char(1024) label='System Information Name',
   sysvalue char(1024) label='System Information Value',
   temp char(3) label='Temp Access?'
  );

16   quit;

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

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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