× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: Re: SNDEMAIL: Having problems with a text file
  • From: rob@xxxxxxxxx
  • Date: Tue, 27 Feb 2001 11:14:59 -0500


Ok, I am making some headway.  However the archives have alluded to some
magic ptf that will give further options on the CPYTOIMPF command.  I am on
V4R5.  This is the monkeyshines I have to pull now to get this to work.

         CPYTOIMPF  FROMFILE(*LIBL/&FILE) TOSTMF(&IFSFILE) +
                    RCDDLM(*CRLF)

/*
 | Convert the code page into something that SNDEMAIL will
 | handle.
*/
         CHGVAR     VAR(&SENDFILE) VALUE(&DIR +
                      *TCAT '/' *TCAT &FILE *TCAT '_A.TXT')
         DEL        OBJLNK(&SENDFILE)
         MONMSG     MSGID(CPFA0A9) /* Object not found */
         CPY        OBJ(&IFSFILE) TOOBJ(&SENDFILE) +
                      TOCODEPAGE(*PCASCII) DTAFMT(*TEXT)
         DEL        OBJLNK(&IFSFILE)
...
         SNDEMAIL   ADDRESSEE((ROB@DEKKO.COM 'Rob Berendt')) +
                      SENDER(DONOTREPLY@DEKKO.COM 'The AS400') +
                      SUBJECT(&SUBJECT) FILENAME(&SENDFILE) +
                      MESSAGE(&MESSAGE)


Notice the parameters TOCODEPAGE and DTAFMT?  I searched the archives for
CPYTOIMPF and CODEPAGE.  After reviewing the archives I do appreciate what
Roger was doing by creating the file first instead of the additional copy.
What I have is functional.

So is there some magic PTF, or is there a fungus on this apple I am eating?

Thanks to y'all for your help!


Rob Berendt

==================
Remember the Cole!


                                                                                
                                         
                    rob@dekko.com                                               
                                         
                    Sent by:                   To:     MIDRANGE-L@midrange.com  
                                         
                    owner-midrange-l@mi        cc:                              
                                         
                    drange.com                 Subject:     SNDEMAIL: Having 
problems with a text file                   
                                                                                
                                         
                                                                                
                                         
                    02/26/01 09:23 AM                                           
                                         
                    Please respond to                                           
                                         
                    MIDRANGE-L                                                  
                                         
                                                                                
                                         
                                                                                
                                         





I am attempting to use SNDEMAIL to send out a text file and I am having
problems.
I can view the file fine in the IFS with the WRKLNK command.  However when
I send it as an attachment it appears garbled.
Here are my steps:
First I have a physical file with defined fields created as an output file
from Query/400.  It has a CCSID of 37.
Then I use the command:
CPYTOIMPF  FROMFILE(*LIBL/&FILE) TOSTMF(&IFSFfile) RCDDLM(*CRLF)
This created an IFS file with a code page of 37 and a file format of
*TYPE2.
I can view the file fine in the IFS with the WRKLNK command.  I am not
storing it in QDLS; just at the root.  For example '/mmtest3.txt'
Then I use the command:
SNDEMAIL ADDRESSEE((ROB@DEKKO.COM 'Rob Berendt')) SENDER(THEAS400@DEKKO.COM
'Friendly AS400') SUBJECT('This is your requested data.') FILENAME
('/mmtest3.txt') MESSAGE('This text file may be opened in Excel and
manipulated there.')
The attachment is now gibberish.


Rob Berendt

==================
Remember the Cole!

+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to
MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator:
david@midrange.com
+---



+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.