Rsbas400:Well, because error messages in batch jobs go to the system operator'smessage queue, or more accurately, the QSYSOPR message queue. Respondingto such messages is a major responsibility of a system operator. That'sone of the reasons the message queue exists.Batch jobs can be scheduled for any time of the day or night, regardlessof whether the submitting user is even still alive.

  1. Qsysopr Break Handling Programmer Jobs
  2. Qsysopr Break Handling Programmers
  3. Qsysopr Break Handling Programmer Job

Since batch messagesgo to a predictable place, programmers have the ability to handle themin a predictable way even if the system operator position doesn't exist.If batch jobs sent error messages back to users, the potential for chaosand disaster would get huge.Please note that at many (most?) AS/400 sites, users can respond tomessages on the QSYSOPR message queue; SysRq option 6 is usually all ittakes. Whether this is a good idea or not clearly depends on the needsof an individual site.Tom LiottaIn article,-Tom LiottaAS/400 systems programmerSent via Deja.comBefore you buy.rsba.@my-deja.com14.04.00 0:00. Jeroen wrote: In article, wrote: I don't want error messages going back to the users. I want error messages to go to a different user id other than QSYSOPR. You can sign on using any user id (that is, with the correct authority) and do CHGMSGQ QSYSOPR.BREAK. And get any msg delivered to the terminal.The way I interpret the request is:It's fine that most operational messages - eg 'printer out of paper','comm.

Qsysopr Break Handling Programmer Jobs

Line varied off', etc - go to QSYSOPR. But when an application(eg RPG) program get an unexpected exception, for which an inquirymessage reply is required, it would be nice if these messages were sent(routed) to another message queue, ideally configurable (eg systemvalue).Is this the essence of it?-Karl HansonSmolders Chris19.04.00 0:00. Dear,I once made this solution:I had a break handling program (in CL) on the QSYSOPR message queue. Everymessage that came in the QSYSOPR message queue went through this program.So I code for the most 'normal' errors a solution (vary off and on.) Themessages that needed some attention, where sent to the user (or programmer)I wanted.

I also wrote the message to a file of my own. Than the user (orprogrammer) had to use another program to read this file and see themessages that were in it. Using the SNDRPY-message he could send a reply tothis message that still was in the QSYSOPR message queue. This tric wasnecessary because using this break handling program, I could't answer nomore messages directy in the QSYSOPR message queue.In m'n start up program I submitted a job that ran a CL containing 2 lines:CHGMSGQ QSYSOPR.BREAK MYPROGRAM SEV(10)DLYJOB (until the system went down).So every message was threated by MYPROGRAM. If it could solve the problem,it did it. If it couldn't, it sent a message to the user I wanted.Is this a solution?Chris Smolderswrote in message.

Sent via Deja.com Before you buy. - Tom Liotta AS/400 systems programmer Sent via Deja.com Before you buy.I don't want error messages going back to the users. I want errormessages to go to a different user id other than QSYSOPR.Sent via Deja.comBefore you buy.Dan Riehl20.04.00 0:00. Thomas wrote: Dan: As soon as the job ends, its control of the message queue ends and the queue drops from.BREAK to.HOLD. No point in a break-handling program when the status isn't.BREAK. Or is there?

Tom Liotta In article, driehlat400schooldotcom wrote: In m'n start up program I submitted a job that ran a CL containing 2 lines: CHGMSGQ QSYSOPR.BREAK MYPROGRAM SEV(10) DLYJOB (until the system went down). I agree that a break handling pgm on QSYSOPR.msgq is the way to handle routing messages to different queues. But I'm Curious.

Why the DLYJOB.? What you'll get with this is a job in DLYW state that does nothing at all. Once the CHGMSGQ command is executed. You're done. dan - Tom Liotta AS/400 systems programmerThe CHGMSGQ.BREAK MYPROGRAM essentially makes MYPROGRAM an eventhandler.

But a batch job will end by default when all other work isdone, hence the DLYJOB. That is, you.want. the job to do nothing atall (but not end), until any message is deposited in QSYSOPR. ThenMYPROGRAM will handle it if necessary, after which the job goes back todoing nothing.

Actually after the CHGMSGQ, a slight improvement mightbe a loop that delays for only a few seconds, then does RTVJOBA ENDSTSto check if the job/subsystem/system is ending, and exit the loop ifappropriate.-Karl Hanson.

Qsysopr

CHKSYSCND - Check System Condition.CHKSYSCND CHECK SYSTEM CONDITION TAAMSGMThe Check System Condition command checks for critical systemmessages and sends break messages to a list of users.The system sends critical system messages such as 'mirroring has beensuspended' or 'a disk storage capacity threshold has been reached' toQSYSOPR (See the later discussion for more details). Because manymessages may exist in QSYSOPR, critical messages may be overlooked.If QSYSOPR is not in break mode, no one may be aware of a criticalsystem condition.

Critical system messages are also sent to theQSYSMSG message queue if it exists.CHKSYSCND submits a never ending batch job which continually monitorsQSYSMSG.The major advantages of CHKSYSCND are:. It selects the critical message IDs rather than every messagethat arrives in QSYSOPR. It uses the TAA tool to send messages to a named list ofusers so that a critical condition is more likely to benoticed.To use CHKSYSCND, you must first create the QSYSMSG message queue inQSYS if it does not already exist. No other program can be readingthis message queue and it cannot be in break mode to a workstation.Any message ID sent to QSYSMSG will be removed from the messagequeue. If you want to process some of the message IDs not handled byCHKSYSCND, see the later instructions for modifying the programs.The QSYSMSG message queue is described in detail in the CLProgrammer's Guide. To create the queue specify:CRTMSGQ MSGQ(QSYS/QSYSMSG)TEXT('Message queue for critical system messages')A typical approach to start CHKSYSCND would be to use the command inthe auto start job for the controlling subsystem.

See the laterdiscussion for how to do this. You must have.JOBCTL specialauthority to use CHKSYSCND. A typical command would be:CHKSYSCND USERS(QSYSOPR QSECOFR JONES.FIRSTUSER)This would cause the CHKSYSCND job to be submitted which wouldcontinually monitor QSYSMSG.The value.FIRSTUSER is a special value intended for the case whennone of the users specified are active. If this occurs, the activeusers are checked and the user with the highest user class (e.g.SYSOPR,.PGMR etc.) is sent a generic message and requested toinform the system administrator of the critical condition.The value.ALLACTIVE may be specified (instead of.FIRSTUSER) to senda similar message to all active users.Because the CHKSYSCND function is assumed to be a critical job, anyfailures found within the job will cause a 'critical systemcondition' message to be sent. The CHKSYSCND command can be endedexternally (ENDJOB) without causing this message.Excess interruptions-The intent of CHKSYSCND is to bring to the attention of the systemadministrator the fact that a critical system condition exists.

Oncethis is known and a plan has been made for correction, it is probablydesirable to re-adjust CHKSYSCND to avoid the list of users beingannoyed on an hourly basis until the problem is fixed.For example, if you are running out of addresses, the normal recoveryaction would be to cause an IPL during the evening. Or if mirroringhas been suspended, the Service representative may be scheduled in torepair the problem later in the day. In the meantime, CHKSYSCND willcontinue to send the 'critical system condition' message hourly untilthe problem is fixed.You can avoid this by ending the CHKSYSCND job. You could submitCHKSYSCND with a smaller list of users to be notified until the knownproblem is fixed and then revert back to the original list.Because you may want to use CHKSYSCND independently of the auto startjob, it may be desirable to place the normal CHKSYSCND command in aCL program and call it from the auto start job or when needed.Command parameters.CMD-USERS This value is passed thru to the TAA tool. Itis a list of up to 10 user names that will be sent amessage if a critical condition occurs.

If the useris active, the message is sent as a break message tothe workstation message queue where the user issigned on. If the user is not active, a message issent to his user message queue.For additional details and a discussion of the.FIRSTUSER and.ALLACTIVE special values, see theTAA tool.JOBQ The qualified name of the job queue to submit thebatch job to. The default is QINTER in QGPL.

Theintent of QINTER is to allow the job to act like aninteractive job and not use one of the normal batchjob activity levels.JOBD The qualified name of the job description to use forthe batch job. The default is QBATCH in QGPL. Thisallows control of other job attributes for theCHKSYSCND job.System handling of critical conditions-You should review the discussion of QSYSMSG in the CL ProgrammersGuide if you are interested in the details of the messages which aresent. The following describes the highlights of the messages whichare sent to QSYSMSG in QSYS if it exists. For the detail messageIDs, see member TAAMSGMC2 in TAATOOL/QATTCL. Address threshold.

The system will send a message every hourif the addresses used percentage (either permanent ortemporary) exceeds 90%. Storage capacity threshold. A message will be sent if thestorage used percentage exceeds the threshold value. Thethreshold value is specified in SST for each ASP.

The defaultis 90%. Disk errors. Some disk units perform a threshold checking ofrecoverable error conditions. This allows the system to beinformed when the disk unit is operating, but excessiverecoverable errors are occurring. When an internal thresholdis reached, a critical system message is sent requesting thatService be informed. In most cases, the system will re-signalthe message on an hourly basis (up to 10 times).

Mirroring suspended. If a mirroring unit fails, the systemwill send a single message when mirroring is suspended.

Asimilar message will also be sent every hour. Parity protection suspended. If parity protection exists anda parity unit fails, the system will send a single messagewhen parity protection is suspended. A similar message willalso be sent every hour. Battery weak or failed. Some battery protection devices canbe tested to determine if they are weak or have failed. Thesystem sends a message if it senses either condition.

Hardware failures. Certain hardware internal units (such asthe bus) are tested regularly and the system sends a messageif errors are found. Significant security violations.

Certain critical securityerrors are also sent to QSYSMSG. For example, a message issent if a user attempts to invalidly signon to a workstationmore than the allowed value for the QMAXSIGN system value.Security messages are ignored by CHKSYSCND. You may modifythe program to process these separately.All of the system critical messages are sent to QSYSOPR. It is up tothe user to place QSYSOPR in break mode and be sensitive to whichmessages are critical and which are not.

All the critical systemmessages are alertable and will also appear in QHST.Alerts coming into the system (from a remote system) are sent toQSYSOPR. The System Management Utility supports an option to allowyou to send the Alerts to a specific queue. You can process thequeue in the same manner as QSYSMSG.Using CHKSYSCND in an auto start job-CHKSYSCND can be easily placed into an auto start job for thecontrolling subsystem. This is normally the best place to ensure thejob will be active whenever the system is up and is not in therestricted state.The source for the system supplied auto start job can be retrieved byuse of the RTVCLSRC command and naming a source file/member where youwant the source placed.RTVCLSRC PGM(QSTRUP) SRCFILE(yyyyyyy) MBR(zzzz)It would be normal to place the CHKSYSCND command as one of the lastfunctions performed (e.g.

Just prior to the RETURN statement in thestartup program). Create your own version of the startup program.Change the system value QSTRUPPGM to specify the name of thelibrary/program you created. You should consider a separate CLprogram containing the CHKSYSCND command as described in the previoussection on 'Excess interruptions'.Message text sent-There are two forms of messages sent:.

List of users on the command. The list of users specified onthe command will receive the actual first level of messagetext that has causes the system critical condition and themessage ID. The message is 'wrapped' with standard textbefore and after the actual text. Because a 'break message'is sent, there is no second level text available with themessage.For example, the message text supplied in the programproduces:. A critical system condition hasoccurred. The message ID is xxxxxxx.The text is- yyyyyyyyyyyyyyyyyyyyyyyyyyyContact the system administrator immediately.

If none of the specified users are active and.FIRSTUSER wasspecified, the text sent to some user is:. A critical system conditionhas been found by CHKSYSCND.No other active user has beeninformed. Contact the systemadministrator immediately. If.ALLACTIVE is specified, specific users may also be named.Any specifically named users always receive the text describedpreviously. If the user is active, but is not in the namedlist, the following text is sent:. A critical system conditionhas been found by CHKSYSCND.Contact the system administratorimmediately.You may modify this text for your own requirements.Testing CHKSYSCND-There are two functions you can consider testing:.

command. You can test your list of users by directlyexecuting the command.

CHKSYSCND command. You can simulate the system sending acritical message by sending the same message ID directly toQSYSMSG. The following TSTCHKSYS program can be used (thesource from this text can be directly copied into a CL sourcemember)./.

TSTCHKSYS - Test the CHKSYSCND command./PGM PARM(&MSGID)DCL &MSGID.CHAR LEN(7)SNDPGMMSG MSGID(&MSGID) MSGF(QCPFMSG) +TOMSGQ(QSYS/QSYSMSG)ENDPGMTo test the address threshold condition, you would specifymessage CPI0997 message as:CALL TSTCHKSYS PARM(CPI0997)Modifying the programs-You may want to modify the program that is controlling the reading ofQSYSMSG and the message text used for the command. The programto review is TAAMSGMC2 in TAATOOL.

If you are going to modify thisprogram, you should make a copy of the entire CHKSYSCND tool (SeeCPYTAA2). Make the changes and then create the tool usingand specify your source library.The following are typical changes you may want to make:.

Qsysopr Break Handling Programmers

Not all of the messages arriving at QSYSMSG are considered'critical'. For example, security messages are ignored aswell as the fact that mirroring has been resumed. You maywant to have some unique handling of these messages. Youshould review the QSYSMSG discussion in the CL Programmer'sGuide. Any message received is removed from QSYSMSG (themessages also exist in QSYSOPR). If you want to save any ofthe messages, you would need to modify the program (e.g.resend them to a different queue).

The same message ID received from QSYSMSG is sent via thecommand for the critical conditions. The first levelmessage text is wrapped with the standard text as describedpreviously. You may want to alter either the standard textthat is wrapped around the message or the text for specificconditions. Because a break message will be sent, only thefirst level of the text (no message ID or 2nd level) can besent. The command provides for the case of a generic messageto be sent to.FIRSTUSER or.ALLACTIVE. The text does notidentify the specific problem, but requests the user contactthe system administrator.

Qsysopr Break Handling Programmer Job

TAAMSGMC2 provides a text message(described earlier) that is designed to be sent to a typicalend user. You may want to modify this text.Restrictions-The QSYSMSG message queue must exist and it cannot be allocated toany other program (e.g. Be in break mode to a user).You must have.JOBCTL special authority to use CHKSYSCND.Prerequisites-The following TAA Tools must be on your system:Extract listShout messageSend completion messageSend escape messageImplementation-The tool is ready to use, but you must ensure that the QSYSMSGmessage queue exists in QSYS. If it has not been created, see theearlier discussion.Objects used by the tool-Object Type Attribute Src member Src file-CHKSYSCND.CMD TAAMSGM QATTCMDTAAMSGMC.PGM CLP TAAMSGMC QATTCLTAAMSGMC2.PGM CLP TAAMSGMC2 QATTCLStructure-CHKSYSCND commandTAAMSGMC submits batch pgm TAAMSGMC2TAAMSGMC2 CL pgmTAA toolAdded to TAA Productivity tools April 1, 1995© Copyright TAA Tools, Inc.