Hello,
I use this code to know the size of a table in the data :
ods _all_ close;
ods output members=work.taille;
proc datasets lib=SASDATA mt=data;
quit;
ods _all_ close;
ods listing;
But, i would like to have the results and know the creator/owner of the table. It's possible ?
Thanks
Olivier
AFAIK, SAS does not store the identity of the creator in the dataset metadata. At least sashelp.vtable and dictionary.tables do not show that information.
proc contents does list the Owner Name in its listing output in the Engine/Host Dependent Information section, but you would have to fiddle around with rerouting the output to a file and then interpret that.
Depending on your operating system platform, it would be easier to just do a detailed directory listing and read the original creator from there.
eg on UNIX:
filename oscmd pipe "ls -l directory|grep sas7bdat"; * where directory is the path to your library;
data ownlist;
infile oscmd;
length
owner $8
filname $50
memname $32
;
input;
owner = scan(_infile_,3," ");
filname = scan(_infile_,9," ");
memname = scan(filname,1,".")
drop filname;
run;
Hello !
Thanks, SAS is under Windows, the code seems work. But, i haven't enough authorization to pipe access. Maybe only super admin could access to this function.
Thanks
So, you problem looks like this:
SAS does not store the identity of the creator of a dataset on its own.
Said identity is only accessible trough operating system functions
You cannot access the OS functions from SAS
So you either have to get that information outside of SAS, or the SAS admin needs to enable xcmd for you.
Info on getting file owner in windows
(After reading that, I once again am aware how blessed I am to run SAS on a UNIX server; one can clearly see how user security was bolted on sideways very late in the Windows development history)
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.