Hello, thanks for the quick reply! It worked but the log file showed me: 1239 data _null_; 1240 if _n_=1 then do; 1241 declare hash ht(ordered:"a"); 1242 ht.definekey('USUBJID','PARCAT1N','PARCAT2N','PARAMCD','AVALC'); 1243 ht.definedata('USUBJID','PARCAT1N','PARCAT2N','PARAMCD','AVALC'); 1244 ht.defineDone(); 1245 end; 1246 set source; 1247 ht.add(); 1248 ht.output(dataset:'source_sorted'); 1249 run; NOTE: The data set WORK.SOURCE_SORTED has 1 observations and 5 variables. NOTE: The data set WORK.SOURCE_SORTED has 2 observations and 5 variables. NOTE: The data set WORK.SOURCE_SORTED has 3 observations and 5 variables. NOTE: The data set WORK.SOURCE_SORTED has 4 observations and 5 variables. NOTE: The data set WORK.SOURCE_SORTED has 5 observations and 5 variables. NOTE: The data set WORK.SOURCE_SORTED has 6 observations and 5 variables. NOTE: The data set WORK.SOURCE_SORTED has 7 observations and 5 variables. NOTE: The data set WORK.SOURCE_SORTED has 8 observations and 5 variables. NOTE: The data set WORK.SOURCE_SORTED has 9 observations and 5 variables. NOTE: The data set WORK.SOURCE_SORTED has 10 observations and 5 variables. NOTE: The data set WORK.SOURCE_SORTED has 11 observations and 5 variables. NOTE: The data set WORK.SOURCE_SORTED has 12 observations and 5 variables. NOTE: There were 12 observations read from the data set WORK.SOURCE. NOTE: DATA statement used (Total process time): real time 0.13 seconds cpu time 0.07 seconds If I would use this on my main dataset this would iterate through every line and take prrobably longer than an actual proc sort.
... View more