You shouldn't need to use ALLOC and FREE. I'm just settling down in my office at the moment, so it'll be 15 minutes or so until I can test, but try:
address ispexec "LIBDEF SH4TLIB DATASET ID('"tablib"')"
address ispexec "TBOPEN "tb_name" WRITE LIBRARY(SH4TLIB)"
address ispexec "TBCLOSE "tb_name" LIBRARY(SH4TLIB)"
address ispexec "LIBDEF SH4TLIB"
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day