Home > Ask the AS/400 Experts > Questions & Answers > Triggering an import job
Ask The iSeries 400 Expert: Questions & Answers
EMAIL THIS

Triggering an import job

Tim Granatir EXPERT RESPONSE FROM: Tim Granatir

Pose a Question
Other iSeries 400 Categories
Meet all iSeries 400 Experts
Become an Expert for this site
>
QUESTION POSED ON: 03 September 2003

You Can View User Feedback To This Expert Q&A

We currently receive data on our iSeries into the IFS via FTP. We have a scheduled job that imports the data into the main database. Is there any way this can be automated so that when the data is written into the IFS the import job can be triggered?

>

On the process that is doing the FTP command, add an extra statement to start the import process. FTP on the 400 supports calling remote iSeries commands using the quote rcmd function. An example FTP statement to call an iSeries program would look like this:

quote rcmd CALL PGM(MYLIB/MYPGM)

If you use call like in this example, the program being called should take care of setting up the library list for the rest of the job, and other things like that. You could have just as easily put in a SBMJOB command from the FTP prompt or just about any other command the iSeries supports.

You could also do a never-ending program that would sit out in batch and wake up occasionally to check the status of what is in the IFS, but that is not nearly as efficient or as quick to code as using FTP to start the process.

USER FEEDBACK TO THIS EXPERT Q&A

  • With regards to the recent question regarding an IFS trigger when the file is sent via FTP, I have recently implemented a solution using an FTP exit program (FTP Server Request Validation - QIBM_QTMF_SERVER_REQ).

    On an FTP PUT statement, the exit program checks directory being used, and if it is the target directory, a job is submitted that processes the file. The filename is known to the exit program so that is passed as a parameter.

    This method requires no extra effort from the sending party such as RCMD, which in my case is important because the files are FTP'd in from outside my company. It is also more efficient than a continually running batch job.

    The only downside is that the exit program is called BEFORE the PUT statement is performed, meaning that at the time I submit the job, the file is not ready. The way I overcame this was to put a DLYJOB at the beginning of my program (to allow the send to complete), and also I copy the file before processing it, and if the file is still in transit the copy will fail (to which I wait a couple more seconds and try again). — Robert Mashiah

==================================
MORE INFORMATION ON THIS TOPIC
==================================

The Best Web Links: tips, tutorials and more.

Ask your programming questions--or help out your peers by answering them--in our live discussion forums.

Ask the Experts yourself: Our application development gurus are waiting to answer your programming questions.


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



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



Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice



iSeries Networking - Printing, Remote Access, TCP/IP
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 - 2010, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts