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

I have generated a report using REXX and want to send the


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rahulbank

New User


Joined: 25 Sep 2008
Posts: 66
Location: Bengaluruuuuuu

PostPosted: Wed Dec 10, 2008 6:05 pm
Reply with quote

1. I have generated a report using REXX and want to send the same as an attachment via email. ALso I have many reports so I want to zip amd send them through rexx. Can someone show me the program. I searched the same in the forum but was unsuccessful.
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Wed Dec 10, 2008 6:19 pm
Reply with quote

What program are you looking for?

I found a few topics which may be relevant:

www.ibmmainframes.com/viewtopic.php?t=12103&highlight=smtp
www.ibmmainframes.com/viewtopic.php?t=17773&highlight=pkzip
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: Wed Dec 10, 2008 6:19 pm
Reply with quote

Mainframe zip packages are not free -- you'll have to find out if there is one available already or not; if not it'll cost your organization. Unix System Services supports tarballs, pax files, and gzip/gunzip can be installed -- but none of them is an exact replacement for a zip program.

I don't know enough about REXX and emails to advise you on sending it as an attachment.
Back to top
View user's profile Send private message
rahulbank

New User


Joined: 25 Sep 2008
Posts: 66
Location: Bengaluruuuuuu

PostPosted: Wed Dec 10, 2008 6:47 pm
Reply with quote

I am looking for SMTP to send mails as an attchement.
Back to top
View user's profile Send private message
rahulbank

New User


Joined: 25 Sep 2008
Posts: 66
Location: Bengaluruuuuuu

PostPosted: Wed Dec 10, 2008 6:55 pm
Reply with quote

I mean I want to use SMTP code to send attchments in mails.....
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: Wed Dec 10, 2008 7:01 pm
Reply with quote

Code:
HELO <domain.name>
MAIL FROM: <domain.name>
RCPT TO: <user.name@domain.com>
DATA
FROM:    anything
TO:       ROBERT SAMPLE
SUBJECT:  TEST ATTACHMENT
MIME-VERSION: 1.0
CONTENT-TYPE: TEXT/PLAIN
CONTENT-DISPOSITION: ATTACHMENT; FILENAME=FILE.TXT
//       DD DSN=TTSSRS0.JCL.CNTL(EMAILATT),DISP=SHR
//       DD DSN=TTSSRS0.JCL.CNTL(EMAILAT),DISP=OLD
will send a text attachment -- the contents of file TTSSRS0.JCL.CNTL member EMAILATT. The EMAILAT member contains the trailing period required by SMTP.

How to do this in REXX, however, is not a question I can answer.
Back to top
View user's profile Send private message
rahulbank

New User


Joined: 25 Sep 2008
Posts: 66
Location: Bengaluruuuuuu

PostPosted: Wed Dec 10, 2008 7:25 pm
Reply with quote

The EMAILAT member contains the trailing period required by SMTP.


How do I do that?


How to do this in REXX, however, is not a question I can answer.

Actually I thought SMTP is to do with rexx. I do not know abt rexx and so asked this question.
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Wed Dec 10, 2008 7:34 pm
Reply with quote

First, you can generate JCL from within REXX, as in the following example:
Code:
QUEUE  "//"USERID()"ML JOB (23610,0,0668),'MAIL',MSGCLASS=X,        "   
QUEUE  "//    MSGLEVEL=(1,1),CLASS=S                                "   
QUEUE  "//*                                                         "   
QUEUE  "//SMTPSEND EXEC PGM=IEBGENER                                "   
QUEUE  "//SYSPRINT   DD SYSOUT=S                                    "   
QUEUE  "//SYSOUT     DD SYSOUT=S                                    "   
QUEUE  "//SYSIN      DD DUMMY                                       "   
QUEUE  "//SYSUT2     DD SYSOUT=(B,SMTPSERV)                         "   
QUEUE  "//SYSUT1     DD *                                           "   
QUEUE  "HELO AFLMVS                                                 "   
QUEUE  "MAIL FROM:<MOSTEAM@MOSTEAM.COM>                             "   
QUEUE  "RCPT TO:<"TOADDR">                                          "   
QUEUE  "DATA                                                        "   
QUEUE  "SUBJECT: Job failed                                         "   
QUEUE  JOBID "failed                                                "   
QUEUE  MESSAGE                                                         
QUEUE  "END OF MAIL                                                 "   
QUEUE  "/*                                                          "   
QUEUE  "//                                                          "   
                                                                       
QUEUE                                                                   
"SUBMIT *"                                                             


At the other hand, you can invoke IEBGENER directly from within REXX, as in the following example:
Code:
ADDRESS TSO "EXECIO * DISKR SORTOUT (STEM JOBS. FINIS"               
ADDRESS TSO "FREE FI(SYSIN SYSPRINT)"                                 
                                                                     
QUEUE "helo MVSHOST"                                                 
QUEUE "mail from:<MVSUser@MVSHost.xyz.com>"                           
QUEUE "rcpt to:<ofer.f@mosteam.com>"                                 
QUEUE "data"                                                         
QUEUE "From:     MVSUser@MVSHost.xyz.com"                             
QUEUE "To:       ofer.f@mosteam.com"                                 
QUEUE "Subject:  Test message from MVS using SMTP                    "
QUEUE " "                                                             
QUEUE "This is a line in the body of the note."                       
                                                                     
DO MM = 1 TO JOBS.0                                                   
  QUEUE JOBS.MM                                                       
END MM                                                               
                                                                     
ADDRESS TSO "ALLOC F(SYSUT1) TRACKS SPACE(5) REU"                     
ADDRESS TSO "ALLOC F(SYSIN) DUMMY"                                   
ADDRESS TSO "ALLOC F(SYSPRINT) DA(*)"                                 
ADDRESS TSO "ALLOC F(SYSUT2) SYSOUT(B) WRITER(SMTP) REU"             
                                                                     
ADDRESS TSO "EXECIO" QUEUED()" DISKW SYSUT1 (FINIS"                   
                                                                     
ADDRESS ISPEXEC "SELECT PGM(IEBGENER)"                               
                                                                     


O.
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: Wed Dec 10, 2008 8:19 pm
Reply with quote

SMTP is Simple Mail Transfer Protocol. It is a standard for sending emails across the Internet. It has absolutely nothing to do with REXX, which is a programming / scripting language used on multiple platforms. REXX can be used to send mail via SMTP but REXX is also used for many other things which have nothing to do with SMTP -- and IEBGENER can be used to send an SMTP email without anything to do with REXX.

Google RFC 2821 and RFC 2822 to find out about SMTP -- one of the requirements is that email data lines must end with a period on a line by itself. If it doesn't, you don't get mail sent.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


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

PostPosted: Tue Dec 30, 2008 2:18 pm
Reply with quote

Was searching for an online method of invoking SMTP.
Found the exact answer here... icon_biggrin.gif
Many thanks for Ofer71
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 -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
Search our Forums:

Back to Top