Home > AS/400 Tips > iSeries programmer tips > Trigger handles shortcomings of FTP on the iSeries
iSeries 400 Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

ISERIES PROGRAMMER TIPS

Trigger handles shortcomings of FTP on the iSeries


Michael Rooney
09.04.2003
Rating: -3.89- (out of 5) Hall of fame tip of the month winner


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


Having written an "automated" FTP command for the AS/400 in 1996, I read Tim Granatir's recent FTP tip with considerable interest. While the approach taken in Tim's tip was similar to mine -- and numerous others -- it doesn't address two of the biggest shortcomings of FTP on the iSeries. For one, the ability to dynamically generate a JOBLOG from each/every FTP client session. More than that, how can you immediately terminate an FTP session when a recognizable error condition occurs? The answer: a trigger.

As FTP writes its standard output (STDIO) to file OUTPUT, it is entirely possible to attach a database trigger to OUTPUT, where by, the triggered program "receives" the contents of the record being added to OUTPUT. The triggered program can then interpret the record for recognizable FTP error conditions. As the triggered program executes in the same program/invocation stack as the FTP process, the triggered program, upon identifying a valid FTP error condition, can issue a CPC2402 *ESCAPE message. This terminates the FTP client session immediately.

The attached .ZIP file contains my "twist" on automating FTP on the iSeries. While very similar to Tim's, I provide for immediate termination of FTP client sessions and the "echoing" of


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


RELATED CONTENT
iSeries programmer tips
Groovy programming on IBM i
EGL Rich UI on IBM i: Do you Dojo?
Running PHP open source applications: NOBODY needs authority
Programming for the Web on the IBM i, what is possible
Using geocoding on AS/400 to enhance your Web presence
The best technologies and tools for System i programmers in 2009
Seven IBM i project lessons learned in 2008
Documenting nested program structures on the AS/400
What is an integrated database?
An automated CL method of moving a query from AS/400 to Excel

iSeries Networking
CA Express utility helps you manage SSL certificates
20 FTP tips in 20 minutes
The Lazy Coder: Find your iSeries using a DNS or name server
The Lazy Coder: Fun with TCP/IP
Automatically check FTP process for errors
Fast guide to Redbooks and guides on printing/output
Printing tips and tricks
Improve old iSeries communication methods
'Twas the Night Before Christmas in IT
How to FTP a physical file via iSeries modem

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

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


FTP Client subcommands and responses to the jobs JOBLOG. The following summarizes the components in the .ZIP file:

STRFTP -- Command line interface.

STRFTPCL -- STRFTP command processing program; creates required files in QTEMP, adds trigger and performs other trivial, yet essential tasks.

WRTSRCDTA -- Like Tim's FTP15R, it writes entry for each FTP command supplied to STRFTP.

FTPERRORS -- Triggered program; like Tim's FTP200c, it processes each STDIO record written monitoring for specific FTP errors; also uses OS/400 API's to "echo" FTP commands/responses to JOBLOG.

FTPERRORS2 -- Similar to FTPERRORS, performs second pass through STDIO output file to handle use of SYSCMD, SYSC and "!" subcommands. As this was written in 1996, I can't remember why but I think it had/has something to do with the lack of uniform standards of functions across FTP implementations.

APIERRORS -- DDS defining OS/400's API error Data Structure. Currently implemented as External DS, but not required. It's simply a matter of personal preference.

Download the file.

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


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.


Submit a Tip




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