Good afternoon all,
I am attempting to capture the final lines of a joblog, using embedded SQL, that would be tied to an inquiry message that is sent to QSYSOPR. IBM has the ability to pushing multiple rows of output into an array, however, I'm not having too much success with it. https://www.ibm.com/docs/en/i/7.1?to...tructure-array
I've opened a ticket with IBM, and though the program compiles, it doesn't return anything as expected.
I don't get an error, but the printf statement at the end comes up blank.
I am attempting to capture the final lines of a joblog, using embedded SQL, that would be tied to an inquiry message that is sent to QSYSOPR. IBM has the ability to pushing multiple rows of output into an array, however, I'm not having too much success with it. https://www.ibm.com/docs/en/i/7.1?to...tructure-array
I've opened a ticket with IBM, and though the program compiles, it doesn't return anything as expected.
Code:
int main(){ char subject[20] = "MESSAGE_WAITING"; char data1[1024] = ""; char data2[4096] = ""; char data3[50] = ""; char data4[1024] = ""; char message[1024] = ""; char cause[4096] = ""; EXEC SQL BEGIN DECLARE SECTION; char job[27] = "476214/RSPEIGHT/T02C003001"; typedef _Packed struct { short VARClen; char VARCdat[1024]; } VARC; VARC msg_txt; EXEC SQL END DECLARE SECTION; EXEC SQL DECLARE jobcr CURSOR FOR SELECT CAST(MESSAGE_TEXT AS VARCHAR(1024)) FROM TABLE(QSYS2.JOBLOG_INFO(:job)) ORDER BY MESSAGE_TIMESTAMP DESC; EXEC SQL OPEN jobcr; EXEC SQL WHENEVER NOT FOUND GOTO end_fetch; EXEC SQL FETCH jobcr INTO :msg_txt; end_fetch: EXEC SQL CLOSE jobcr; printf("\n\njoblog: %s\n\n", msg_txt); };
Comment