fhg
Volume 8, Number 31 -- September 10, 2008

Admin Alert: Getting into a i5/OS Restricted State

Published: September 10, 2008

by Joe Hertvik

There's a special place for restricted state processing in the i5/OS or OS/400 world. In restricted state, administrators can apply upgrades, change core system parameters, backup the operating system and run special commands that affect partition configurations. This week, I'll examine everything about restricted state processing, from why it exists, to how to enter and leave this core operating system function.

The Beauty of Restriction

Some i5/OS functions can't be run while the system is active. That's why IBM created restricted state processing, a feature that isn't available in many other operating systems. Restricted state occurs when you end all the subsystems that perform user-submitted work (some Q subsystems that run the partition itself will remain active). The system console is the only device that remains active in restricted state. No other users and devices can connect to the system and no batch jobs can run. Restricted state provides an almost quiet system that allows you to perform work that cannot be done when the system is processing user-based work.

Restricted state functions include backing up the operating system through the Save System (SAVSYS) command and correcting damaged objects and user profiles through the Reclaim Storage (RCLSTG) command. You must also be in restricted state to upgrade your operating system and make certain system changes.

Entering Restricted State

The hardest thing about entering restricted state is stopping the work on your system. Most shops are running 24x7, and it can be a negotiation process getting users to give up the machine. Once everyone has signed off and all batch and server jobs have ended, it's a simple matter to enter restricted state by performing one of the following three techniques:

  1. Ending all subsystems by using the End Subsystem (ENDSBS) command
  2. Running the End System (ENDSYS) command
  3. Setting the system IPL parameters to start in restricted state and then IPLing the system

Each technique has its own advantages and drawbacks. Here's how they compare to each other.

ENDSBS: The Usual Way

Most people enter restricted state by running the End Subsystem command this way:

ENDSBS SBS(*ALL) OPTION(*IMMED)

With these parameters, ENDSBS will immediately end all non-essential active jobs and subsystems except for the partition's controlling subsystem and system console. There will be no warning to the users and no chance to end things cleanly once ENDSBS starts. To end your system in a more controlled manner, you can run ENDSBS with these parameters.

ENDSBS SBS(*ALL) OPTION(*CNTRLD) DELAY(*NOLIMIT)

A controlled ending gives your jobs time to perform end of job processing before termination. Because this command specifies *NOLIMIT in the Controlled end delay time parameter (DELAY), the system will allow each job as much time as it needs to end cleanly. However, using *NOLIMIT can be a bad idea because if a job up is hung or can't perform EOJ processing, the system will never go into restricted state. It's better to run ENDSBS with these parameters for controlled endings.

ENDSBS SBS(*ALL) OPTION(*CNTRLD) DELAY(xxxxx)

The xxxxx equals the number of seconds ENDSBS should wait for each job before ending that job immediately. This setting allows as many jobs and subsystems as possible to end normally. When the delay time runs out, the system will forcibly end all jobs and subsystems that have not finished their processing.

ENDSYS: A Slightly Better Way to End Subsystems

The End System (ENDSYS) command is slightly more flexible than ENDSBS. Like running ENDSBS with the *ALL parameter, ENDSYS ends all subsystems and system jobs. Like ENDSBS, ENDSYS has a How To end and Controlled end delay time parameter for forcefully or gently bringing down system work. There are only two practical differences between running ENDSBS and running ENDSYS.

First, ENDSYS notifies all active subsystems that a shutdown process is beginning. This may give some of your users and applications time to terminate cleanly before the system ends. The second difference is that you can configure ENDSYS to confirm whether the system shutdown request should be started. You can force confirmation for ENDSYS by running the command this way:

ENDSYS CONFIRM(*YES)

With CONFIRM set to *YES, ENDSYS will request a user confirmation before taking down the system. This is handy in case one of your administrators unintentionally runs the ENDSYS command during the day or changes their mind after starting the command. As valuable as CONFIRM *YES is, please understand that *YES is not the default setting for CONFIRM. CONFIRM is set to *ENVVAR, by default. *ENVVAR specifies that the command will consult the value in the system's QIBM_ENDSYS_CONFIRM environment variable to determine it should ask for a confirmation. The problem with using QIBM_ENDSYS_CONFIRM is that IBM provides little documentation on how to set the environment value. It's also unclear what happens if the value is not set. If anyone has more information on displaying and setting QIBM_ENDSYS_CONFIRM, please email me using the IT JungleContact page and I may publish your comments in a future article.

Because QIBM_ENDSYS_CONFIRM is a little obscure, changing CONFIRM's default value to *YES may be the best way to always receive a confirmation request when running ENDSYS. For more information on changing command default parameters, check out this article on using the Change Command Default command.

Configuring Your System To IPL Into Restricted State

The third way to enter restricted state is to set up the box to IPL into restricted state. This is easily done by setting the Start to restricted state parameter (STRRSTD) to *YES in the Change IPL Attributes (CHGIPLA) command. To do this, type in the CHGIPLA command on a 5250 green screen and press the F4 key to prompt for its parameters. When you change STRRSTD set to *YES, the next partition IPL will not start the controlling subsystem and your system will start up in restricted state.

The nice thing about STRRSTD is that it's a one-time change. After the system IPLs into restricted state, i5/OS will reset STRRSTD back to *NO so that you can perform a normal IPL the next time.

Knowing When Your System Is In Restricted State

There are three ways to tell when a system is in restricted state.

1. Look at the Work with Active Jobs (WRKACTJOB) command on the system console green screen. For systems that are in restricted state, all subsystems will be down. The controlling subsystem (usually QBASE or QCTL) will be the only active subsystem and there will only be one active job in that subsystem, the system console. The controlling subsystem job status may be set to END, when using ENDSBS or ENDSYS commands to put the system in restricted state.

2. Run the Work with Subsystems (WRKSBS) command. WRKSBS shows all the active subsystems, the subsystem pools that are assigned to each subsystem, and the status of each subsystem. When your system is in restricted state, WRKSBS will only show one entry for the controlling subsystem. Press F11 on that entry to view the subsystem status. If the controlling subsystem's status is RSTD, then your system is in restricted state.

3. Look in the System Operator message queue (QSYSOPR) or the System History Log. When an i5/OS system goes into restricted state, the operating system puts the following CPF0968 message into QSYSOPR and the system history log. Run the Display Messages (DSPMSG) command to look for the message in QSYSOPR:

DSPMSG MSGQ(QSYSOPR)

To find this message in the System History log, run the following Display Log (DSPLOG) command:

DSPLOG MSGID(CPF0968)

The CPF0968 message will look like this:

CPF0968 - System ended to restricted condition.

4. Call the Retrieve System Status API (QWCRSSTS) with the SST0200 format. When called with this format, the program returns a Restricted State flag in position 31.

Getting Out of Restricted State

Once you finish restricted state processing, there are two ways to restart your subsystems and jobs.

1. Restart your controlling subsystem. In restricted state, the controlling subsystem is considered ended. Once you restart the controlling subsystem, it launches the system startup program listed in the Startup Program system value (QSTRUPPGM). To view QSTRUPPGM's value, execute the following Display System Value (DSPSYSVAL) command:

DSPSYSVAL SYSVAL(QSTRUPPGM)

I would caution you against restarting your system by calling the QSTRUPPGM program. Doing that will restart most of your subsystems but it will not restart the controlling subsystem. This can cause problems depending on whether you process work in that subsystem. It's always cleanest to restart your i5/OS system by restarting the controlling subsystem. This can be done by running this Start Subsystem (STRSBS) command.

STRSBS SBSD(Controlling subsystem name)

You can find the name of the controlling subsystem in the Controlling Subsystem system value (QCTLSBSD):

DSPSYSVAL SYSVAL(QCTLSBSD)

2. IPL your system with the STRRSTD IPL attribute set to *NO. When the system restarts, it will automatically start the controlling subsystem and run the QSTRUPPGM program to restart your subsystems and applications.

Easy to Understand

There's nothing mysterious about getting into and out of restricted state. Once you know the tricks, the rest is easy.

About Our Testing Environment

Configurations described in this article were tested on an i5 550 box running i5/OS V5R4. Many of the commands are also available in earlier versions of the operating system running on iSeries or AS/400 machines. If a command is present in earlier versions of the i5/OS or OS/400 operating systems, you may notice some variations in the pre-V5R4 copies of these commands. These differences may be due to command improvements that have occurred from release to release.


RELATED STORIES

Getting in and Out of iSeries Restricted State

How to Change OS/400 Command Default Parameters

You Can Re-IPL an AS/400 into Restricted State



                     Post this story to del.icio.us
               Post this story to Digg
    Post this story to Slashdot


Sponsored By
SYSTEM i DEVELOPER

Take it to the Summit!

Come to the RPG & DB2 Summit in Las Vegas, October 20-22, for three full days of intense education focused on RPG IV, ILE, SQL, DB2, V6R1, WDSC/RSE/RDi & more.

Learn the latest in practical, usable tips and techniques from top gurus Susan Gantner, Skip Marchesani, Jon Paris, Paul Tuohy, Scott Klement and others in a highly interactive, fun, invigorating environment. You'll leave the Summit re-energized and eager to use all your new skills and ideas.

Register today and save $100 - $1295 registration ends October 3.


Senior Technical Editor: Ted Holt
Technical Editor: Joe Hertvik
Contributing Technical Editors: Edwin Earley, Brian Kelly, Michael Sansoterra
Publisher and Advertising Director: Jenny Thomas
Advertising Sales Representative: Kim Reed
Contact the Editors: To contact anyone on the IT Jungle Team
Go to our contacts page and send us a message.

Sponsored Links

ProData Computer Services:  Access remote databases from RPG, Webinar, Sept. 17, 2 p.m. CDT
MoshiMoshi:  Episode Three now showing! Watch and Win!
COMMON:  Join us at the Focus 2008 workshop conference, October 5 - 8, in San Francisco, California


 

IT Jungle Store Top Book Picks

Easy Steps to Internet Programming for AS/400, iSeries, and System i: List Price, $49.95
Getting Started with PHP for i5/OS: List Price, $59.95
The System i RPG & RPG IV Tutorial and Lab Exercises: List Price, $59.95
The System i Pocket RPG & RPG IV Guide: List Price, $69.95
The iSeries Pocket Database Guide: List Price, $59.00
The iSeries Pocket Developers' Guide: List Price, $59.00
The iSeries Pocket SQL Guide: List Price, $59.00
The iSeries Pocket Query Guide: List Price, $49.00
The iSeries Pocket WebFacing Primer: List Price, $39.00
Migrating to WebSphere Express for iSeries: List Price, $49.00
iSeries Express Web Implementer's Guide: List Price, $59.00
Getting Started with WebSphere Development Studio for iSeries: List Price, $79.95
Getting Started With WebSphere Development Studio Client for iSeries: List Price, $89.00
Getting Started with WebSphere Express for iSeries: List Price, $49.00
WebFacing Application Design and Development Guide: List Price, $55.00
Can the AS/400 Survive IBM?: List Price, $49.00
The All-Everything Machine: List Price, $29.95
Chip Wars: List Price, $29.95


 
The Four Hundred
Expanded Power Systems i Boxes on the Horizon?

Entry Power System i Boxes Compete Well with Windows Boxes

X64 Servers See Pricing Pressure in Q2, Big Box Sales Grow

The Law of Attraction

Arrow Says Midrange Shops More Worried About Security than Money

The Linux Beacon
Why Blade Servers Still Don't Cut It, and How They Might

Intel Keeps Both Arms Swinging with Xeons, Jabs with Itanium

Microsoft Ponies Up Another $100 Million for Novell Linux

Mad Dog 21/21: Newtonian Economics

Two More Xeon-Based Galaxy Servers from Sun

Four Hundred Stuff
SafeData Launches First Fully Managed Service for i5/OS HA

Aldon Brings PHP Closer Into Change Management Fold

HiT's DBMoto Gains Enterprise Replication Features

AmeriVault Debuts DR Service for i OS Servers

BMC Aims to Bring Virtual Servers Under Control

Big Iron
For Some Customers, the Mainframe Is Green

Top Mainframe Stories From Around the Web

Chats, Webinars, Seminars, Shows, and Other Happenings

System i PTF Guide
August 23, 2008: Volume 10, Number 34

August 16, 2008: Volume 10, Number 33

August 9, 2008: Volume 10, Number 32

August 2, 2008: Volume 10, Number 31

July 26, 2008: Volume 10, Number 30

July 19, 2008: Volume 10, Number 29

The Windows Observer
Citrix Addresses Performance with XenApp 5

Server Buyers Shop Like It's 1999 in the Second Quarter

Intel Keeps Both Arms Swinging with Xeons, Jabs with Itanium

Mad Dog 21/21: Newtonian Economics

Microsoft Does Something About Those SQL Injection Attacks

The Unix Guardian
What the Heck Is the Midrange, Anyway?

Overseas and Notebook Sales Offset Printer Declines for HP in Q3

Two More Xeon-Based Galaxy Servers from Sun

Mad Dog 21/21: Newtonian Economics

Intel's Nehalems to Star at IDF, AMD Pitches Shanghai

Four Hundred Monitor
Four Hundred Monitor's
Full iSeries Events Calendar

THIS ISSUE SPONSORED BY:

Help/Systems
ProData Computer Services
System i Developer


Printer Friendly Version


TABLE OF CONTENTS
The Efficiency of Varying Length Character Variables

SQL Assist: Powerful Interactive SQL

Admin Alert: Getting into a i5/OS Restricted State

Four Hundred Guru

BACK ISSUES

From the IT Jungle Forums
MQ Help Desired

Printing TCP/IP Details into a Spoolfile

IFF ACTIVE Equivalent in CL

Capture Sort File and Copy to Database File

SNMP Traps on i5OS

Java Messages





 
Subscription Information:
You can unsubscribe, change your email address, or sign up for any of IT Jungle's free e-newsletters through our Web site at http://www.itjungle.com/sub/subscribe.html.

Copyright © 1996-2008 Guild Companies, Inc. All Rights Reserved.
Guild Companies, Inc., 50 Park Terrace East, Suite 8F, New York, NY 10034

Privacy Statement