Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

More E-mailing an Attachment from Mainframe

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics
View previous topic :: :: View next topic  
Author Message
surya4ug

New User


Joined: 08 Jul 2008
Posts: 62
Location: chennai

PostPosted: Sun Apr 25, 2010 9:48 pm    Post subject: Reply to: E-mailing an Attachment from Mainframe
Reply with quote

Hello, I was looking at E-mailing an Attachment from Mainframe....

I'm using SAS to send CSV attachments from mainframe. However, looks like there is a size limitation for the attachments to be sent.

The following piece of code is working fine with input file of 10 recs and 1000 LRECL ( I'm assuming that min 1000 is needed as LRECL, as is the case for HTML attachments ). I actually need to send about 100K records in 2 attachments ( combined size - approx ).

Please let me know if i can add anything else to the existing code to make this happen. Or, if i can ZIP the existing CSV mainframe file and email it.


Code:
//STEP03 EXEC SASMSTR,REGION=32K,WORK='2000,1000'                       
//FT11F001 DD  SYSOUT=*                 SAS LOG                         
//FT12F001 DD  SYSOUT=*                 SAS PRINT                       
//FT13F001 DD  SYSOUT=*                 SAS PUNCH                       
//REPORT1 DD DSN=USERID.MYFILE1.CSV,DISP=SHR                   
//REPORT2 DD DSN=USERID.MYFILE2.CSV,DISP=SHR                   
//SYSIN DD *                                                           
  %LET MAILFILE1 = %SYSFUNC(PATHNAME(REPORT1));                         
  %LET MAILFILE2 = %SYSFUNC(PATHNAME(REPORT2));                         
  DATA _NULL_;                                                         
  CALL SYMPUT("FDATE",LEFT(PUT("&SYSDATE"D-1,WORDDATE.)));             
  FILENAME LNOTE EMAIL                                                 
       from=("username@domain.com")               
       to=("username@domain.com")                 
  SUBJECT ="EWR REPORT - &SYSDATE"                                     
  ATTACH =                                                             
  ("&MAILFILE1" EXTENSION='CSV' TYPE='TEXT/CSV' NAME="REPORT1"         
   "&MAILFILE2" EXTENSION='CSV' TYPE='TEXT/CSV' NAME="REPORT2");       
  DATA _NULL_;                                                         
  FILE LNOTE ;   



Snapshot of my input file ( only 3 fields shown )
--------------------------------------------------------
Code:

ID            ,    FIRST NAME        ,     LAST NAME     


11111111111   ,    AAAAAA            ,     BBBBBB
22222222222   ,    CCCCCC            ,     DDDDDD
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8118
Location: East Dubuque, Illinois, USA

PostPosted: Sun Apr 25, 2010 10:21 pm    Post subject:
Reply with quote

Quote:
Please let me know if i can add anything else to the existing code to make this happen.
You can contact your site support group and work with them to get the email size limit in the TCP/IP configuration file increased (if they will do so). If they will not increase the email size limit, then there is no way to accomplish what you want to do.

And if you Google RFC 2822 you will find that an email cannot exceed 1000 bytes per line (998 without the carriage return and line feed required at the end of the line); 1000 is not the minimum size.
Back to top
View user's profile Send private message
surya4ug

New User


Joined: 08 Jul 2008
Posts: 62
Location: chennai

PostPosted: Mon Apr 26, 2010 9:13 pm    Post subject: Reply to: More E-mailing an Attachment from Mainframe
Reply with quote

Hmm......i was told that the email can't be delivered if the attachment size exceeds 10MB....

Can't we zip it and send? i have seen some code snippets online for zipping a file..... but i'm not able to send the attachment as such. also, i don't know what should be provided in the SYSEXEC.

Please suggest...

Code:
//PSTP070  EXEC PGM=IKJEFT1B,                                       
//         DYNAMNBR=25                                             
//*-----------------------------------------------------------------
   
//SYSEXEC  DD DISP=SHR,DSN=???
//SYSPRINT DD SYSOUT=*                                             
//SYSTSPRT DD SYSOUT=*                                             
//SYSTSIN DD *                                                     
//SYSIN    DD *                                                     
  %XMITIP username@domain.com NOMSG FILE -   
  'USERID.MYFILE1.CSV' -                                   
  FROM  username@domain.com -                 
  SUBJECT 'CSV TEST FILE' FORMAT TXT -                             
  FILENAME REPORT.CSV                                               
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8118
Location: East Dubuque, Illinois, USA

PostPosted: Mon Apr 26, 2010 9:20 pm    Post subject:
Reply with quote

Quote:
Can't we zip it and send?
That would depend upon whether or not your site has a ZIP product available. Mainframe zip packages are from independent software vendors and tend to run thousands of dollars -- so not all mainframes have zip available.

If the file can be processed under Unix System Services, gzip would be an option (assuming your site has installed it). Gzip is an Open Source implementation of a zip package but again must be installed at your site before you could use it.
Back to top
View user's profile Send private message
lbdyck

New User


Joined: 02 Jun 2003
Posts: 4
Location: Walnut Creek, California, USA

PostPosted: Thu May 06, 2010 1:45 am    Post subject: Zip Attachments with XMITIP
Reply with quote

The XMITIP package ships with a copy of the z/OS version of InfoZip so if you don't have a commercial package you can use that. Then FORMAT ZIPCSV or ZIP... should work for you. The InfoZip is useful but a commercial package will do more for you.
Back to top
View user's profile Send private message
surya4ug

New User


Joined: 08 Jul 2008
Posts: 62
Location: chennai

PostPosted: Fri Jun 04, 2010 1:50 am    Post subject: Reply to: More E-mailing an Attachment from Mainframe
Reply with quote

Hello,

Returning back to this post after a while....

With your help, i was able to format mainframe files with comma delimiters , zipped and sent them as email attachements.

If i have multiple mainframe files that i want to send in just one CSV attachment with the data of each of the files in different tabs which we could name , is there a way to do it?

The reason i ask this is, i have about 20 files that emerge out of a monsterous comparison process . They have customer data mismatches that are needed to be addressed in different ways. i don't want to send 20 zipped attachments and confuse the receivers icon_smile.gif
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Fri Jun 04, 2010 2:01 am    Post subject:
Reply with quote

Quote:
different tabs which we could name


tabs? what are you talking about?
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10274
Location: italy

PostPosted: Fri Jun 04, 2010 2:04 am    Post subject: Reply to: More E-mailing an Attachment from Mainframe
Reply with quote

excel tabs !

why not look at an exec sheet exported as a CSV to see how the different tabs are separated and stored?
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Jun 04, 2010 2:04 am    Post subject:
Reply with quote

Hello,

You could send one delimited file with "tabs" between the logical files (vertical rather than horizontal). The 20 files would be "stacked" in the same file to be zipped/downloaded. If any of the files are empty, just send the "tab" so that the relative file numbers stay consistent.

The recipient could then copy/paste as needed from the "whole" file into custom worksheets on the pc. . .
Back to top
View user's profile Send private message
surya4ug

New User


Joined: 08 Jul 2008
Posts: 62
Location: chennai

PostPosted: Fri Jun 04, 2010 2:04 am    Post subject:
Reply with quote

Sure..will try
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8118
Location: East Dubuque, Illinois, USA

PostPosted: Fri Jun 04, 2010 3:18 am    Post subject:
Reply with quote

When I save an Excel spreadsheet as a .csv file, I get a message that explicitly tells me only one tab (worksheet) of the spreadsheet can be saved in a file that has comma delimited format. Hopefully, that is enough of a clue for you to answer your own question.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Mainframe Opening in Chennai ( 2 to 4... muralikrishnan_new Mainframe Jobs 0 Tue Jul 18, 2017 2:20 pm
No new posts Identify top 30 big tables or indexes... ashek15 DB2 0 Fri Jun 16, 2017 10:01 am
No new posts SNMP trap from Mainframe bipinpeter Compuware & Other Tools 6 Wed Apr 26, 2017 3:05 pm
This topic is locked: you cannot edit posts or make replies. Mainframe Opening in Allianz India- T... Rajesh Gopinathan Mainframe Jobs 0 Wed Apr 19, 2017 11:33 am
No new posts FTP from Mainframe to Unix - with CRLF vasanthz All Other Mainframe Topics 7 Thu Mar 23, 2017 5:12 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us