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;

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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