Here is a script that will duplicate the matching you have in your example.
The actual working part of the script is less than 20 lines. For completeness, I have included the JSL that creates your original example data tables at the beginning of the script. That allows you to just cut and paste the script and it should run without error.
Names Default To Here( 1 );
dt = New Table( "Base",
Add Rows( 11 ),
New Column( "Timestamp",
Numeric,
"Continuous",
Format( "m/d/y h:m", 19 ),
Input Format( "m/d/y h:m" ),
Set Values(
[3695629500, 3695636340, 3695672220, 3696019260, 3696076800, 3696099720, 3696483600, 3696494460, 3696743700,
3696753000, 3696764400]
)
),
New Column( "Column A",
Character( 16 ),
"Nominal",
Set Values( {"A1", "A2", "A3", "A4", "A5", "A6", "A7", "A8", "A9", "A10", "A11"} )
),
New Column( "Column B",
Character( 16 ),
"Nominal",
Set Values( {"B1", "B2", "B3", "B4", "B5", "B6", "B7", "B8", "B9", "B10", "B11"} )
)
);
dt2 = New Table( "Match",
Add Rows( 4 ),
New Column( "Timestamp",
Numeric,
"Continuous",
Format( "m/d/y h:m", 19 ),
Input Format( "m/d/y h:m" ),
Set Values( [3695628240, 3696019620, 3696488940, 3696750960] )
),
New Column( "Column C", Character( 16 ), "Nominal", Set Values( {"C1", "C2", "C3", "C4"} ) ),
New Column( "Column D", Character( 16 ), "Nominal", Set Values( {"D1", "D2", "D3", "D4"} ) )
);
// Here is the actual matching code
dt << New Column("TheRow");
dt2 << New Column("TheRow", formula(Row()));
// Find the row in the Match data table that is to be paired with the row
// in the Base data table
For( i = 1, i <= N Rows( dt ), i++,
dt:theRow[i] = Max( dt2 << get rows where( dt2:timestamp <= dt:Timestamp[i] ) )
);
// Update data tables
Data Table( "Base" ) << Update(
With( Data Table( "Match" ) ),
Match Columns( :TheRow = :TheRow )
);
// Delete column: TheRow
Data Table( "Base" ) << Delete Columns( :TheRow );
// Delete column: TheRow
Data Table( "Match" ) << Delete Columns( :TheRow );
Jim