mgo
OS/400 Edition
Volume 2, Number 73 -- September 25, 2002

FTP'ing a Library


Hey, Ted:

I think there is a way to FTP an entire library to a PC file and then restore the PC file to another iSeries machine. I just don't know where to look. Can you tell me what to do?

-- Darrell


FTP only transfers files, Darrell, so the only way to FTP a library is to put the library into a file. In this case, you need to use a save file.

First, create a save file and then save the desired objects to it:

CRTSAVF   FILE(bbb/XYZ)
SAVLIB   LIB(aaa) DEV(*SAVF) +
   SAVF(bbb/XYZ) TGTRLS(*CURRENT)

Be sure to specify the proper release in the TGTRLS parameter.

When you FTP the save file to the PC, use a binary transfer. I like to use the extension .savf on my PC files that contain save files. That's not necessary, but when I see the file sitting on my hard drive months later, I know what it is.

Let's suppose you wish to transfer save file XYZ to PC file XYZ.SAVF in the TEMP directory. If you are doing the transfer from the PC side, use these FTP commands:

bin
quote   site   namefmt   0
get   bbb/xyz    c:/temp/xyz.savf

When you copy the save file from your PC to the second iSeries machine, you have to take steps to make sure the data winds up on the iSeries as a save file, not as a physical file. There are two ways to do this.

If you are using name format 0 (library/file.member), you must create the save file on the iSeries before running the FTP transfer. You can either create the save file during a terminal session, or use QUOTE RCMD to create the save file from your FTP session:

quote   rcmd   crtsavf   ccc/xyz
quote   site  namefmt   0
put  c:/temp/xyz.savf  ccc/xyz

If you use name format 1 (QSYS.LIB/library.LIB/file.SAVF), you do not have to create the save file in advance:

bin
quote  site  namefmt  1
put   c:/temp/xyz.savf    /qsys.lib/ccc.lib/xyz.savf

This is a good question, Darrell. I think this is one of those techniques that every iSeries programmer, operator, and administrator should know.

-- Ted


Sponsored By
WORKSRIGHT SOFTWARE

On June 30, 2002,
$$$$$$$$    Postal Rates went UP!    $$$$$$$$

On July 1, 2002,
$$$$$    you wanted your postage bill to go down.    $$$$$

We have the solution! CASS certify your mailing names and addresses and presort your outgoing mail and save. Our CASS certification software ensures that your address files have valid ZIP Code and address information. Our presort software ensures that you can properly prepare you mail for delivery to your Post Office.

WorksRight Software, Inc. is the number-one source for iSeries and AS/400 CASS, presort, ZIP Code, and area code software and data.

Visit our Web site - www.worksright.com - to learn more about our CASS and presorting software, or contact WorksRight Software, Inc., phone 601-856-8337,
e-mail software@worksright. com .


THIS ISSUE
SPONSORED BY:

WorksRight Software
COMMON


BACK ISSUES

TABLE OF CONTENTS

FTP'ing a Library

OPNQRYF Date Arithmetic

Reader Feedback and Insights: Displaying Menu Options


Editors
Howard Arner
Joe Hertvik
Ted Holt
David Morris

Managing Editor
Mari Barrett

Publisher and
Advertising Director

Jenny Thomas

Contact the Editors
Do you have a gripe, inside dope or an opinion?
Email the editors:
editors@itjungle.com



Last Updated: 9/25/02
Copyright © 1996-2008 Guild Companies, Inc. All Rights Reserved.