Zip a IBM iSeries Save File on a PC

Posted on 2009-12-29
Last Modified: 2013-12-06
I am trying to do an online backup each night to file, ftp it to a Windows 2003 server, compress it with WinRAR and then send it off site.  I do a full SAVLIB on Sunday and a SAVCHGOBJ the other days.  This is just one library and the problem is that the full save is over 2GB.  When I decompress the full backup, FTP is back to the iSeries and try to do a DSPSAVF it tell me invalid data.  The smaller saves display okay.  

I've tried using the ZIPSAVE from but could never get it to work and the same with JAR.  Another issue is that after I save the library to a SAVF the system storage goes from 60% to 80% so zipping the SAVF on the iSeries pushes it over 90%.

Does anyone know of a compression software to use on the PC side that will work on the large SAVF.  Here is the WinRAR command being run:
"C:\Program Files\WinRAR\winrar.exe" m -m5 "D:\iSeries\s36f.rar" "D:\iSeries\s36f"


Question by:DCS12
    LVL 34

    Accepted Solution

    I've used numerous Windows, Unix, and Linux utilities to archive AS/400 save files (WinZIP, WinRAR, 7zip, tar, gzip, jar, etc.) over the years and I've never had a problem with any of them.  The bottom line is that if a compression utility works properly and decompresses the exact stream of bytes that were compressed originally, then the use of compression utilities should be transparent.

    Something else is going on here.  Perhaps there is a problem with the mechanism that you use to FTP?  Verify that you are doing a BINARY transfer in both directions, for example.  ASCII transfer will definitely screw things up.

    If your SAVF is large, verify that you are using the built-in data compression feature found on save commands?  DTACPR(*YES)  If the data is compressible, this option will result in a much smaller save file (of course, this means that it will not shrink much when zipped, if at all).

    What problem did you have with ZIPSAVE and jar?

    Anyway, if you create a save file, it takes up space.  If you then zip onto AS/400, the zip file is going to take up space.  Nothing you can really do about that.  If space is an issue, save to a save file using compression, FTP BINARY to a PC, and ZIP it there.

    If you continue to have trouble, post back and "show your work" - post the exact sequence of events and commands, FTP session output, etc. that is failing for you.

    - Gary Patterson

    Check out my EE profile:

    Author Comment

    Here is the process:

    1.  A CL runs the command to save the library after clearing the SAVF:
                 SAVLIB     LIB(QS36F) DEV(*SAVF) SAVF(QGPL/S36F) +      
    2. The Windows run a batch file:
         FTP -n -s:ftpas400Commands.sess

       Here is the contents of the script ftpas400Commands:
    User as400 Password
    CD qgpl
    LCD D:/iseries
    GET S36F

    3. Another batch file is ran to compress it.
        C:\Program Files\WinRAR\winrar.exe" m -m5 "D:\iSeries\s36f.rar" "D:\iSeries\s36f"

    Everything looks correct to me.

    I will try again tonight and let you know.  
    LVL 34

    Expert Comment

    by:Gary Patterson
    Yep, that looks fine on the save side.  What about the restore side?  It needs to be done as a BINARY transfer, too.

    What do the "m" and "-m5" options do on the WINRAR command.

    You said the small save files are OK, but the big ones aren't?  One thought:  Is it possible that the WINRAR command is getting executed before the FTP transfer completes, and perhaps is only picking up a partial file some of the time on the long transfers?  That would explain the corrupt file.

    Maybe the WinRAR command could just be tacked into the bottom of the FTP bat file to guarantee that one doesn't run until the other is complete?

    Maybe if you have and old S36F file on the PC, you can compare it to the unzipped file (Windows FC command in Binary mode) and see if the end of it is missing.

    - Gary
    LVL 16

    Assisted Solution

    by:theo kouwenhoven
    Hmm what sill happen if you restore a ftped file is it was not zipped? does that work?

    Also Gary's idea about incomplete file is possible
    Normally Iprefer to push the file from the AS/400 instead of pulling it but ok.
    should not make any diference.

    with Garry's idea your script has look like this

    User as400 Password
    CD qgpl
    LCD D:/iseries
    GET S36F S36F.tmp
    REN S36F.tmp S36F

    So the S36F file is only available when the transfer has completed.

    command -m is move
    switch -m5 is compression level

    Have a nice newyears eve :-)
    LVL 32

    Assisted Solution

    About  a year ago I tested the various options of save file compression and zip, to see which results in the smallest size.
    If you go for smallest ZIP size and best overall performance, DO NOT compress the save file with the built-in native options.



    Author Closing Comment

    Thanks guys.  Turns out it was Windows now having enough temp memory to FTP.  

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Storage devices are generally used to save the data or sometime transfer the data from one computer system to another system. However, sometimes user accidentally erased their important data from the Storage devices. Users have to know how data reco…
    The article will include the best Data Recovery Tools along with their Features, Capabilities, and their Download Links. Hope you’ll enjoy it and will choose the one as required by you.
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    794 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now