Jim, thanks for the answer. Let me expand a little further. Goal is to concatenate a list of data tables and to delete double rows. Any data tables that have contributed to the final concatenated table to be closed. The number of input data tables is variable. The selection of the datatbales to be concatenated is following the rule that the beginning strings are equal and the final name of the concatenated data table is the same string.
Here now the code for concatenation and double row deletion plus saving the final table.
If(N Items(filelist)>0,
for (nu_t = 1, nu_t <= num_tables, nu_t++,
FinalTable = Munger(filelist[1],6,4);
Final_Table = "Data_"||FinalTable||".jmp";
//Show(FinalTable);
for (f2 = 1, f2 < nitems(Tables), f2++,
ConcTable = Tables[f2] << Concatenate(Tables[f2+1], Output Table Name( "Both" ) );
Close( Tables[f2] , No Save );
);
// Delete Doube Rows
ConcTable = Current Data Table();
col_min = Parse( "Col Min( Row(), :Name(\!"" || Concat Items( ConcTable << get column names( string ), "\!"), :Name(\!"" ) || "\!"))" );
duplicates = [];
For Each Row( If( col_min != Row(), duplicates |/= Row() ) );
ConcTable << delete rows( duplicates );
ConcTable << Save(Path_datatable_out||Final_Table);
//For(cc=1,cc <= nitems(Tables),cc++, Close(Tables[cc], No Save));
);
); // If Condition
I am looking forward for your reply.
Christian