in reply to Re^2: OT: Failing to export from DB2
in thread OT: Failing to export from DB2

That makes it sound like its true that EXPORT is not a SQL statement - it's a CLP command and therefore cannot be used in a stored procedure. Maybe you want to use DB2::Admin, it has an Export method.