a big pointer to your answer was posted by data_null;. Your questions included Can I put an array into the macro somehow so it will loop through all of the views in the library? that can be solved with a loop over those views, fetching first row from each. You should be aware that even just the first row might need a lot of procesing to create. Beware that a data step view will fill at least the first "page" of data which will be more than one row. It was handy to use the loop also to describe these views. First some demo views . data vEmpty /view= vEmpty ; stop ; set sashelp.class ; run; data vSome /view= vSome ; set sashelp.class( obs= 2 ) ; run; proc sql ; create view Vsql1 as select * from sashelp.class( obs= 2 ); create view Vsql0 as select * from sashelp.class( obs= 0 ); quit ; data view_has_obs ; set sashelp.vview( where=( libname ne 'SASHELP' )) ; if engine = 'SASDSV' then call execute( cats( 'data view= ', libname, '.', memname, '; describe ; run ;' )); else call execute( 'proc sql; describe view '!! cats( libname, '.', memname,'; quit;' )); Vid = open( cats( libname, '.', memname), 'is' ) ; if not VID then do ; putlog 'VIEW_TROUBLE: ' (_all_)(=) ; _error_=0 ; has_obs = . ; end ; else do ; has_obs = ( not fetch( Vid ) ) ; rc = close( Vid ) ; end ; keep libname memname engine has_obs ; run ; proc print label data= view_has_obs ; id libname memname ; var has_obs engine ; title j=l 'peterC view info' j=c 'HAS-(any)-OBS' ; footnote j=r "run %sysfunc(datetime(),twmdy) by &sysuserID" ; option nodate nonumber; run ;
... View more