Emailing spool files from as/400

55 pts.
Tags:
AS/400 Spool Files
RPGLE
Spool files
how do you email spool files from as400 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 <a href=”http://www.itjungle.com/fhg/fhg052307-story01.html”>page</a>

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.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Keo
    isn't it a way to do it in rpg4 instead of clp?
    55 pointsBadges:
    report
  • Keo
    and i mean in a free form
    55 pointsBadges:
    report
  • 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:
    report
  • 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:
    report

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.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

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

Following