* A system watch monitor job, started with * * STRWCH SSNID(TEST8TS) * WCHPGM(TEST8TS) * WCHMSG( * (CPI9200 *NONE *MSGDTA *ALL) * ) * WCHMSGQ((*JOBLOG)) * WCHJOB((*ALL/*ALL/*ALL)) * * will call this program, passing it the message information. * * Definition of the event data passed from the watch monitor to this program is found at * https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_72/apis/xwchevnt.htm /copy qsysinc/qrpglesrc,qusec d TEST8TS pi *ENTRY d peOption 10a d peSessionId 10a d peError 10a d peEventData 2048a d CvtDatTim pr extpgm('QWCCVTDT') d InpFmt 10a const d InpValue 20a const options(*varsize) d OutFmt 10a const d OutValue 20a options(*varsize) d ErrCde likeds(QUSEC) d InpTZ 10a const options(*nopass) d OutTZ 10a const options(*nopass) d TZInfo 1a const options(*nopass) d LenTZInfo 10i 0 const options(*nopass) d PrecInd 1a const options(*nopass) d InpTimInd 1a const options(*nopass) d EventDataDS ds 2048 qualified d Length 10u 0 d MsgId 7a d Reserved1 1a d Msgq 10a d MsgqLib 10a d SrcJob 10a d SrcJobUsr 10a d SrcJobNbr 6a d OriginalReplaceentDataLength... d 10u 0 d SendingPgm 256a d SendingPgm10 10a overlay(SendingPgm:1) d SendingMod 10a d OffsetToSendingProcedureName... d 10u 0 d LengthOfSendingProcedureName... d 10u 0 d ReceivingPgm 10a d ReceivingMod 10a d OffsetToReceivingProcedureName... d 10u 0 d LengthOfReceivingProcedureName... d 10u 0 d MsgSeverity 10u 0 d MsgType 10a d MsgTimeStamp 8a d MsgKey 4a d OffsetToReplacementData... d 10u 0 overlay(EventDataDS:441) d LengthOfReplacementData... d 10u 0 overlay(EventDataDS:445) d DOSds ds qualified d hours 3u 0 0-23 d minutes 3u 0 0-59 d seconds 3u 0 0-59 d hSeconds 3u 0 0-99 d day 3u 0 1-31 d month 3u 0 1-12 d year 5u 0 0000-9999 eg 1952 d TimZonOffset 5i 0 in minutes d dayOfWeek 3u 0 0-6 (0=Sunday) d TSds ds qualified d year 4s 0 0000-9999 eg 1952 d 1a inz('-') d month 2s 0 1-12 d 1a inz('-') d day 2s 0 1-31 d 1a inz('-') d hours 2s 0 0-23 d 1a inz('.') d minutes 2s 0 0-59 d 1a inz('.') d seconds 2s 0 0-59 d 1a inz('.') d hSeconds 2s 0 0-99 d 4a inz('0000') d gMsg52 s 52a d gTimeStamp s z *inLR = *on; peError = *blanks; // assume no errors EventDataDS = peEventData; CvtDatTim('*DTS' : EventDataDS.MsgTimestamp : '*DOS' :DOSds : QUSEC); eval-corr TSds = DOSds; gTimeStamp = %timestamp(TSds); dsply (gTimeStamp) 'myuserid';