I tested with 100 datasets using a DATA step concatenation and SQL OUTER UNION CORR. The resulting datasets were identical. Can you give more detail on what you're doing? Here's my test code:
options dlcreatedir ;
libname lib1 "%qsysfunc(pathname(work))\lib1";
options nodlcreatedir nomprint nomlogic nosymbolgen;
%macro MakeData(lib,num);
proc datasets library=&lib kill nolist nodetails;
run; quit;
%do i=1 %to #
%let n=%unquote(%putn(&i,z3.));
data lib1.Table_&n;
retain Table "Table_&n";
do ID_&n =1 to 5;
output;
end;
run;
%end;
%mend;
%macro ConcatenateDS(lib,num);
data work.tempAll_ds;
set
%do i=1 %to #
%let n=%unquote(%putn(&i,z3.));
lib1.Table_&n
%end;
;
run;
%end;
%mend;
%macro ConcatenateSQL(lib,num);
proc sql;
create table work.tempALL_sql as
%do i=1 %to %eval(&num-1);
%let n=%unquote(%putn(&i,z3.));
select *
from lib1.Table_&n
OUTER UNION CORR
%end;
%let n=%unquote(%putn(&i,z3.));
select *
from lib1.Table_&n
;
quit;
%mend;
%let no=100;
%makedata(lib1,&no)
%ConcatenateDS(lib1,&no)
%ConcatenateSQL(lib1,&no)
proc compare base=work.tempALL_ds
compare=work.tempALL_sql;
run;
And the results:
The SAS System
The COMPARE Procedure
Comparison of WORK.TEMPALL_DS with WORK.TEMPALL_SQL
(Method=EXACT)
Data Set Summary
Dataset Created Modified NVar NObs
WORK.TEMPALL_DS 11MAR22:15:50:50 11MAR22:15:50:50 101 500
WORK.TEMPALL_SQL 11MAR22:15:50:50 11MAR22:15:50:50 101 500
Variables Summary
Number of Variables in Common: 101.
Observation Summary
Observation Base Compare
First Obs 1 1
Last Obs 500 500
Number of Observations in Common: 500.
Total Number of Observations Read from WORK.TEMPALL_DS: 500.
Total Number of Observations Read from WORK.TEMPALL_SQL: 500.
Number of Observations with Some Compared Variables Unequal: 0.
Number of Observations with All Compared Variables Equal: 500.
NOTE: No unequal values were found. All values compared are exactly equal.
... View more