Need to Copy Invoices pdf from one location to another

MindHunter

Member
I have come across a requirement in which I have to create a process to copy relevant invoices in PDF format to an FTP folder for delivery to PostNL. PostNL is a mailing service handling
 
Can you clarify whether you need to transfer the PDF from the iSeries to a Windows folder, or the other way around? Assuming that you need to transfer them to a non-iSeries folder. If so, you can use FTP on the iSeries to do it manually, or run the FTP commands from a CL program. If you'll give some more detail on how the process is supposed to work, I can probably pass along some code to get it done.
 
Hi too have a similar requirment. Please can you let me know how do we do this? My requirment is to copy the UBE output(CSV) from iSeries to a windows location
 
Here are the general steps to FTP an iSeries file (.CSV or .PDF or whatever) from the IFS to a non-iSeries folder. Note that you can also use an Open Source app such as FileZilla on the PC to do the same thing manually. The iSeries method is preferable (in my mind, at least) because it can be embedded in a CL program.

Type FTP RMTSYS(remote.system.name) on the iSeries command line and press Enter.
You'll be prompted for a user id and password for the remote system; enter those.
At the FTP prompt, type the following:
- bin
- na 1
These FTP commands set up the environment.
Use the FTP 'cd' command to change to the folder on the remote system where the file is to be transferred to.
Use the FTP 'put' command to transfer the IFS file to the remote system. For example:
- put /home/finance/spreadsheet.csv spreadsheet.csv
transfers the spreadsheet.csv file located in the IFS /home/finance directory to a file named spreadsheet.csv in whatever the current remote folder is.
- quit
Terminates the FTP session.

If you want to automate the process using a CL, you can do the following:
- Create a PF-SRC file called QFTPSRC to hold FTP input and output members.
- In QFTPSRC, create a member (we will call it FTPIN) as a TXT type member that contains the following lines; ignore the instructions in parenthesis:
user userid userpassword (again, these are for the remote system)
bin
na 1
cd /transferfolder (or whatever path on the remote system you want to put the file into)
put /home/finance/report.pdf report.pdf (substitute the local IFS path name for your own)
quit
- Create another QFTPSRC member called FTPOUT as a TXT member. Nothing needs to go in it.

In your CL, you can include the following commands to execute the FTP script in FTPIN:
OVRDBF FILE(INPUT) TOFILE(LIB/QFTPSRC) MBR(FTPIN)
OVRDBF FILE(OUTPUT) TOFILE(LIB/QFTPSRC) MBR(FTPOUT)
FTP RMTSYS(REMOTE.SERVER.NAME)
MONMSG MSGID(FTP0000) EXEC(DO)...

The output from the FTP session will be written to the FTPOUT member. This is useful for troubleshooting.

Hopefully this will give you enough to get started. Let me know if you have any other questions or need clarification on anything.
 
Back
Top