Page 1 of 1

CSV attachment with different fonts in the File

Posted: Mon Jun 23, 2014 6:44 pm
by Anithab
Hi all,

Is it possible to send a mail with csv file as attachment having different fonts from Mainframe?

Like the Header line will be with different font size and the next like with different font size and bold ?

Re: CSV attachment with different fonts in the File

Posted: Mon Jun 23, 2014 9:40 pm
by Anuj Dhawan
Hi,

This is an example of a job that sends a SMTP note with a HTML MIME extension, please amend it as per your choice and see if it works for you:

Code: Select all

//SENDNOTE EXEC PGM=IEBGENER
//SYSIN    DD DUMMY
//SYSPRINT DD SYSOUT=*
//SYSUT2   DD SYSOUT=(A,SMTP)
//SYSUT1   DD *
helo MVSHOST
mail from:<abcd@abc.com>
rcpt to:<wxyz@xyz.com>
data
From:     abcd@abc.com
To:       wxyz@xyz.com
Subject:  Message with HTML MIME
MIME-Version: 1.0
Content-type: multipart/mixed;
              boundary="simple boundary"

You have received mail whose body is in the HTML Format.
--simple boundary
Content-type: text/html

<font face="Courier" size="+2" color=blue>
This is Courier font in blue</font>
<br><br>
<font face="Arial" size="+3" color=red>
This is the Arial font in red</font>

--simple boundary--

Re: CSV attachment with different fonts in the File

Posted: Tue Jun 24, 2014 1:58 am
by Robert Sample
My understanding is that a csv file is plain-text (that is, no color, no font, no sizing) so what you are wanting to do is not possible, period. Excel may support HTML-style formatting but that would depend upon Excel.

Re: CSV attachment with different fonts in the File

Posted: Tue Jun 24, 2014 9:57 am
by Anuj Dhawan
Robert is correct -- my job will work on the "body of the email" and not on attachment. Sorry for the fast fingers... :oops:

Re: CSV attachment with different fonts in the File

Posted: Tue Jun 24, 2014 11:27 am
by Anithab
Anuj,

Thanks for hinting that and the example :) I got a similar example from planetmvs..

Robert,

Thanks for your help. But if I wanted to attach the excel with different fonts from mainframe how do I need to approach that?

Any links or pointers will be helpful

Re: CSV attachment with different fonts in the File

Posted: Tue Jun 24, 2014 5:11 pm
by Anuj Dhawan
If SAS can be your choice, have a look here. I've not explored it much but it sounds interesting:



Link to the file: http://support.sas.com/resources/papers ... 0-2011.pdf

Re: CSV attachment with different fonts in the File

Posted: Tue Jun 24, 2014 8:24 pm
by Robert Sample
The easiest way is if your site has one of the mainframe products that generate Excel formats. You would use that tool to create Excel files that can be transferred from the mainframe. If your site does not have such a tool, buying one would allow for such transfers. I have not researched prices, though most mainframe software runs tens to hundreds of thousands of US dollars (and the cost typically depends upon the size of the mainframe).

Another method would be to use SAS, as Anuj suggested. SAS can generate Excel files on the mainframe with little effort. If your site does not have SAS, though, it can be expensive to acquire.

The WORST way would be to write your own Excel file generator on the mainframe. Excel files are documented in a Microsoft publication that is now well over 1,000 pages and growing every release of Excel. Excel files are binary with variable length records (a bad situation for mainframe-to-PC transfers). A while back I estimated a good team of 4 programmers could probably develop an Excel file generator on the mainframe in about a year of analysis / coding / testing; that estimate may be low now since Microsoft keeps changing the documented formats.

Re: CSV attachment with different fonts in the File

Posted: Tue Aug 26, 2014 3:56 pm
by Anithab
Thanks Rober and others in assisting me.t!!

The requirement was changed and We just had the mail with attachment as text file .