Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
sending Mail through JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
ravikumar15

New User


Joined: 27 Mar 2006
Posts: 64

PostPosted: Thu May 04, 2006 4:10 pm    Post subject: sending Mail through JCL
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

Moderator Team Head


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

PostPosted: Thu May 04, 2006 7:15 pm    Post subject: Re: sending Mail through JCL
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: 64

PostPosted: Fri May 05, 2006 5:01 pm    Post subject:
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    Post subject:
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    Post subject:
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: 64

PostPosted: Thu Nov 02, 2006 2:03 pm    Post subject: Re: sending Mail through JCL
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    Post subject: Re: sending Mail through JCL
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: 64

PostPosted: Fri Nov 03, 2006 4:47 pm    Post subject: Re: sending Mail through JCL
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    Post subject: Re: sending Mail through JCL
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    Post subject:
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    Post subject:
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    Post subject:
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: 64

PostPosted: Tue Nov 07, 2006 12:43 pm    Post subject: Tried 'TSO SMSG SMTP STATS' command
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    Post subject:
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: 64

PostPosted: Tue Dec 11, 2007 1:00 pm    Post subject:
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    Post subject: Reply to: sending Mail through JCL
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts sending email from jcl using the mail... niloyarp JCL & VSAM 5 Tue Oct 10, 2017 12:32 pm
No new posts NDM syntax checking without actually ... GAPX1 All Other Mainframe Topics 0 Wed Jun 07, 2017 2:36 am
No new posts Mail via SMTP with an image? Mike 1304 JCL & VSAM 4 Thu Jan 26, 2017 2:01 pm
No new posts Can sending 5 MB data between cobol p... Kevin Vaz CICS 12 Tue Oct 18, 2016 4:50 pm
No new posts How to sending system service request... lind sh IMS DB/DC 5 Sun Apr 10, 2016 12:02 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us