BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi All-

Is it possible to suppress the Engine/Host and Attribute information and have only the variable information? If so, how can this be done?

Also under Proc Compare, is it possible to have "Dataset Summary" only and suppress other two variable and observation summary?

Any help would be appreciated.

Thanks,
Priya
3 REPLIES 3
Cynthia_sas
SAS Super FREQ
Hi:
Take a look at the ODS SELECT statement. For example, if you use ODS TRACE ON/ODS TRACE OFF to get the name of your output object of interest, then you can select just that output object.

For example, if I run this code, on SAS 9.2:
[pre]
ods trace on / label;
proc contents data=sashelp.class;
run;
ods trace off;
[/pre]

Then I find in the LOG that the output object for the VARIABLES information is:
[pre]
Output Added:
-------------
Name: Variables
Label: Variables
Template: Base.Contents.Variables
Path: Contents.DataSet.Variables
Label Path: 'The Contents Procedure'.'SASHELP.CLASS'.'Variables'
-------------
[/pre]

So, now, I can SELECT only the VARIABLES output object for my output, by modifying the original PROC CONTENTS step to be:
[pre]
ods listing;
ods select variables;
proc contents data=sashelp.class;
run;
[/pre]

You can use this method (ODS TRACE to get the output object name and then ODS SELECT to only get that output object in your result file) for any procedure that produces output objects -- either tabular or graphical output objects in order to select (or exclude) just your output object of interest.

Note that the ODS SELECT statement must be placed IMMEDIATELY before your procedure of choice. For example, this would be unacceptable because PROC PRINT does not create a VARIABLES output object:
[pre]
ods listing;
ods select variables;

proc print data=sashelp.class;
run;

proc contents data=sashelp.class;
run;
[/pre]

and would produce this warning in the LOG:
[pre]
WARNING: Output 'variables' was not created. Make sure that the output object name, label, or
path is spelled correctly. Also, verify that the appropriate procedure options are
used to produce the requested output object. For example, verify that the NOPRINT
option is not used.

[/pre]

cynthia
deleted_user
Not applicable
Thanks, Cynthia. That helped.

Also any suggestions regarding my question about Proc Compare: to supress variable and observation summary and to display only Dataset summary?

Thanks,
Priya
deleted_user
Not applicable
Never mind, the same concept of ODS trace on/off works for Proc Compare too...Thanks for your help.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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