Hi Everyone,
suppose, I create a dataset "A" which has no colums:
data a;
run;
and another dataset, "B", which has columns:
data b;
set sashelp.class;
run;
Now, when I run PROC CONTENTS with the intention to get information about the datasets, which are located in the WORK-Library - as is also shown in Enterprise Guide:
proc contents data=work._ALL_ out=work.list_of_datasets_proc_contents noprint memtype=data;
run;
, I only get information about dataset "B". The "A" dataset is not listed, even though it is displayed!!
However, when I use PROC SQL with the DICTIONARY-Library:
PROC SQL;
create table list_of_datasets_proc_sql as select *
from dictionary.tables
where upcase(libname) in ("WORK") and memtype eq "DATA"
order by libname, memname
;
quit;
I get CORRECTLY displayed, that there is also a dataset "A" which has metadata:
Why is this behavior occuring?
Shouldn`t PROC CONTENTS at least also give out the information, that there exists a "A" datset?
Any insights are highly appreceated.
Cheers,
FK1
The dataset created by PROC CONTENTS is equivalent to DICTIONARY.COLUMNS, and since you do not have any columns ...
If you run CONTENTS without the NOPRINT option, you'll get the tables containing the dataset attributes, but no variable listing for A.
The dataset created by PROC CONTENTS is equivalent to DICTIONARY.COLUMNS, and since you do not have any columns ...
If you run CONTENTS without the NOPRINT option, you'll get the tables containing the dataset attributes, but no variable listing for A.
Thank you, Kurt. You nailed it!
Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.
Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.
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.
Ready to level-up your skills? Choose your own adventure.