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

sending Mail through JCL


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

New User


Joined: 27 Mar 2006
Posts: 68

PostPosted: Thu May 04, 2006 4:10 pm
Reply with quote

Code:
             
//*                                                             
//STEP01   EXEC PGM=IEBGENER                                     
//SYSIN    DD DUMMY                                             
//*SYSUT1   DD DISP=SHR,DSN=XXXX.JCL(HEADER)                   
//*         DD DISP=SHR,DSN=XXXX.JCL(BODY)                     
//SYSUT1   DD *                                                 
HELO N01A                                                       
MAIL FROM:<ABC@YAHOO.COM>                                 
RCPT TO:<XYZ@YAHOO.COM>                                   
DATA                                                             
FROM:<ABC@YAHOO.COM>                                     
TO:<XYZ@YAHOO.COM>                                       
SUBJECT:   MAIL                                                 
THIS IS A TEST MAIL SENT FROM MAINFRAME.
RAVI.                                                         
/*                                                               
//SYSUT2   DD SYSOUT=(B,SMTP)
//SYSPRINT DD SYSOUT=*       
//SYSOUT   DD SYSOUT=*       
//*                         


I am using the above JCL to send mail from JCL, but i am not getting the mail. Does this depend on configuration or is there any alternate way to send mail from JCL. If this JCL is not correct pls send me the corrected one.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Thu May 04, 2006 7:15 pm
Reply with quote

Are you following the guidelines as described here and here?

If so, then you should probably contact your Systems Programmers and have them review your code.
Back to top
View user's profile Send private message
ravikumar15

New User


Joined: 27 Mar 2006
Posts: 68

PostPosted: Fri May 05, 2006 5:01 pm
Reply with quote

I changed the node to our subsystem node, then also i am not receiving the mail from the mainframe. Does the sysout class matter. Should it be changed.
Back to top
View user's profile Send private message
hariavinash

New User


Joined: 04 Jan 2006
Posts: 64

PostPosted: Fri May 05, 2006 5:46 pm
Reply with quote

Your SMTP port MUST be opened to do this. If this is not enabled you will nto get anything out of the job you are submitting. talk to your systems guys.
Back to top
View user's profile Send private message
windozer

New User


Joined: 12 Feb 2006
Posts: 8

PostPosted: Mon Oct 30, 2006 8:05 pm
Reply with quote

The record length must be 80.. may be check it out as

//sysut2 dd sysout=(b,smtp),dcb=(recfm=f,lrecl=80) and give it a try. it works for me
Back to top
View user's profile Send private message
ravikumar15

New User


Joined: 27 Mar 2006
Posts: 68

PostPosted: Thu Nov 02, 2006 2:03 pm
Reply with quote

I tried by giving lrecl=80. It didnt work for me.
Back to top
View user's profile Send private message
windozer

New User


Joined: 12 Feb 2006
Posts: 8

PostPosted: Thu Nov 02, 2006 10:05 pm
Reply with quote

for me it worked in JCl whenever the indd has LRECL 80. Otherwise try Xmitting the file. For me it worked when i issued

XMIT node.smtp DA('you dataset here')

replace node with your LPAR name
Back to top
View user's profile Send private message
ravikumar15

New User


Joined: 27 Mar 2006
Posts: 68

PostPosted: Fri Nov 03, 2006 4:47 pm
Reply with quote

Hi,


Where should we use XMIT command. Can we use that in the JCL. Please can you explain me the syntax of using this command and how to see our LPAR name.

Thanks,
Back to top
View user's profile Send private message
windozer

New User


Joined: 12 Feb 2006
Posts: 8

PostPosted: Fri Nov 03, 2006 6:00 pm
Reply with quote

You can test it by issuing the command in TSO command entry panel.

It is ususally at option 6 unless you shop has customizd the ISR primary panel. If you want to find the LPAR name you can check it in SDSF.

The Second word on the top line is usually the NODE name.

Cya0
Back to top
View user's profile Send private message
nagasri83

New User


Joined: 20 May 2005
Posts: 15
Location: chennai

PostPosted: Sat Nov 04, 2006 1:22 pm
Reply with quote

Will the IEBGENER utility supports triggering a mail? i dont think this will work. Generally you can use FTP utility.

Correct me if i am wrong anywhere.

Thanks
Srinivas B
Back to top
View user's profile Send private message
windozer

New User


Joined: 12 Feb 2006
Posts: 8

PostPosted: Sat Nov 04, 2006 1:33 pm
Reply with quote

IEBGENER per se does not have anything to do with trigerring the mail.

It just copies from SYSUT1 to SYSUT2. we redirect the sysut2 card to the SMTP writer while specifing

//SYSUT2 DD SYSOUT=(B,SMTP)

actually smtp should be the name of the SMTP writer runnind at your shop. It usually is SMTP.
Back to top
View user's profile Send private message
windozer

New User


Joined: 12 Feb 2006
Posts: 8

PostPosted: Sat Nov 04, 2006 1:36 pm
Reply with quote

one more thing to note is them SMTP cannot pickup the files from spool if thy are of spanned record types.

@ravi

can you open the tso command screen and issue the command

TSO SMSG SMTP STATS

it will give some stats. hope this helps.

Cya0
Back to top
View user's profile Send private message
ravikumar15

New User


Joined: 27 Mar 2006
Posts: 68

PostPosted: Tue Nov 07, 2006 12:43 pm
Reply with quote

Hi Windozer,


I tried the command mentioned by you to see the statistics of SMTP. I got the following message.


Msg from SMTP: * Last Up Time: Sun, 29 Oct 06 00:50:41 PDT
Msg from SMTP: * Statistics : 11/06 11/05 11/04 11/03
Msg from SMTP: * From TCP : 0 0 0 0
Msg from SMTP: * From Spool : 9 4 1 5
Msg from SMTP: * BSMTP Logs : 0 0 0 0
Msg from SMTP: * Error Mail : 0 1 0 2
Msg from SMTP: * To Local : 0 0 0 0
Msg from SMTP: * To RSCS : 0 0 0 0
Msg from SMTP: * To TCP : 13 5 1 8
Msg from SMTP: * Passive Opns : 0 0 0 0
Msg from SMTP: * Active Opens : 8 5 1 7

In this, the Error Mail is showing 1 and two. that means, the mail was not delivered due to some error? Can we know y it was not delivered. Y the BSMTP log is all zeros. Can you briefly explain the different messages which we get by this command.

Sorry to disturb you with my doubts.


Thank you very much.
Back to top
View user's profile Send private message
windozer

New User


Joined: 12 Feb 2006
Posts: 8

PostPosted: Thu Nov 09, 2006 11:05 pm
Reply with quote

actually reading from that, each column represents the date. It is showing us the stats for the last 4 days.

If you have enough permisions..

In SDSF lookout for the job named SMTP. its owner is also SMTP. If you can try opening it. in that the LOG and other datasets might have some more information about the errors. It helped me.

You are welcome to ask more questions. In fact i just figured it out just a few weeks ago to make the darn thing work. If you can PM me your mail ID i can send you the actual SMTP Dataset that worked for me.
Back to top
View user's profile Send private message
ravikumar15

New User


Joined: 27 Mar 2006
Posts: 68

PostPosted: Tue Dec 11, 2007 1:00 pm
Reply with quote

I am using the same jcl. If I pass the data instream, its delivering the mail. If I replace that with the control card (XXX.JCL(header) and XXX.JCL(body)), the mail is not delivered. Its giving the following error.

501 Syntax Error. No Args after 'DATA' command.

Please let me know if there is any problem.
Back to top
View user's profile Send private message
abhishek dadhichi

New User


Joined: 19 Apr 2007
Posts: 37
Location: Bangalore

PostPosted: Wed Dec 12, 2007 10:59 am
Reply with quote

Hi Ravi,

You can try the Below code :

//XMITNO EXEC PGM=IKJEFT1B
//SYSEXEC DD DISP=SHR,DSN=DATASET--->This should have the XMITIP logic.
//SYSPRINT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD DSN=DATASET1(MEMBER1),DISP=SHR--->This member should contain %XMITIP (YOUR ID) -
MSGDD MESGTEXT -
FROM YOUR ID -
REPLYTO YOUR ID -

// DD DSN=DATASET2(MEMBER2),DISP=SHR----> This member should contain the subject of your mail.
//MESGTEXT DD DUMMY
//*

Just try to include the above step in your JCL and check.
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 mail attachment with excel format All Other Mainframe Topics 2
No new posts Problem while sending special charact... JCL & VSAM 4
No new posts How to append Previous date into a S... JCL & VSAM 2
No new posts Pack to Unpack conversion for sending... COBOL Programming 13
No new posts Unable to send mail via CSSMTP to GMA... JCL & VSAM 2
Search our Forums:

Back to Top