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!

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1316 views
  • 2 likes
  • 2 in conversation