× 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.



Yeah. I think this is based on my lack of understanding of the steps included in your original SNDMAILxxx routines.
I've included the unchanged logic below in case it might jog your memory of the sequence. Maybe I only need to do this stuff for physical data files that are being sent, like CSV's or actual PF's? NOT for PDF's?

// ------------------------------------------
//  Convert the PF to a format that PCs like
//  a Comma Separated Values (CSV) file
// ------------------------------------------

tempAttach = %str(tmpnam(*omit));
unlink(tempAttach);

cmd = 'CPY OBJ(''' + %trim(attFile) + ''') '
    +           'TOOBJ(''' + tempAttach +''') ';

QCMDEXC( cmd : %len(cmd));

// ------------------------------------------
// create a temporary file in the IFS.
// mark that file as ccsid 819 (ISO 8859-1 ASCII)
// ------------------------------------------

filename = %str(tmpnam(*omit));
unlink(filename);

fd = open( filename
         : O_CREAT+O_EXCL+O_WRONLY+O_CCSID
         : M_RDWR
         : 819 );
if (fd = -1);
  ReportError();
endif;

// ------------------------------------------
// close file & reopen in text mode so that
// data will be automatically translated
// ------------------------------------------

callp close(fd);
fd = open( filename : O_WRONLY + O_TEXTDATA );
if (fd = -1);
  ReportError();
endif;


Best Regards,

Thomas Garvey


On 7/26/2021 11:04 AM, Scott Klement wrote:
Hi Thomas,

Its possible that I am confusing two different things...  but, at the start of this thread, you said you were opening the file in text mode.   The purpose of doing of opening a file in text mode is to convert things to EBCDIC.

-SK


On 7/26/2021 10:50 AM, Thomas Garvey wrote:
Ok, forgive my ignorance. How/where am I converting to EBCDIC? Is that what opening and closing the files on IFS are doing? I'm really just trying to use the SMTP email routines to attach a pdf file to an email, and sending it.
DO i have an extra unneeded step in there?

On 7/24/2021 12:45 AM, Scott Klement wrote:
PDF?! PDFs are binary documents, you can't convert those to EBCDIC -- that makes no sense.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.