SAS Data Integration Studio, DataFlux Data Management Studio, SAS/ACCESS, SAS Data Loader for Hadoop and others

how to save the base table only records in data set after PROC compare process?

Accepted Solution Solved
Reply
Regular Contributor
Posts: 223
Accepted Solution

how to save the base table only records in data set after PROC compare process?

Hi All,

 

    I did proc compare and from the below coding I get the records in the base table1 only, my question is these records only show in the resuts tab in SAS, how I can save these records in SAS data set? Thank you!

 

Proc compare base = table1 compare = table2 listbase;

ID record_ID;

Run;

 

Thanks,

Jade


Accepted Solutions
Solution
‎10-27-2017 03:22 PM
Valued Guide
Posts: 570

Re: how to save the base table only records in data set after PROC compare process?

Try something like this example where OUTNOEQUAL tells Proc Compare to only output records which are not equal and OUTBASE to only output records from the base table

 

data class;
	set sashelp.class;
	if name="Alice" then age=99;
run;

proc compare base=sashelp.class compare=class listbase out=diffs outnoequal outbase;
run;

View solution in original post


All Replies
Solution
‎10-27-2017 03:22 PM
Valued Guide
Posts: 570

Re: how to save the base table only records in data set after PROC compare process?

Try something like this example where OUTNOEQUAL tells Proc Compare to only output records which are not equal and OUTBASE to only output records from the base table

 

data class;
	set sashelp.class;
	if name="Alice" then age=99;
run;

proc compare base=sashelp.class compare=class listbase out=diffs outnoequal outbase;
run;
Regular Contributor
Posts: 223

Re: how to save the base table only records in data set after PROC compare process?

Posted in reply to ChrisBrooks

Thank you!

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 141 views
  • 0 likes
  • 2 in conversation