Have you ever had someone accidentally trip over a display station power cord and wish you could just pick up where you left off without any hassle? Or more likely, have you had your UPS keep the system and controlling console running while dozens of users despair over not having their display on a UPS circuit during a two-second outage?
Left to its own devices--so to speak--a message will be issued to QSYSOPR and you'll be left with a device that must be manually brought back up to the point of failure. But system value QDEVRCYACN determines the default device recovery action which is to be taken when an error occurs. And with it comes the ability to recover almost completely.
There are several new alternatives, as of V1R3, but my favorite is *DSCMSG. This causes the job to be disconnected, much like issuing the DSCJOB command. Unlike DSCJOB, however, when you sign back on you will be presented with an error recovery screen. From here you may choose to have the previous job ended or to attempt recovery. If you attempt recovery, the job is resumed and the program is returned with an error status. For RPG programs, this means the indicator in columns 56-57 comes on or the *INFSR routine gains control, if specified. The *STATUS code in INFDS will have the value 01255, which indicates that a session error occurred, and the major return code will be 83. All that is necessary is to redisplay the screen or repeat the EXFMT instruction. Any data the operator had already keyed on the format will be lost, but otherwise the program can continue as if nothing had happened.
If you don't normally include *INFSR or error indicators in your programs, consider the use of *DSCENDRQS instead of *DSCMSG. This also disconnects the job, but upon sign-on will issue an ENDRQS for the current request level. While not as full of a recovery as *DSCMSG, it does keep the rest of the job intact and can still allow operators to resume operations more quickly.
If you only have full error handling in selected mission critical programs or applications, you can use CHGJOB DEVRCYACN(*DSCMSG) in the CL prior to loading the programs and CHGJOB DEVRCYACN(xxx) upon completion. Individual job descriptions may also have a device recovery action other than the default *SYSVAL by using CHGJOBD DEVRCYACN(xxx).