[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


How to launch .exe pgm from within FTP to MS SQL server to proces uploaded files

Posted on 2011-04-27
Medium Priority
Last Modified: 2013-12-09
I have a client that we are transferring order files to a MS SQL Server from IBM iSeries using FTP
Once the file transfers have completed, the client wants us to run a pgm that will process the uploaded files.
I have been unable to make the QUOTE cmd in FTP run the remote cmd. I have been reluctant to look at using
RUNRMTCMD since it opens up the Host system to incoming remote cmds.

The clients' vendor has suggested running an HTTP cmd but not sure how to launch that via FTP or
from within my CL pgm.

Any suggestions would be greatly appreciated.
Question by:miraclemaxnd
LVL 39

Expert Comment

by:Aaron Tomosky
ID: 35480794
You could make a batch file that checks the FTP folder and runs the command if the file is there. Schedule that to run every few min

Author Comment

ID: 35482966
They are using that method currently and they can't set the time between checks to be less than 1 miinute so that won't work which is why I am looking for a way to launch the .bat or .exe to run after I have uploaded my files.
LVL 10

Expert Comment

ID: 35483112
Maybe we could improve the batch file they use to resolve this 1 minute limmitation.
LVL 36

Accepted Solution

Gary Patterson earned 2000 total points
ID: 35484669
As far as I know the RCMD FTP verb (command) is not supported by the native Microsoft FTP servers.  So, if you connect FROM a MS box (FTP client) to an AS/400 (FTP server), you can use the RCMD verb to execute AS/400 commands on the AS/400 server, but you cannot do the reverse (AS/400 client to MS server).

You'll need to use another mechanism to launch your program.  There are a lot of ways to do this.  Examples:

you can load a Remote Command server onto the remote system.  IBM also provides an Incoming Remote Command service as part of IBM i Access.  You can use the RUNRMTCMD command to kick off remote commands on any box 9Linux, Windows, AS/400, etc.) that is running a compatible remote command service.  The downside is these services are not very secure.

Another good method is to create or install a folder-monitoring tool.  One thing to note about file-monitoring solutions:  It is usually a good idea to FTP into a temporary folder (since transferring files can take time, and you don't want your program to process half of a file usually), and then as a last step use an FTP command to MOVE the file(s) into the monitored folder, since MOVEs are instantaneous if the files reside on the same volume.


Another option is to use SSH.  This is a very secure, flexible mechanism.  First, you'll have to install and configure an SSH server on you Windows server, and you'll also have to configure SSH on your AS/400.  Then you can use QShell commands to remotely execute commands between the two systems:


- Gary Patterson


Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Determining the an SCCM package name from the Package ID
During and after that shift to cloud, one area that still poses a struggle for many organizations is what to do with their department file shares.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

872 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