Home > AS/400 Tips > iSeries programmer tips > Save time and aggravation -- automate FTP data transfers
iSeries 400 Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

ISERIES PROGRAMMER TIPS

Save time and aggravation -- automate FTP data transfers


Tim Granatir, Search400.com expert
08.28.2002
Rating: -4.33- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



Tim Granatir

Sometimes it's the simple things that make the difference.

There are many techniques for transferring data from one machine to another. Some techniques have the advantage of security (tapes, CDs), but they take additional time in delivering the data. When time is critical, FTP offers a fast way to transfer data. Within the process of FTP data transfer, you can use several approaches with various degrees of automation.

The following is an example of automating the transfer of libraries from one iSeries to another by using batch files and your PC as an intermediate host. Generally, a PC is not required to be an intermediary in an FTP transfer between two iSeries, but there are some instances where it is necessary. The most common scenario is when the PC is the only link between two iSeries machines, such as using your local PC to dial in to a PPP line on another iSeries.

In this example, create a directory on the PC called FTPTMP that contains three batch files and also serves as a temporary holding place for a save file. The controlling batch file (GETSEND) calls a batch file (GETFROM) to save and retrieve all of the objects in a transfer library called XFER on the "from" iSeries and puts the save file into your PC directory. The second batch file (SENDTO) sends the save file to the receiving iSeries and restores all of the objects in the save file into a transfer library called XFER on the receiving machine.

The downside to this approach is that USERNAME and PASSWORD need to be replaced with the user name and password of the systems you are connecting. This could be a potential security exposure, which will need to be properly assessed and managed. Once managed, this can be a simple, handy and time-saving technique. In this case, an old-fashioned DOS batch file can still be an effective tool.

GETSEND Source
cd
cd FTPTMP
ftp -i -s:getfrom.bat 10.10.10.1
ftp -i -s:sendto.bat 10.10.10.2 

GETFROM Source
USERNAME
PASSWORD
binary
quote rcmd DLTF FILE(QGPL/FTP)
quote rcmd CRTSAVF FILE(QGPL/FTP)
quote rcmd SAVOBJ OBJ(*ALL) LIB(XFER) DEV(*SAVF) SAVF(QGPL/FTP) PRECHK(*YES)
get qgpl/ftp.savf
quit

SENDTO Source
USERNAME
PASSWORD
binary
quote rcmd CLRLIB LIB(XFER)
quote rcmd CRTSAVF FILE(XFER/FTP)
put ftp.savf XFER/FTP.SAVF
quote rcmd RSTOBJ OBJ(*ALL) SAVLIB(XFER) DEV(*SAVF) SAVF(XFER/FTP)
quit

---------------------------
About the author: Tim is vice president of Technical Services at Interlink Technologies in Maumee, Ohio, where he serves as chief architect for their warehouse management system. He has worked in the banking, insurance, healthcare and distribution industries in various positions, including programmer/analyst, systems analyst and DP manager. Tim has worked on IBM midrange platforms since 1983.

==================================
MORE INFORMATION
==================================

  • Change FTP server to use port other than 21
    Everyone knows that port 21 is the default port for FTP servers. But what if you want to change the port number to make it more difficult for someone to gain unauthorized access to you FTP server? If you've tried to do so and failed, you may think that it's impossible to do. Not true. Search400 expert Tim Granatir knows a way, and he shares it here with you.
  • FTP save files GET as well as they PUT
    FTP isn't quite an exact science, and there's room for different ways for transferring files -- as many readers have pointed out. Writer Joe Hertvik used some of your feedback to his previous tip (Tricks and techniques for FTPing OS/400 save files) to dig even deeper into FTPing save files from one iSeries to another. What he provides here are tips for using the FTP GET sub-command, more information on using the PUT sub-command and details on naming formats when transferring files from the IFS.
  • Implementing FTP and ODBC security on the iSeries 400
    This Search400.com member is looking for suggestions for implementing FTP and ODBC security on the iSeries. According to security expert Carol Woodbury, exit program are essential.
  • FTP secrets revealed
    FTP is one of the top utilities for transferring data to and from the iSeries. Still, users often have problems using it. These resources reveal tips you may not have considered before.


Rate this Tip
To rate tips, you must be a member of Search400.com.
Register now to start rating these tips. Log in if you are already a member.




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
Application Development
iSeries calling an .exe
Top 10 programmer tips
Formatted work job scheduler
Convert system date and time
Mixing free format code with embedded SQL
SQL update a field in one file from a field in another file
Webcasts for iSeries programmers
Programming advice from the pros
Easy code copying via the drag and drop method
Setting FTP time-outs

PC/Windows Connectivity
CA Express utility helps you manage SSL certificates
Windows XP SP2 causes problem for iSeries Access
Top 10 tips from our experts
The registration facility helps you tailor your system -- Part II
20 FTP tips in 20 minutes
Are your terminal sessions secure?
Top advice on connecting to the iSeries
Fast guide to PC/Windows connectivity resources
The Lazy Coder: Find your iSeries using a DNS or name server
The Lazy Coder: Fun with TCP/IP

iSeries programmer tips
Enhancing RPG with external SQL stored procedures
Tracking data changes on IBM i with triggers
Introduction to SQLRPGLE on IBM i: Making a report
Implementing a browser interface in COBOL: Displaying database fields
Taking advantage of CL advancements, starting with V5R3
TAATOOL: Useful tools for programmers on IBM i
Implementing a browser interface in COBOL: Creating your graphic Web page
Implementing a browser interface in COBOL: Getting started
Making the most of RPG data handling on IBM i
Groovy programming on IBM i

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



iSeries Security - Security Tools, Physical Security and System Security
HomeNewsTopicsITKnowledge ExchangeTipsBlogsAsk the ExpertsMultimediaWhite PapersProducts
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts