I've had 3 jobs die mysteriously because of a routine I wrote that involves QWCRTVCA. I feel my boss had something to do with it but I need to understand what could have possibly happened. Here is a job log:
5770SS1 V7R1M0 100423 Job Log QQBNA 09/10/14 16:31:52 Page 1
Job name . . . . . . . . . . : DFCUAT_ENG User . . . . . . : DFCUSER Number . . . . . . . . . . . : 938513
Job description . . . . . . : QKQTEST Library . . . . . : DOROOT
MSGID TYPE SEV DATE TIME FROM PGM LIBRARY INST TO PGM LIBRARY INST
CPF1124 Information 00 07/16/14 15:51:43.478996 QWTPIIPP QSYS 04C0 *EXT *N
Message . . . . : Job 938513/DFCUSER/DFCUAT_ENG started on 07/16/14 at
15:51:43 in subsystem QBATCH in QSYS. Job entered system on 07/16/14 at
15:51:43.
CPI1125 Information 00 07/16/14 15:51:43.479146 QWTPCRJA QSYS 0110 *EXT *N
Message . . . . : Job 938513/DFCUSER/DFCUAT_ENG submitted.
Cause . . . . . : Job 938513/DFCUSER/DFCUAT_ENG submitted to job queue
QS36EVOKE in QGPL from job 937396/BEAK/QPADEV0008. Job
938513/DFCUSER/DFCUAT_ENG was started using the Submit Job (SBMJOB) command
with the following job attributes: JOBPTY(5) OUTPTY(5) PRTTXT()
RTGDTA(QCMDB) SYSLIBL(QSYS QSYS2 QHLPSYS QUSRSYS) CURLIB(QGPL)
INLLIBL(TEST_ENGV2 UATPGMSOLD TRAN_ENGV2 DOROOT TFROOT QGPL)
INLASPGRP(*NONE) LOG(4 00 *NOLIST) LOGCLPGM(*NO) LOGOUTPUT(*JOBEND)
OUTQ(/*DEV) PRTDEV(PRT01) INQMSGRPY(*RQD) HOLD(*NO) DATE(*SYSVAL)
SWS(00000000) MSGQ(QUSRSYS/BEAK) CCSID(37) SRTSEQ(*N/*HEX) LANGID(ENU)
CNTRYID(US) JOBMSGQMX(64) JOBMSGQFL(*PRTWRAP) ALWMLTTHD(*YES) SPLFACN(*KEEP)
ACGCDE(*SYS).
*NONE Request 07/16/14 15:51:43.563698 QWTSCSBJ *N QCMD QSYS 0195
From user . . . . . . . . . : BEAK
Message . . . . : -STRTQQENG ENGLIB(TEST_ENGV2) ENGNAME(TRAN_ENGV2)
PORT('00000000000000012349') NUMCHLD('00000000000000000001')
PATH('/home/quikq/1.4/uat')
*NONE Information 07/16/14 15:51:43.785321 *N *N *N QCMD QSYS 01C8
Message . . . . : PATH [/home/quikq/1.4/uat
]
*NONE Information 07/16/14 15:51:43.785390 *N *N *N QCMD QSYS 01C8
Message . . . . : PORT [12349 ]
CPCA08B Completion 00 07/16/14 15:51:43.833889 QP0LCCHC QSYS *STMT *N *N *N
From module . . . . . . . . : QP0LCCHC
From procedure . . . . . . : send_message__FPcT1iT3T1
Statement . . . . . . . . . : 10
Message . . . . : Current directory changed.
Cause . . . . . : The current directory was changed to /home/quikq/1.4/uat.
MCH3402 Escape 40 09/10/14 16:31:51.747910 AiProcess 000820 TRAN_ENGV2 *STMT
To module . . . . . . . . . : GETJBSWTCH
To procedure . . . . . . . : GetCurrentJobSwitches__FRQ2_3std12basic_string
XTcTQ2_3std11char_traitsXTc_TQ2_3std9allocatorXTc__
Statement . . . . . . . . . : 3
Message . . . . : Tried to refer to all or part of an object that no longer
exists.
5770SS1 V7R1M0 100423 Job Log QQBNA 09/10/14 16:31:52 Page 2
Job name . . . . . . . . . . : DFCUAT_ENG User . . . . . . : DFCUSER Number . . . . . . . . . . . : 938513
Job description . . . . . . : QKQTEST Library . . . . . : DOROOT
MSGID TYPE SEV DATE TIME FROM PGM LIBRARY INST TO PGM LIBRARY INST
Cause . . . . . : The most common cause is that a stored address to an
object is no longer correct because that object was deleted or part of the
object was deleted.
MCH3402 Escape 40 09/10/14 16:31:51.812883 VOXEXRUN 004118 QMHSNDPM QSYS 0712
Message . . . . : Tried to refer to all or part of an object that no longer
exists.
Cause . . . . . : The most common cause is that a stored address to an
object is no longer correct because that object was deleted or part of the
object was deleted.
CPC1219 Completion 50 09/10/14 16:31:51.984977 QWTPITP2 QSYS 0636 *EXT *N
Message . . . . : This job ended abnormally.
Cause . . . . . : An error occurred that caused this job to end abnormally.
Recovery . . . : See the previously listed messages in the job log for
this job. Correct the errors and try the request again.
CPF1164 Completion 00 09/10/14 16:31:52.198834 QWTMCEOJ QSYS 014A *EXT *N
Message . . . . : Job 938513/DFCUSER/DFCUAT_ENG ended on 09/10/14 at
16:31:52; .102 seconds used; end code 30 .
Cause . . . . . : Job 938513/DFCUSER/DFCUAT_ENG completed on 09/10/14 at
16:31:52 after it used .102 seconds processing unit time. The job had
ending code 30. The job ended after 1 routing steps with a secondary ending
code of 0. The job ending codes and their meanings are as follows: 0 - The
job completed normally. 10 - The job completed normally during controlled
ending or controlled subsystem ending. 20 - The job exceeded end severity
(ENDSEV job attribute). 30 - The job ended abnormally. 40 - The job ended
before becoming active. 50 - The job ended while the job was active. 60 -
The subsystem ended abnormally while the job was active. 70 - The system
ended abnormally while the job was active. 80 - The job ended (ENDJOBABN
command). 90 - The job was forced to end after the time limit ended
(ENDJOBABN command). Recovery . . . : For more information, see the Work
management topic collection in the Systems management category in the IBM i
Information Center,
http://www.ibm.com/systems/i/infocenter/.
Here is my routine. All I'm using this for is to get the current job switches:
#include <iostream>
#include <string>
#include <sstream>
#include <stdexcept>
#include <qusec.h>
#include <qwcrtvca.h>
using namespace std;
typedef struct {
Qus_EC_t ec_fields;
char Exception_Data[200];
} error_code_t;
typedef _Packed struct {
int Number_Fields_Rtnd;
int Length_Field_Info_Rtnd;
int Key_Field;
char Type_Of_Data;
char Reserved[3];
int Length_Data;
char switches[8];
} RTVC0100_t;
void GetCurrentJobSwitches(string& sw)
{
RTVC0100_t jobSwitches;
int attribKeys[1];
error_code_t error_code;
attribKeys[0] = 1006;
error_code.ec_fields.Bytes_Provided = sizeof(error_code_t);
QWCRTVCA(&jobSwitches, sizeof(jobSwitches), "RTVC0100", 1, &attribKeys[0], &error_code);
if (error_code.ec_fields.Bytes_Available) {
stringstream msg;
msg << "GetCurrentJobSwitches() QWCRTVCA() error " << string(error_code.ec_fields.Exception_Id, 7);
if (strlen(error_code.Exception_Data)) {
msg << " " << error_code.Exception_Data;
}
throw runtime_error(msg.str());
}
string switches(jobSwitches.switches, 8);
sw = switches;
}
Apparently what is happening is the "throw" is working. My mistake for forgetting that I even put the code in there and then didn't put the try-catch code in. MCH3402 is the error that is occurring. What "object" could it be referring to?