Volume 8, Number 18 -- May 7, 2008

Admin Alert: How to Recreate/Restore a System Distribution Directory

Published: May 7, 2008

by Joe Hertvik

In recent articles, I detailed how to change the communications identity of one i5/OS box so that it can impersonate another system and take its place on the network. However, I glossed over one important step: how to restore the i5/OS System Distribution Directory (SDD) from one machine to another. This week, I correct that error by showing you how to transfer an SDD from one machine to another.

What Is the SDD?

Although an SDD sounds like something you might catch when you're not being too careful about the company you choose, the System Distribution Directory has been a key player in i5/OS and OS/400 shops for a very long time. The SDD plays an important role in distributing output for several major IBM licensed programs, including the iSeries Access product line and the AnyMail Server Framework (MSF). It is also used in many third-party i5/OS applications, including fax server and email server applications. For many products, a user must have an entry in the SDD in order to use the product.

The SDD is seeded by using the Work with Directory Entries (WRKDIRE) command, and directory entry information is distributed and kept in the following files in the QUSRSYS library.

  • The QAOKL* files
  • The QAOKP* files
  • The QAOZL03A file

The good news is that the SDD, its associated commands, and its files have been around for a long time. According to IBM, the SDD and the commands that populate the SDD (ADDDIRE, CHGDIRE, WRKDIRE, and CHGSYSDIRA) have not undergone major changes since the OS/400 V3R1M0 timeframe. So we're dealing with a fairly stable system feature and these instructions should apply to most recent versions of i5/OS and OS/400, and they may even apply to i 6.1. The techniques shown here were demonstrated by using two i5/OS V5R3 machines.

Why Restore an SDD?

There are three good reasons why you may need to restore and replace an SDD on a target machine.

  1. When a System i box fails over to a Capacity BackUp (CBU) system for testing or in an emergency. As mentioned above, if users are going to sign on and use an impersonating system as if it were their production system, you will also need to duplicate the SDD from the production system to make sure your applications work for your guest users.
  2. When failing back to your production system after running production on a CBU system. In order to make the CBU function correctly again in its backup role, you may need to restore the SDD that was replaced.
  3. When objects in your System Distribution Directory are damaged or deleted, and you need to restore the directory in order to make your applications work together. If you're having trouble with an SDD, the underlying files may be corrupted and need to be replaced.

Transferring an SDD Between Two Consenting Hosts

Going through old IBM documentation, I created and tested the following procedure for restoring an SDD from one system to another. This scenario will also work when restoring an SDD from backup media. I tested this scenario by restoring a SDD from one i5/OS V5R3 machine to another. Since IBM has not made any major changes to the SDD in a long time, this scenario should also work for other versions of the i5/OS and OS/400 operating system, but note again that it has only been tested on a V5R3 machine. To protect yourself from accidental mistakes, however, make sure to take a copy of the QUSRSYS library on your target machine before beginning this procedure.

First Step To Take On the Source Machine

This procedure should be followed on the source machine that you are copying the SDD from.

Save the following QUSRSYS library objects to media or to a save file by using a variation of the following Save Object (SAVOBJ) command.

             DEV(*SAVF) SAVF(save_file_lib/save_file_name)

After saving these objects, you should have 15 physical files and 33 logical files in your save file, for a total of 48 objects. If you have more than 48 objects and there are files on your source system with names fitting either the QAOKxxxxxx or QAOKLxxxxxx format (where xxxxxx is a number between '000000' and '999999'), consult IBM Software Technical Document 14995701, QMSF Jobs Fail with a CP9A9C Errors with QAOK* Files. Follow the instructions in the section titled Fixing up QAOKL* and QAOKP* System Distribution Directory Files in QUSRSYS before running the SAVOBJ command again, and that should help you save only the 48 files that an SDD transfer needs.

The SAVOBJ command shown here demonstrates how to save the data to a save file. Make the appropriate changes in this command if you want to save the information to media. This step saves all the objects that contain SDD information from the machine where the information is stored.

Notice how I used a save-while-active (SWA) version of the SAVOBJ command to save this information. This is because some of these objects are locked to different system and program functions, and the only way to save them is by performing a SWA. If you don't perform an SWA save, you won't be able to save all the necessary objects for your SDD restore unless you put your machine in restricted state first.

Steps To Take on the Target Machine

On the target machine where you want to restore the saved source SDD to, perform the following steps:

1. Back up the target system's current QUSRSYS library to media in case you make a mistake and need to restore some QUSRSYS objects back to the system. This can easily be done by using the following Save Library (SAVLIB) command.

SAVF(save_file_library/save_file_name) SAVACT(*SYNCLIB) 

Notice again that I used a SWA version of the command to ensure that I save all the objects.

2. Put the machine in restricted mode. This is necessary in order to delete the objects in your current SDD files. You can find instructions for putting your Power i, System i, iSeries, or AS/400 box into restricted mode by reading this article

3. Use the following Delete Files (DLTF) command to remove the following files from the QUSRSYS library. (Again I caution you to save these objects before deleting them in case they need to be replaced later.)


You must run these DLTF commands in this order because the QAOZL03A file is a logical file that is built over eight different QAOKP* physical files. If you don't remove the logical file first, you won't be able to remove the QAOKP* files that it is built over.

4. Restore the new SDD files from your source system by using the following Restore Object (RSTOBJ) command. Use the source media that you saved in the section "First Step To Take On the Source Machine" to perform this step.

             DEV(*SAVF) SAVF(save_file_library/save_file_name)


Note that because the QAOZL03A file is dependent on several QAOKP* files being restored, you should restore that file last after all the QAOKP* files have been processed.

5. Run the Initialize System (INZSYS) command, which helps to initialize the restored information in the QUSRSYS library.


It's important to avoid performing the next step until this INZSYS command has finished. If you run the next step before INZSYS completes, you could damage your system. For information on how to tell when INZSYS completes, see my article on how to use INZSYS.

6. After INZSYS completes, run the following two Change System Directory Attributes (CHGSYSDIRA) commands to update your directory search information from the new SDD files. These commands first delete the old search information associated with the System Distribution Directory, before rebuilding it with the new SDD information.



The first command deletes the old information, while the second rebuilds the search information.

7. At this point, your new SDD should be ready to use on your target machine. You can verify that all the entries have been transferred by running the Work with Directory Entry (WRKDIRE) command and checking to see that all the entries have been properly restored to your system.

Steps To Restore the Original SDD

If you're ready to restore the original SDD on your target system, it's fairly easy to do. All you have to do is perform steps 1 through 7 on your target system by using the save file or media that contains the original QAOKL*, QAOKP*, and QAOZL03A files from before you overrode the old SDD with the new SDD. The process will work exactly the same as it did for overriding the SDD, and you'll have your original SDD back on the system in no time.


Five Benefits of a High-Availability System

Getting In and Out of iSeries Restricted State

How System i Boxes Impersonate Each Other, Part 1

How System i Boxes Impersonate Each Other, Part 2

IBM Software Technical Document 14995701, QMSF Jobs Fail with a CP9A9C Errors with QAOK* Files, before proceeding

What is INZSYS, and Why Should I Care?

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

Sponsored By

Do you need area code information?
Do you need ZIP Code information?
Do you need ZIP+4 information?
Do you need city name information?
Do you need county information?
Do you need a nearest dealer locator system?

We can HELP! We have affordable AS/400 software and data to do all of the above. Whether you need a simple city name retrieval system or a sophisticated CASS postal coding system, we have it for you!

The ZIP/CITY system is based on 5-digit ZIP Codes. You can retrieve city names, state names, county names, area codes, time zones, latitude, longitude, and more just by knowing the ZIP Code. We supply information on all the latest area code changes. A nearest dealer locator function is also included. ZIP/CITY includes software, data, monthly updates, and unlimited support. The cost is $495 per year.

PER/ZIP4 is a sophisticated CASS certified postal coding system for assigning ZIP Codes, ZIP+4, carrier route, and delivery point codes. PER/ZIP4 also provides county names and FIPS codes. PER/ZIP4 can be used interactively, in batch, and with callable programs. PER/ZIP4 includes software, data, monthly updates, and unlimited support. The cost is $3,900 for the first year, and $1,950 for renewal.

Just call us and we'll arrange for 30 days FREE use of either

WorksRight Software, Inc.
Phone: 601-856-8337
Fax: 601-856-9432
E-mail: software@worksright.com
Web site: www.worksright.com

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

COMMON:  Join us at the Focus 2008 workshop conference, October 5 - 8, in San Francisco, California
MoshiMoshi:  An Interactive Experience for the System i Community. See Episode 1 now!
Help/Systems:  Explore operations automation and BI, June 17 - 20, 2008, Minneapolis, MN


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
IBM Previews "Blue Business" SMB System Sales Approach

Micro Focus to Acquire NetManage for $73.3 Million in Cash

Power Systems: The Feeds and Speeds

There's No i in Future, But Is There a Future in i?

IBM Cuts CPU Prices on Power5 and Power5+ Servers

The Linux Beacon
The Linux Ecosystem to More than Double to $49 Billion

IBM Goes Stateless and Cooler with iDataPlex Servers

IBM Previews "Blue Business" SMB System Sales Approach

As I See It: That Competitive Bug

Power Systems: The Feeds and Speeds

Four Hundred Stuff
GDCM Seeks to 'Defrag' the Data Center for Higher Efficiency

Bsafe Updates Security Tools for i OS

GeneXus Brings Web 2.0 Home with Version X

Terminix Overcomes Hurdle to New B2B System, Thanks to LANSA

NSPI Launches CBU as a Service Offering

Big Iron
Micro Focus to Acquire NetManage for $73.3 Million in Cash

Top Mainframe Stories From Around the Web

Chats, Webinars, Seminars, Shows, and Other Happenings

System i PTF Guide
May 3, 2008: Volume 10, Number 18

April 26, 2008: Volume 10, Number 17

April 19, 2008: Volume 10, Number 16

April 12, 2008: Volume 10, Number 15

April 5, 2008: Volume 10, Number 14

March 29, 2008: Volume 10, Number 13

The Windows Observer
Operations Manager 2007 Goes Cross-Platform, Hooks Into Tivoli, OpenView

Micro-Hoo: Where Does It Stand Now?

Record Revenues for Microsoft, But Forecast Downgraded

Message for Windows XP Fans Seeking to Save OS: Get Over It

Beta of BizTalk Server R3 Expected Later This Year

The Unix Guardian
Sun Books a Small Loss on a Tiny Revenue Decline, Cuts Jobs

Solaris 10 5/08 Supports Legacy Containers, Xeon Features

Sun Taps Splain to Run Microelectronics, Buys Montalvo Carcass

As I See It: That Competitive Bug

Vision Moves Product and Business Plans Forward

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


Profound Logic Software
WorksRight Software

Printer Friendly Version

Accurate Program References

Replace the Contents of a Physical File That Has Triggers

Admin Alert: How to Recreate/Restore a System Distribution Directory

Four Hundred Guru


From the IT Jungle Forums
Java Messages

Restrict *cmd to specific user

Copying recs from a subfile to a file and keeping highlights

Imbedded SQL



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