IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

More E-mailing an Attachment from Mainframe


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
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
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=("[email protected]")               
       to=("[email protected]")                 
  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: 8700
Location: Dubuque, Iowa, USA

PostPosted: Sun Apr 25, 2010 10:21 pm
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
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 [email protected] NOMSG FILE -   
  'USERID.MYFILE1.CSV' -                                   
  FROM  [email protected] -                 
  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: 8700
Location: Dubuque, Iowa, USA

PostPosted: Mon Apr 26, 2010 9:20 pm
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: 5
Location: Walnut Creek, California, USA

PostPosted: Thu May 06, 2010 1:45 am
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
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: 6965
Location: porcelain throne

PostPosted: Fri Jun 04, 2010 2:01 am
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

Superior Member


Joined: 14 Mar 2007
Posts: 10903
Location: italy

PostPosted: Fri Jun 04, 2010 2:04 am
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

Moderator Emeritus


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

PostPosted: Fri Jun 04, 2010 2:04 am
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
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: 8700
Location: Dubuque, Iowa, USA

PostPosted: Fri Jun 04, 2010 3:18 am
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 All times are GMT + 6 Hours
Forum Index -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts Techm mainframe deveoper 6 to 12 year... Mainframe Jobs 0
No new posts Mainframe Storage Needed Mainframe Jobs 0
No new posts Email attachment from mainframe is empty PC Guides & IT News 9
No new posts Mainframe Dataset Binary or ASCII Mainframe Interview Questions 4
No new posts Need help In Mainframe Automation AF/... CLIST & REXX 14
Search our Forums:


Back to Top