DaveK
DaveK

Reputation: 1

PROC SORT not sorting properly

I have large datasets that I am trying to merge. I run PROC SORT on my identifiers and it appears to execute successfully. Then I try to merge and it says the datasets aren't sorted properly. What might be the issue?

Log:

MPRINT(PHYSICIANASSIGNMENT): proc sort data=cartemp FORCE SORTSIZE=MAX;
MPRINT(PHYSICIANASSIGNMENT): by phys_id;
MPRINT(PHYSICIANASSIGNMENT): run;

NOTE: There were 344832552 observations read from the data set WORK.CARTEMP.
NOTE: SAS threaded sort was used.
NOTE: The data set WORK.CARTEMP has 344832552 observations and 33 variables.
NOTE: PROCEDURE SORT used (Total process time):
real time 47:50.99
cpu time 5:36.19

MPRINT(PHYSICIANASSIGNMENT): data cartemp;
MPRINT(PHYSICIANASSIGNMENT): merge cartemp (in=clm) carrier_docs (in=specs keep=phys_id spec_overall);
MPRINT(PHYSICIANASSIGNMENT): by phys_id;
MPRINT(PHYSICIANASSIGNMENT): if clm;
MPRINT(PHYSICIANASSIGNMENT): drop phys_id preferred_id;
MPRINT(PHYSICIANASSIGNMENT): run;

ERROR: BY variables are not properly sorted on data set WORK.CARTEMP.
clm=1 specs=1 preferred_id=112893791 bene_id=quwdhauiASHHHa phys_id=D23879_129389812938 spec_overall=0 FIRST.phys_id=0 LAST.phys_id=0 ERROR=1 N=45258476
NOTE: The SAS System stopped processing this step because of errors.

Whether I use the "FORCE" option in PROC SORT doesn't change anything.

Apologies if this is obvious; I'm fairly new to SAS.

Upvotes: 0

Views: 132

Answers (0)

Related Questions