%macro contents(dataset,directory=0,work=work); /* ========================Use this contents macro instead of content (renamed oldcontent.sas, not maintained).=======*/ %*--generates a proc contents report with variable info in physical variable order. Options: directory=1 to get a detailed directory listing in addition to contents of specified dataset. directory=2 to get a detailed directory listing only, in which case dataset becomes a libref Specify _all_ as dataset to get contents on all data sets in the directory. %local lib dset; %if %superq(dataset)=%str() %then %do; %let dataset=&syslast; %*---new default value---; %put dataset= &dataset; %end; %let dset=%scan(&dataset,2); %if &dset=%str() %then %do; %if &directory=2 %then %let lib=&dataset; %else %let lib=&work; %let dset=&dataset; %end; %else %do; %let lib=%scan(&dataset,1); %end; proc datasets library=&lib nolist; %if &directory ne 2 %then %do; contents data=&dset varnum fmtlen details; run; %end; %if &directory %then %do; contents data=_all_ nods details directory; run; %end; quit; %mend contents;