Help using Base SAS procedures

how to generate a new dataset after proc compare

Reply
Super Contributor
Posts: 345

how to generate a new dataset after proc compare

after merging, with proc sql, different selection generate different numbers of obs

i want to compare the difference of these two datasets, i would prefer to have a new dataset, such as out=

 

proc compare base=emp95_byidnum compare=emp96_byidnum
             out=result outnoequal outbase outcomp outdif
     noprint;
   id idnum;
run;

it seems that noprint option does not work

 

any advice, i do not want to compare the difference of these variables, but really want to see different obs whether they have any differences in dates (two variables, dayin and dayout) only

thanks

Super User
Posts: 11,343

Re: how to generate a new dataset after proc compare

Please describe what you mean by "noprint option does not work". Since the example code you show is from the online documentation if you create the datasets for the example there is no printed output.

 

Please provide an example of some input data sets, preferrably as datastep code, and what you desire for the output.

New User
Posts: 1

Re: how to generate a new dataset after proc compare

When used with the TRANSPOSE option, ALLVARS displays unequal values in context with the values for other matching variables. If you omit the TRANSPOSE option, then ALLVARS invokes the ALLOBS option and displays the values for all matching observations and variables.

 

Unix Shell Scripting Training | Angularjs Training Training | Informatica Training | Tableau Training | Hadoop Training

Super Contributor
Posts: 345

Re: how to generate a new dataset after proc compare

Posted in reply to kitharington
proc transpose data=toprint out=transp;
by unique _obs_;
id _type_;
run;
proc print data=transp(where=(base^=compare));
run;

i saw the similar one online. actually i only it lists obs with their ids

 

should i modify as

id id?

Ask a Question
Discussion stats
  • 3 replies
  • 238 views
  • 0 likes
  • 3 in conversation