Problem solve Get help with specific problems with your technologies, process and projects.

E-mailing spool files from the AS/400

I was recently working on a CL program that would convert spool files to physical files, then using the SNDDST...

command to send these files to the end users' e-mail addresses. However, I found that when trying to e-mail to a PC/Windows account, the result was gibberish. I am assuming that the problem was due to the fact that the AS/400 uses EBCDIC and the PCs use ASCII to encode data. Is this correct, and is there a way to use SNDDST to e-mail a physical file so that it is readable on a PC/Windows platform?

The following is a method that I've used successfully in the past to e-mail spool files from the AS/400. You can also use the CPYTOSTMF command to populate your folder but this command just makes it a little easier.

Try copying your spool file to your folder using this command as an example: CPYTOPCD FROMFILE(MYLIB/MYFILE) TOFLR(&FLR) TODOC(&DOC) REPLACE(*YES) TRNTBL(QASCII) You should not have to specify the translation table on the the CPYTOPCD command but I included the parameter just to be absolutely sure that the ASCII conversion is being done.

Also, when you do the SNDDST command, make sure you are using the default SNDFMT(*NOCHG).

I believe that some early versions of the Mail Server Framework had a few bugs. If you are not up to date on your PTFS, I would also recommend ordering and installing the latest cumulative PTF package.

This was last published in April 2001

Dig Deeper on iSeries COBOL programming

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

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

Please create a username to comment.