Open worksofliam opened 1 month ago
Bad news about qcmdexc
. It works fine if the command executes successfully:
call liama.sql_system('CRTBNDRPG PGM(*CURLIB/OCEAN) SRCFILE(LIAMA/QRPGLESRC) OPTION(*EVENTF) DBGVIEW(*SOURCE) TGTRLS(*CURRENT)', 'SAMPLE');
But, if the command you execute has a return code of more than 0, no spool is written and therefore we can't capture it with SQL like we can with the system
command:
call qsys2.qcmdexc('CRTBNDRPG PGM(*CURLIB/OCAN) SRCFILE(LIAMA/QRPGLESRC) OPTION(*EVENTF) DBGVIEW(*SOURCE) TGTRLS(*CURRENT)');
select char(job_number) || '/' || job_user || '/' || job_name, spooled_file_name, spooled_file_number
from table(qsys2.spooled_file_info()) x order by creation_timestamp desc limit 20;
Maybe we still leave the compiles and library list stuff to QSH?
system
SQL replacement (https://gist.github.com/worksofliam/b51ec5cd76e76cd9d23a3ddc2ff2ff32)qsys2.qcmdexc
doesn't write a spool file if the command returns exit code > 0 (so we can't see the spool file from a bad compile)system
around for compiles and just use SQL for data (which makes sense)liblist
internally~system
with new replacement~for bit data