Hello,

I am looking for some advice here.

I need to run the EXPORT COMMAND via a TASK SCHEDULE

I want the export command to output a message file to a certain folder in a linux directory

The export command will work if I use MESSAGE ON SERVER
It will not work if I choose a location of the messageout.txt file

Code:
CREATE PROCEDURE EXPORT_DATA2()
SPECIFIC EXPORT_DATA2
MODIFIES SQL DATA
NOT DETERMINISTIC
LANGUAGE SQL
GRANT  CREATEIN,DROPIN,ALTERIN ON SCHEMA NJTA_TEM TO USER DB2INST2 WITH GRANT OPTION;
--CALL SYSPROC.ADMIN_REMOVE_MSGS('1953327565_DB2INST2');
CALL SYSPROC.ADMIN_CMD('EXPORT TO /tmp/table1.ixf of ixf MESSAGES ON SERVER SELECT * FROM schema1.table1'); --this works
CALL SYSPROC.ADMIN_CMD('EXPORT TO /tmp/table1.ixf of ixf MESSAGES /tmp/messageout.txt SELECT * FROM schema1.table1'); --this does not
I want to use an output.txt file so that the user knows the same file they need to access if any issues arise. I believe this is better an using the
Code:
MESSAGES ON SERVER
command.

Also I dont want to use the MESSAGE ON SERVER as the message numbers are dynamic so I cannot do a delete select * from to keep the system clean.

Can anyone offer any advice ?