DATA Step, Macro, Functions and more

Messages in the log.

Reply
N/A
Posts: 0

Messages in the log.

Two tables:

A with variables ID, X, Y.
B with variables ID, Z

Merging:

data C;
merge A B;
by ID;
run;

If anyone of A and B is not sorted by ID, shouldn't there be a message in the log about it?
Super Contributor
Posts: 359

Re: Messages in the log.

Posted in reply to deleted_user
Only if they are not in the correct order. The message is generated when data lines are encountered in the wrong order, not due to a sort indicator.
N/A
Posts: 0

Re: Messages in the log.

Thanks for your answer.

In my example above table A was sorted by ID with PROC SORT, but table B was not.

So, since there was no message concerning table B, I can draw the conclusion, for sure, that the records in B was in correct order?

You NEVER have to worry when there is a BY in the merging, that you get something that you don't want?
Super Contributor
Super Contributor
Posts: 3,174

Re: Messages in the log.

Posted in reply to deleted_user
As long as you do not code the BY statement parameter NOSORTED. Useful reading below, for your consideration.

Scott Barry
SBBWorks, Inc.

SAS Language Reference: Concepts, Processing BY-Groups in the DATA Step
http://support.sas.com/documentation/cdl/en/lrcon/61722/HTML/default/a000761932.htm
Respected Advisor
Posts: 3,799

Re: Messages in the log.

MERGE does not support BY statement with NOTSORTED option.
Ask a Question
Discussion stats
  • 4 replies
  • 142 views
  • 0 likes
  • 4 in conversation