S0F8: SVC issued in an incorrect mode
An S0F8 abend means a program issued a supervisor call (SVC) while it was in a mode where SVCs aren't allowed, such as SRB mode, holding a lock, running disabled or in cross-memory mode. The reason code says which rule was broken.
Other names for this code
Also written as 0F8, SOF8, abend 0F8, ABEND0F8, system abend 0F8, S0F8-14, SVC issued in wrong mode.
What it means
Many z/OS services are reached through the SVC instruction. Macros such as WTO, ENQ, OPEN and the older forms of GETMAIN expand into an SVC. SVC processing is built around a task. Most SVC routines run under a request block chained to the caller's task control block (TCB), and they may wait, take locks or be interrupted.
So the system checks the caller first. The program must be running under a task, not as an SRB. It must be enabled for interrupts, hold no locks, and not be in cross-memory mode. If any of these is wrong, the SVC handler ends the caller with system completion code 0F8, and the reason code identifies the condition. For example, IBM documents reason 14 as an SVC issued while the caller had an EUT-mode functional recovery routine in effect, one set up with SETFRR EUT=YES.
Ordinary problem-state programs always run as tasks, enabled and holding no locks, so they can't break these rules on their own. S0F8 comes from authorized code. Typical sources are system exits, SRB routines, PC routines, vendor products, and run-time code that was called in SRB mode. IBM has, for example, fixed Language Environment code that issued an SVC when called in SRB mode.
Common causes
- An SRB routine used a macro that expands into an SVC, such as WTO or the SVC form of GETMAIN.
- Code issued an SVC while holding a lock or while running disabled.
- A cross-memory routine, such as a PC routine running with a different primary address space, issued an SVC-based service.
- Code issued an SVC while an EUT functional recovery routine was in effect (reason 14).
- Code written for task mode, including run-time library code, was called from an SRB.
How to find the problem
- Find the reason code in the IEA995I symptom dump or the dump title, and look it up under 0F8 in z/OS MVS System Codes for your release.
- The PSW points just past the SVC instruction. The two bytes before it are X'0A' followed by the SVC number, which tells you which service was requested.
- In IPCS, use the system trace to find the SVC entry just before the abend, and check the status of the failing unit of work (TCB or SRB, locks held, address space mode).
- Check the module name and offset. If the module belongs to IBM or a vendor, search for ABEND0F8 with the reason code and module name.
How to fix it
- Replace SVC-based macros with services that are allowed in the mode you are in. For example, the STORAGE macro can obtain and release storage in SRB and cross-memory mode, where the SVC forms of GETMAIN can't.
- Release locks and enable before issuing an SVC, or move the work to a task, for example by posting a task that does it.
- Leave cross-memory mode before calling SVC-based services, so that the home address space is both the primary and the secondary address space again.
- Cancel an EUT FRR before issuing SVCs, or don't use EUT=YES in code that needs them.
- For IBM or vendor code, apply the supplier's fix.
IBM documentation
IBM z/OS: 0F8. Use the documentation for your installed release.
Related codes
Questions
Can a normal batch program get S0F8?
Not through its own code. Problem-state programs run as tasks, enabled and holding no locks, so their SVCs are allowed. An S0F8 in a batch job comes from authorized code, such as an exit or vendor product running on its behalf.
Why can't an SRB issue an SVC?
SVC routines run under a request block that belongs to a task. An SRB has no task of its own, so the system refuses the SVC and ends the caller.
What does S0F8 reason 14 mean?
The caller issued an SVC while it had an EUT-mode functional recovery routine in effect, set with SETFRR EUT=YES. The caller has to change how it sets up recovery or where it issues the SVC.