BookmarkSubscribeRSS Feed
xxformat_com
Barite | Level 11

Hi,

The SAS Online Documentation suggests that memtype=data in the contents statement of proc datasets.

But when I'm testing with a vew, it seems that memtype=all by default. Did I miss something?

 

 

contents_statement.JPG

https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/p1v2467vdjbp7xn1222c7t3sejz3.htm

 

 

data vclass / view=vclass;
    set sashelp.class;
run;

title 'proc contents';
proc contents data   =vclass 
              memtype=view; *memtype=data by default;
run;

title 'proc datasets';
proc datasets lib=work memtype=cat nolist;
    contents data=vclass;* memtype=all by default; 
    run;
quit;

 

 

3 REPLIES 3
Sajid01
Meteorite | Level 14

Hello
Both memtype=view and memtype=all work.
Test with the followig sample code.

data classv / view = classv ;
set sashelp.class;
run;
proc datasets lib=work memtype=view nolist;
    contents data=classv;* memtype=all by default; 
    run;
quit;
proc datasets lib=work memtype=all nolist;
    contents data=classv;; 
    run;
quit;
xxformat_com
Barite | Level 11
My issue is not to be unable to use views.

My issue is the discrepancy
between the online documentation (memtype is said to be data by default)
and what is actually happening (memtype is all - both view and data to be precise - by default)
when using the contents statement of proc datasets.
Sajid01
Meteorite | Level 14

Hello @xxformat_com 
I don't see any descripancy in the documentation and practice.

But when I'm testing with a vew, it seems that memtype=all by default. Did I miss something?

Well when using Contents with Proc datasets one is normally expected to mention the memtype. However it is not necessary.If we do not use the memtype= option in the Proc datasets statement, it takes the value as all (the default value ) and itereates through the all applicable (view and data for contents in addition to all) and generates the result.

Default option is essentially the option the procedure takes when nothing is mentioned.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

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
  • 3 replies
  • 1085 views
  • 0 likes
  • 2 in conversation