BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
FK1
Lapis Lazuli | Level 10 FK1
Lapis Lazuli | Level 10

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:

 

a_versus_b_dataset.JPG

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!!

 

only_b_dataset.JPG

 

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:

a_and_b_dataset_dictionary.JPG

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

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

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.

View solution in original post

2 REPLIES 2
Kurt_Bremser
Super User

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.

FK1
Lapis Lazuli | Level 10 FK1
Lapis Lazuli | Level 10

Thank you, Kurt. You nailed it!

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

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.

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
  • 715 views
  • 2 likes
  • 2 in conversation