FTP Jar file from share path on windows to IFS location in AS400?

陌路散爱 提交于 2019-12-25 15:55:09

问题



I am looking for an approach / design through which i want to automate the process of FTP from windows location to IFS location present on AS400 environment when ever there is a new file added to windows path.

Below is the approach I thought, Please refine it if needed.

  1. We have an option WRKJOBSCDEthrough which we can run a CL program in a scheduled threshold of 1hr.
  2. To write a CL program which invokes a script(pyton/shell) to talk to windows location(say X:drive having its IP as xx.xxx.xx.xx).
  3. Shell script has to search for latest file in the location X:drive and FTP that jar(of size 5mb max) to IFS location(say /usr/dta/ydrive) on AS400 machine.
  4. Thus, CL program we invoked in STEP2 has to mail to me using SNDDSTthe list of all the jars ftp'd by the scheduler job that runs every 1 hr in STEP1.

All I am new to CL programming/RPGLE . Please help me with some learning stuff and also design of such concepts.


回答1:


You could use a library like the one provided by Scott Klement at https://www.scottklement.com/ftpapi/ to roll your own automation client. It was designed to be used from RPG, and is easy to use. From there it is a simple task to:

  1. retrieve a list of files in the directory
  2. parse the list to retrieve file timestamps
  3. get any files with a timestamp later than the last successful run



回答2:


The CL command RUNRMTCMD can be used to invoke a command on a PC running a rexec() client. iSeries Access for Windows offers such a client, and there are others available. With the iSeries client, the output of the PC command is placed in a spool file on the AS/400, which should contain the results of the FTP session.

You can copy the spool file to a file using the CPYSPLF command and SNDDST it to yourself, but I am not sure the contents will be converted from EBCDIC to ASCII.

Check out Easy400.net for the MMAIL programs developed by Giovanni Perotti. This package includes an EMAILSPL command to email a spool file. I believe you will need to pay $50 for the download.

I think you are on the right track, but the are a lot of details.




回答3:


You have to learn to program windows. dotnet filewatcher Out of scope for a complete answer. All of the other solutions seem to be polling solutions "Are we there yet?" "No were not there."



来源:https://stackoverflow.com/questions/42044560/ftp-jar-file-from-share-path-on-windows-to-ifs-location-in-as400

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!