BookmarkSubscribeRSS Feed
radha1
Calcite | Level 5

Hi,

 

I compared two data sets, want to keep the compared data in one table.

 

can anyone help me how to display compared data in tabular format in SAS EG.

 

 

Thanks in Advance.

5 REPLIES 5
RW9
Diamond | Level 26 RW9
Diamond | Level 26

From the manual:

http://support.sas.com/documentation/cdl/en/proc/65145/HTML/default/viewer.htm#n1f136xdchlfrtn1663tm...

 

specify out= 

and give a dataset name to store the output.

VDD
Ammonite | Level 13 VDD
Ammonite | Level 13

Please post the SAS code that you are having problems with.  Also include you SAS log.

Lots of SAS code and examples are available online, but you should show your attempts at resolving the problem first so that the experts can help guide.

 

Astounding
PROC Star

If you are not getting much of a response to your question, it's probably because you left out most of the important information.  Here's what you should describe, and not leave to our imagination.

 

"I compared two data sets"

 

  • Are they SAS data sets?
  • How did you compare them?

 

"want to keep the compared data"

 

  • All the data was compared.  So what exactly do you want to keep?  Give the details.  All of them.

 

"in one table"

 

  • In one Excel spreadsheet?  In one SAS data set?  In one DMBS table?

 

"display the compared data"

 

  • At this point, nobody knows what the compared data is, and nobody knows what type of display you would like.
radha1
Calcite | Level 5

Thanks for the response,

 

how to print proc compare results as table or html.

 

the below data have display in html or table format:

 

 

Variables Summary
Number of Variables in Common: 3.
Observation Summary
Observation Base Compare
First Obs 1 1
Last Obs 4 4
Number of Observations in Common: 4.
Total Number of Observations Read from
WORK.DEMOG: 4.
Total Number of Observations Read from
WORK.COMPARE: 4.
Number of Observations with Some Compared Variables
Unequal: 0.
Number of Observations with All Compared Variables
Equal: 4.
NOTE: No unequal values were found. All values
compared are exactly equal.

 

 

Thanks

Astounding
PROC Star

The most flexible way would add this statement before running PROC COMPARE:

 

ods trace on;

 

Then you can see notes in the log about all the pieces of output that ODS stores.  You can capture the ones you want as SAS data sets using multiple ODS OUTPUT statements.

 

Each piece can then be printed using a simple PROC PRINT.  You can add as much formatting as you would like, when it comes time to print.

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 5 replies
  • 704 views
  • 1 like
  • 4 in conversation