Emailing spool files from AS/400

55 pts.
AS/400 Spool Files
Spool files
How do you email spool files from AS/400 using RPG4?

Answer Wiki

Thanks. We'll let you know when a new response is added.

Somebody wrote an utility with a cmd file and clp program.
I don’t tried it, but maybe you can do.

See this page.

Try to call the code from your RPG4 program.

Discuss This Question: 4  Replies

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • Keo
    isn't it a way to do it in rpg4 instead of clp?
    55 pointsBadges:
  • Keo
    and i mean in a free form
    55 pointsBadges:
  • TomLiotta
    isn’t it a way to do it in rpg4 instead of clp? Since all of the code is available with the article, you can simply run the same instructions in RPG as shown for CL. But there are some technical elements that might need to be clear if deeper understanding is required. First, spooled files can't be e-mailed at all. Not in CL and not in RPG, nor any other language. What can be e-mailed is a copy of the text data that you can read from spooled files. Spooled files have internal structures that are intended for print writers. You can use the CPYSPLF command to copy data from a spooled file into a physical file. Once in a physical file, you can handle the data any way you wish in RPG. If you prefer not using a CL command at all, you can use Spooled File APIs in RPG to read the text data from the spooled file. Once you have formatted the e-mail the way you want it and appropriate for SMTP requirements, you can call the QtmmSendMail API to send it. Or you could use the catsplf - Concatenate and print spool files QShell utility to copy the text into a streamfile. You'll probably want to run the touch - Change file access and modification times QShell utility first to set an appropriate ASCII CCSID first. Then you can call the QtmmSendMail API. Part of the overall problem is that spooled files are essentially never sent from a Windows, Linux or other similar system. Pretty much no one would consider doing that, mostly because accessing them is too difficult and spooled files are not compatible with SMTP e-mail. Instead, they'd send the original document, or they'd create a new document in .PDF or other format and send that. Trying to send a Windows spooled file is far more complex than what you're asking for. Yet, even the few steps mentioned here, or shown in the above article, can seem to be too much. Nevertheless, QShell is "free" and the QtmmSendMail API is "free" if you have the system. Both can be accessed from RPG if that's how you need to do it. Others have done it and have made code or utilities available. For example, you might review iSeries MIME & Mail from Giovanni B. Perotti or RPGMail from Aaron Bartell. There are others as well. In each case, you download, install and configure, and then learn how to cal and use the procedures. I'm not sure any of them are seriously less difficult than using the system's built-in functions, but a lot of people find them easy enough. Tom
    125,585 pointsBadges:
  • Kaisersosa
    We used SNDEMAIL where i used to work. It worked great. To find it search for an article by David Leland from "iSeriesNetwork" circa September? 1998? I'm reaching way back into my 256k ram. <g> I had the command wrapped by a service program function for easy use from an rpg program. We have ESEND at my current job so that's the preferred method here. (Wrapped also :--) John B
    275 pointsBadges:

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.


Share this item with your network: