How to journal tables in SQL? Say I have a C# script that creates 50 tables in MYLIB.

Currently, after running the script, I have to go into System i Navigator and manually attach the MYLIB/USRJRN to each of the tables' journaling.

How can I make my script do this instead?
You may start DB2 table journaling with the QSYS2.QCMDEXC procedure and a corresponding text of the STRJRNPF CL command as an argument. Something like this:

CALL QSYS2.QCMDEXC('STRJRNPF FILE(MYFILELIB/MYFILENAME) JRN(MYLIB/USRJRN) IMAGES(*BOTH) OMTJRNE(*OPNCLO)');