I think this also works similarly in basic:
0001 data “copy customers (o”
0002 data “(big.bal.customers”
0003 execute “select customers with whatever” returning err codes
and you can examine err codes to see if the copy happened or not, and how many were copied.
If the select doesn’t return anything, the stacked data doesn’t get executed.
But I can’t remember offhand if the stacked data gets cleared. It works one way on prime-based universe and unidata, and the opposite on pick and reality based systems. On one the data stack is always cleared by an execute, and on the other the unused data stack remains in effect, so needs to be cleared manually with CLEARDATA.
The amount of information from the RETURNING varies too. IIRC, d3 returns all the errmsg codes and arguments, while some other platforms just return the codes, and some just a single status code.