• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Admin Alert: Five Minutes to Moving System i Objects Between Partitions

    February 27, 2008 Joe Hertvik

    Administrators in multiple System i environments are frequently called upon to save and restore files from one i5/OS machine to another. Because you may not always remember the exact steps involved in performing a transfer, this week I’m presenting a five-minute cheat sheet that details every step you need to perform in order to easily save an object and move it to a companion machine via FTP.

    The Basic Game Plan

    When moving objects between System i partitions, there are five critical steps that you need to follow.

    1. Creating or clearing an i5/OS save file on the source system
    2. Saving the object(s) to the save file
    3. Prepping the save file on the target system
    4. FTPing the save file between the source and target system
    5. Restoring the object to the target system

    Get your stopwatches ready, because here’s how to do all five steps in five minutes or less.

    The File In Question

    To illustrate this process, I’ll be transferring the Client Access sample customer file (QCUSTCDT) between a source and a target System i partition. QCUSTCDT is a standard file that IBM has provided with most versions of the i5/OS and the older OS/400 operating systems. It can usually be found in the QIWS library on your system. For this example, I’ll be saving and transferring the file from my source System i partition to a library named HOLD on my target machine.

    Step 1: Create or Clear an i5/OS Save File

    i5/OS save files are normally used to transfer reasonably sized objects between systems. Save files can be quickly created, and they are used to save any type of system object that could normally be saved to media.

    For our example, we’ll use a save file called GARBAGE that resides in the HOLD library on the source system. Before you start the save, you need to ensure that the save file is created on the system and that it is empty. If you don’t currently have a GARBAGE file on your system, you can use the following Create Save File (CRTSAVF) command to create one.

    CRTSAVF FILE(HOLD/GARBAGE) TEXT('Save file for transferring data')
    

    This command creates a new empty file for transferring your data. If you already have a GARBAGE save file and you want to clear it before saving the data, use the following Clear Save File (CLRSAVF) command.

    CLRSAVF FILE(HOLD/GARBAGE)
    

    Step one is complete. Now you’re ready to save your QCUSTCDT object.

    Step 2: Save the Object To the Save File

    Saving the object is an extremely simple process. To save our QCUSTCDT object from QIWS into the GARBAGE save file, you can execute the following SAVOBJ command on the source system.

    SAVOBJ OBJ(QCUSTCDT) LIB(QIWS) DEV(*SAVF) SAVF(HOLD/GARBAGE)
    

    This SAVOBJ command is the same command that you would use if you were saving QCUSTCDT to media. The only difference is that instead of entering a media drive name into the device (DEVICE) parameter, I entered the ‘*SAVF’ literal, which denotes that this object will be saved to an i5/OS save file. To denote the save file name and library, you enter that location in the save file (SAVF) parameter. Using this command, the file is quickly saved to the HOLD/GARBAGE save file.

    Step 3: Prepping the Save File on the Target System

    Before you can transfer the save file containing the QCUSTCDT object, you need to ensure that one of the following situations exist on your target partition.

    1. If the save file already exists in the library you’ll be transferring to, the file needs to be cleared so that it can accept the data that will be transferred from the source machine. If the file is not cleared, the FTP transfer will not work properly. Or…
    2. The save file does not exist on the target partition

    If you’re transferring the GARBAGE save file to the HOLD library on the target partition and that library already has a GARBAGE save file, you can use the same CLRSAVF command that I described in step two to clear the target partition save file.

    CLRSAVF FILE(HOLD/GARBAGE)
    

    If the GARBAGE file doesn’t already exist on the target system, don’t worry. The FTP file transfer sub-commands that I’ll explain in step four will automatically create the GARBAGE file on your target partition, if the file isn’t there.

    Now you’re ready to transfer.

    Step 4: FTP the Save File Between the Source and Target System

    After the prep work is complete, you can move the GARBAGE save file containing your data to the target system by using an FTP file transfer. To do that, you must start the FTP server on both systems, if it’s not already started. Run the following Start TCP/IP Server (STRTCPSVR) command on both systems to start your FTP servers.

    STRTCPSVR SERVER(*FTP)
    

    Once FTP is started, open an FTP session on the source box by running this Start TCP/IP File Transfer (FTP) command.

    FTP RMTSYS(Target_system_name or IP_address)
    

    Since you will be transferring the save file from the source partition, that partition is functioning as the FTP client and the target partition is functioning as the FTP server. After the FTP session starts, it will ask you to log on to the FTP server by providing a valid FTP server user ID and password. Once you’re signed on, you can execute the following FTP sub-commands to transfer the GARBAGE save file from your source to your target system.

    quote site namefmt 0
    cd hold
    lcd hold
    bin
    quote site namefmt 1
    put garbage.savf
    quit
    

    These commands perform the following functions.

    • quote site namefmt 0–This line allows you to run the FTP Select File Naming Format sub-command on both systems. The NAMEFMT sub-command changes the file naming format convention used in this FTP session. When specifying NAMEFMT 0, all location and file references can only be specified with native i5/OS library and object names. Using NAMEFMT 0 makes it easier to change the remote and local working directory names in the next two FTP sub-commands.
    • cd hold–This Change Working Directory or Library sub-command changes the default working directory on the FTP client (the source partition, in this case) to point to the HOLD library where your GARBAGE save file is located. If the working directory is not explicitly specified in other FTP sub-commands, client FTP transfers will search for the file to be transferred in the HOLD library.
    • lcd hold–This variation on the Change Working Directory or Library sub-command changes the default working directory on the FTP server (the target partition) to the HOLD library. This designates that any transferred files will be deposited in HOLD.
    • bin–Designates that the FTP file transfer will be a binary image transfer. In a binary transfer, files are transmitted in a continuous data stream without any transformation between the source and the target machine. Save file transfers are required to use binary image transfer.
    • quote site namefmt 1–Reverses the first NAMEFMT sub-command, and changes the file naming format convention for this session to use the AS/400 Integrated File System (AS/400 IFS) naming convention. The IFS naming convention is required for the actual transfer in order to designate that you are transferring an i5/OS save file instead of a data file.
    • put garbage.savf–Transfers the GARBAGE save file from the working directory on the FTP client (the HOLD library) to the working directory on the FTP server (also the HOLD library). The .savf extension tells FTP that this is a save file and it provides for the effective transfer of the save file contents. The file will not transfer correctly if you don’t add the .savf literal to the end of the file name to be transferred. If the save file does not exist on the target machine, FTP will create a new save file as the transfer is happening.
    • quit–Exits the FTP session.

    After executing these FTP sub-commands, a copy of the GARBAGE save file containing the QCUSTCDT file will now reside in the HOLD library on the target machine.

    Step 5: Restoring the Object To the Target System

    Once the save file is transferred, it’s relatively easy to restore the file to the HOLD library on the target system. In this case, you would use the following Restore Object (RSTOBJ) command to restore the object from the GARBAGE save file.

    RSTOBJ OBJ(QCUSTCDT) SAVLIB(QIWS) DEV(*SAVF) SAVF(HOLD/GARBAGE)
    MBROPT(*ALL) ALWOBJDIF(*ALL) RSTLIB(HOLD)  
    

    If a copy of QCUSTCDT already exists in the library, this particular command will use the Allow Object Differences (ALLOBJDIF) parameter and the Data Base Member Option (MBROPT) parameter to overwrite the existing file.

    I’m Afraid Our Time Is Up

    And that’s how you can use FTP to easily transfer a file from one i5/OS partition to another partition in five minutes or less. To adapt this template to your situation, you would simply change your SAVOBJ and RSTOBJ commands to specify other objects. If you wanted to transfer different types of objects, such as AS/400 IFS files, DLO files, programs, or source code file, you can continue to use the procedure as listed here. The only difference is that you should execute the proper i5/OS SAVxxx and RSTxxx commands to save and restore the objects from your GARBAGE save file.

    About Our Testing Environment

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



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

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Tags:

    Sponsored by
    Maxava

    Migrate IBM i with Confidence

    Tired of costly and risky migrations? Maxava Migrate Live minimizes disruption with seamless transitions. Upgrading to Power10 or cloud hosted system, Maxava has you covered!

    Learn More

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Sponsored Links

    COMMON:  Join us at the annual 2008 conference, March 30 - April 3, in Nashville, Tennessee
    Northeast User Groups:  18th Annual Conference, April 14-16, 2008, Sheraton Hotel, Framingham, MA
    Vision Solutions:  Disaster Recovery and Compliance – Get the Free e-Book!

    IT Jungle Store Top Book Picks

    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

    HiT Takes IT Solutions to South America Q&A with IBM’s Mark Shearer: Still Mister System i

    Leave a Reply Cancel reply

Volume 8, Number 8 -- February 27, 2008
THIS ISSUE SPONSORED BY:

Profound Logic Software
SPSS
WorksRight Software

Table of Contents

  • XAMPP: The PHP Developer’s Dream
  • Programmatically Retrieve Defined System i Names
  • Admin Alert: Five Minutes to Moving System i Objects Between Partitions

Content archive

  • The Four Hundred
  • Four Hundred Stuff
  • Four Hundred Guru

Recent Posts

  • Public Preview For Watson Code Assistant for i Available Soon
  • COMMON Youth Movement Continues at POWERUp 2025
  • IBM Preserves Memory Investments Across Power10 And Power11
  • Eradani Uses AI For New EDI And API Service
  • Picking Apart IBM’s $150 Billion In US Manufacturing And R&D
  • FAX/400 And CICS For i Are Dead. What Will IBM Kill Next?
  • Fresche Overhauls X-Analysis With Web UI, AI Smarts
  • Is It Time To Add The Rust Programming Language To IBM i?
  • Is IBM Going To Raise Prices On Power10 Expert Care?
  • IBM i PTF Guide, Volume 27, Number 20

Subscribe

To get news from IT Jungle sent to your inbox every week, subscribe to our newsletter.

Pages

  • About Us
  • Contact
  • Contributors
  • Four Hundred Monitor
  • IBM i PTF Guide
  • Media Kit
  • Subscribe

Search

Copyright © 2025 IT Jungle