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

Email Through Mainframe


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
gneelu

New User


Joined: 26 May 2006
Posts: 18

PostPosted: Thu Jul 16, 2009 4:46 pm
Reply with quote

//* SEND THE REPORT USING SMTP
//STEP01 EXEC PGM=IEBGENER
//SYSUT1 DD *
HELO HR
MAIL FROM: <TEST@BT.COM>
RCPT TO: <TEST@BT.COM>
DATA
SUBJECT: TEST SPREADSHEET
MIME-VERSION: 1.0
CONTENT-DISPOSITION: ATTACHMENT;FILENAME="TEST.XLS"
CONTENT-TYPE: TEXT/PLAIN
/*
//* =========================================================*
//* FILE TO SEND:
// DD DISP=SHR,DSN=NWC.EMAIL.TEST1(EMAIL)
//* =========================================================*
// DD *
.
QUIT
//SYSUT2 DD SYSOUT=(B,SMTP),DEST=(RNE)
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
//*

The above code is working fine for record length 80 and FB.
PDS - NWC.EMAIL.TEST1(EMAIL) is having record length 80 and FB.

Could anyone suggest the code for FILE TO SEND for record length greater than 80?

I have tried changing the file attributes and submitted the job.But its giving error 'IEB352I WARNING: ONE OR MORE OF THE OUTPUT DCB PARMS COPIED FROM INPUT'
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Jul 16, 2009 5:08 pm
Reply with quote

Create a file of the length desired (no more than 1000 LRECL per the RFC standard). Copy everything between the //SYSUT1 DD * and the /* into this file. Change the //SYSUT1 DD * to point to the file you created. You will need another file for everything between the // DD * and the //SYSUT2 statement, and change this JCL to point to this trailer. The two files you create must have matching LRECL to your NWC.EMAIL.TEST file -- and to repeat myself, the LRECL cannot exceed 1000.

Your JCL should look like
Code:
//* SEND THE REPORT USING SMTP
//STEP01 EXEC PGM=IEBGENER
//SYSUT1 DD DISP=SHR,DSN=<new.header.file.name>
//* =========================================================*
//* FILE TO SEND:
// DD DISP=SHR,DSN=NWC.EMAIL.TEST1(EMAIL)
//* =========================================================*
// DD DISP=SHR,DSN=<new.trailer.file.name>
//SYSUT2 DD SYSOUT=(B,SMTP),DEST=(RNE)
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
//*
Back to top
View user's profile Send private message
apvardhini

New User


Joined: 23 Apr 2009
Posts: 20
Location: India

PostPosted: Thu Jul 16, 2009 5:10 pm
Reply with quote

How can we send a report from MAinframe to mobile/Blackberry? What should be used in the place of the TO field?

Thanks,
Parvatha
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Jul 16, 2009 5:45 pm
Reply with quote

Generally the Blackberry is linked to an email account. Send the email to that account and the Blackberry should receive it just like any other email. If the Blackberry isn't linked to an email account, I don't think the mainframe can send to it.
Back to top
View user's profile Send private message
gneelu

New User


Joined: 26 May 2006
Posts: 18

PostPosted: Thu Jul 16, 2009 5:46 pm
Reply with quote

Hi Robert,

I have done the changes as your have suggested.And ran the fine.It went fine.But not getting the email.I not able to see the reason for the same.

Do you have any idea on this please i.e., shall we need to change in anything in CONTENT-TYPE: etc….

As I said earlier,it worked for recoed length 80 and got the email.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Jul 16, 2009 5:54 pm
Reply with quote

If you have access, pull up the SMTP started task log and look for any errors that popped up. If you don't have access, or don't see any errors related to your email, you'll need to contact your site support group and have them work with you to trace the email from the mainframe to the mail server to the email account. One other thing to do is to verify your trailer file has the period on a line by itself before the QUIT statement. If that period is missing the email is discarded as incomplete.

Depending on what your site support group finds, they may need to turn on the SMTP tracing function and have you resubmit your email to get the more detailed diagnostics that SMTP can generate.

One more thing to consider is that not all emails are received immediately after being sent. When I was working with IBM's Domino support group, for example, their local Lotus Notes accounts were set up to only pull email from the server every 15 minutes or so -- which meant it could be 15 minutes after the email was sent before they'd see it in their inbox.
Back to top
View user's profile Send private message
gneelu

New User


Joined: 26 May 2006
Posts: 18

PostPosted: Fri Jul 17, 2009 10:29 am
Reply with quote

Hi Robert,
Many thanks for your clarification.
I have again submitted the job and job got failed and Iam not getting the attachment. Also I have given all the code which I have used.
Could you please have a look and advice to get the attachemnt?

//* SEND THE REPORT USING SMTP
//STEP01 EXEC PGM=IEBGENER
//SYSUT1 DD DISP=SHR,DSN=NWC.DEVDAT2.CYRVRT01.SYSUT3
// DD DISP=SHR,DSN=NWC.EMAIL.TEST(EMAIL3)
// DD DISP=SHR,DSN=NWC.DEVDAT2.CYRVRT01.SYSUT4
//SYSUT2 DD SYSOUT=(B,SMTP),DEST=(RNE)
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
//*

content of dataset- NWC.DEVDAT2.CYRVRT01.SYSUT3
HELO HR
MAIL FROM: <TEST@BT.COM>
RCPT TO: <TEST@BT.COM>
DATA
SUBJECT: TEST
MIME-VERSION: 1.0
CONTENT-DISPOSITION:ATTACHMENT;FILENAME="TEST.TXT"
CONTENT-TYPE: TEXT/PLAIN

content of PDS - NWC.EMAIL.TEST(EMAIL3)
TEST FOR ATTACHMENT

content of dataset- NWC.DEVDAT2.CYRVRT01.SYSUT4
.
QUIT

All the above dataset are having same file attributes as below.
Record format . . . : FBM
Record length . . . : 133
Block size . . . . : 27930

Job got failed and Iam not getting the attachment.
But got the mail with below info(only) in the body of the mail.

S
MIME-VERSION: 1.0
C
C
T
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri Jul 17, 2009 2:52 pm
Reply with quote

Try changing the file from FBM to FB. The M has to do with carriage control characters and could adversely impact the message.
Back to top
View user's profile Send private message
gneelu

New User


Joined: 26 May 2006
Posts: 18

PostPosted: Fri Jul 17, 2009 5:19 pm
Reply with quote

Hi Robert,
I have changed the file to FB.It worked.
Thanks for your support.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri Jul 17, 2009 5:51 pm
Reply with quote

Glad to hear it worked.
Back to top
View user's profile Send private message
ananth86

New User


Joined: 10 Jun 2009
Posts: 59
Location: Hyderabad

PostPosted: Tue Jul 21, 2009 9:53 pm
Reply with quote

Code:

//ASGMAP1 JOB NOTIFY=&SYSUID       
//STEP01 EXEC PGM=IEBGENER         
//SYSUT1 DD *                     
HELO GSEM                         
MAIL FROM: <ananth@gmail.com> 
RCPT TO: <padmanabha@yahoo.com>   
DATA                               
SUBJECT: TEST SPREADSHEET         
HI                                 
HELLO                             
ANANTH                             
/*                                 
//SYSUT2 DD SYSOUT=(B,SMTP)       
//SYSOUT DD SYSOUT=*               
//SYSPRINT DD SYSOUT=*             
//SYSIN DD DUMMY   
               



This is the code its running fine. But the email is not sent to the recpt.

And one more thing, How to find the host name? I ve given the system Id here.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Jul 21, 2009 10:41 pm
Reply with quote

You'll need to talk to your site support group. The name of the host depends upon what was set in the TCP/IP configuration file during system set up; we cannot tell you what it is as the name is specific to the site. And the (B,SMTP) is also site specific -- the B could be some other writer class (we use 9 here, for example) and SMTP is the name of the SMTP started task -- again, something which you must get from your site support group as the started task name can be changed during site set up.

Finally, even if (B,SMTP) is valid at your site -- your email does not conform to the IETF RFC specifications for email and will not ever, under any circumstances, be delivered. Specifically, you must have a line with a period by itself at the end of the email or the email is discarded as incomplete. You do not have a line with a period, so it's no surprise that your email is not going out.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Wed Jul 22, 2009 3:38 am
Reply with quote

Quote:
How can we send a report from MAinframe to mobile/Blackberry?


Hi,

There are bulk email sending websites.(like 3000 sms per month)

Try to google'ing "bulk sms with ftp india"


You can use mainframe FTP to transmit the desired report to the web FTP address(to which you have registered) and the web service provider will deliver the report to destination phones.

They charge something around 3-6$/month.

Hope this was helpful
icon_biggrin.gif

Thanks & Regards,
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Wed Jul 22, 2009 7:53 am
Reply with quote

Whew, safely past the century mark. . . icon_wink.gif

d
Back to top
View user's profile Send private message
ananth86

New User


Joined: 10 Jun 2009
Posts: 59
Location: Hyderabad

PostPosted: Wed Jul 22, 2009 1:18 pm
Reply with quote

Thanks for the info Robert.

I ll try and get back to u.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Wed Jul 22, 2009 1:56 pm
Reply with quote

Quote:
Whew, safely past the century mark. . .


Really felt like a debut cricketer going past his century.. icon_biggrin.gif

Quote:
Joined: 23 Nov 2006
Posts: 11570
Location: 221 B Baker St


If my posts occupy 1 TRKs your posts would occupy a DASD icon_biggrin.gif

Keep going D

Thanks & Regards,
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Mainframe openings in Techmahnidra fo... Mainframe Jobs 0
No new posts Mainframe Programmer with CICS Skill... Mainframe Jobs 0
No new posts How to Reformat a file using File Man... All Other Mainframe Topics 14
No new posts NDM getting stuck - mainframe/JCL All Other Mainframe Topics 13
Search our Forums:

Back to Top