Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

REXX for sending e-mail

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
Ivan P

New User


Joined: 08 Jun 2009
Posts: 63
Location: Europe

PostPosted: Mon Feb 08, 2010 8:26 pm    Post subject: REXX for sending e-mail
Reply with quote

Hello icon_smile.gif

I'm looking for a way to make a REXX program, which would take 2 variables (from a system command), and use them for sending an e-mail.

My current idea is to make REXX dynamically generate and submit a job (which contains another REXX for sending e-mails - XMITIP)
Better ideas are welcome. icon_smile.gif

Job template:
Code:

//SEND    EXEC  PGM=IKJEFT1B,DYNAMNBR=200
//STEPLIB   DD  DISP=SHR,DSN=XMITIP.LOAD
//SYSEXEC   DD  DISP=SHR,DSN=XMITIP.EXEC
//SYSTCPD   DD  DISP=SHR,DSN=TCPIP.PARMLIB(TCPDATA)
//SYSTSPRT  DD  SYSOUT=*
//SYSTSIN   DD  *
XMITIP (somemail@host.net) -
   SUBJECT 'Test - &VAR1.' -
   FROM zOS@host.net -
   MSGT 'Test - &VAR2.'


I need help with the REXX code which would receive variables and use them to generate the JCL.
Back to top
View user's profile Send private message

superk

Moderator Team Head


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

PostPosted: Mon Feb 08, 2010 9:05 pm    Post subject: Re: REXX for sending e-mail
Reply with quote

Ivan P wrote:
I need help with the REXX code which would receive variables and use them to generate the JCL.


OK, but you haven't provided any details for that code yet. What problem(s) are you encountering? What help do you need?
Back to top
View user's profile Send private message
Pedro

Senior Member


Joined: 01 Sep 2006
Posts: 2051
Location: Silicon Valley

PostPosted: Mon Feb 08, 2010 10:39 pm    Post subject: Reply to: REXX for sending e-mail
Reply with quote

What would your 'XMITIP' program do that the first rexx program cannot do?
Back to top
View user's profile Send private message
superk

Moderator Team Head


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

PostPosted: Mon Feb 08, 2010 11:32 pm    Post subject: Reply to: REXX for sending e-mail
Reply with quote

This seems to be a continuation of this topic:

http://www.ibmmainframes.com/viewtopic.php?t=46381

of which I admit I was pretty much lost towards the end. It almost seems as if the OP is referring to SysREXX, or a proprietary console automation product REXX, but I don't know.
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Mon Feb 08, 2010 11:59 pm    Post subject:
Reply with quote

Hello,

Quote:
of which I admit I was pretty much lost towards the end
Yup, methinks several of us are. . . icon_smile.gif

Possibly because the actual requirement has not yet been been posted, but rather multiple "solution attempts" that have problems have been posted.

It appears as with many of these topics, the TS has chosen the "solution" and is trying to make it fit the "requirement".

I also don't buy in to the concept that proper information cannot be posted due to "security". What ever the secure information, we don't need it. . . We do need proper information (substituted for the "secure" info) that properly describes the requirement.
Back to top
View user's profile Send private message
Ivan P

New User


Joined: 08 Jun 2009
Posts: 63
Location: Europe

PostPosted: Tue Feb 09, 2010 2:22 pm    Post subject: Re: Reply to: REXX for sending e-mail
Reply with quote

superk wrote:
of which I admit I was pretty much lost towards the end.
icon_rolleyes.gif icon_smile.gif
Better don't take that topic into consideration here.

superk wrote:
OK, but you haven't provided any details for that code yet. What problem(s) are you encountering? What help do you need?
I thought someone would maybe post a "hello world" example which could be used in this case..
(or refer to a book with a "hello w." example)
Anyway, here's what I have so far..

Code:
PARSE ARG var1 var2

ADDRESS ISPEXEC "LIBDEF ISPSLIB DATASET ID()"
ADDRESS ISPEXEC "LIBDEF ISPSLIB DATASET ID('MY.DATASET')" STACK

"FREE  FI(ISPFILE)"
"DEL  'TEMP.ISPFILE'"
"ALLOC FI(ISPFILE) DA('TEMP.ISPFILE') NEW TRACKS SPACE(10 10)
       RECFM(F B) LRECL(80)"
"ISPEXEC FTOPEN"
"ISPEXEC FTINCL TEMPLATE"
"ISPEXEC FTCLOSE"
"SUBMIT 'TEMP.ISPFILE'"
"FREE  FI(ISPFILE)"
"DEL  'TEMP.ISPFILE'"
EXIT

Logic is pretty simple - use the template job to fill in the variables and submit it.. I need help with making the above code work.
MY.DATASET(TEMPLATE) - contains the template job posted earlier.

Pedro wrote:
What would your 'XMITIP' program do that the first rexx program cannot do?
Send an e-mail..
More on XMITIP - here.

dick scherrer wrote:
We do need proper information (substituted for the "secure" info) that properly describes the requirement.
Agreed.
Requirement behind this is simple - call a simple REXX program with a console command and send it 2 variables.
If this isn't possible or similar please correct me.

dick scherrer wrote:
It appears as with many of these topics, the TS has chosen the "solution" and is trying to make it fit the "requirement".
Sorry, TS?
This is the best solution I can come up with at this moment. I'm sure there are far better solutions, but they're out of the scope of my knowledge now. I would gladly embrace them, but with a proper explanation.

I'm a newbie, so please bear with me. icon_axe.gif
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10274
Location: italy

PostPosted: Tue Feb 09, 2010 2:29 pm    Post subject: Reply to: REXX for sending e-mail
Reply with quote

Quote:
call a simple REXX program with a console command

if the requirement isn' t a continuation of the other topic , then tell the difference!
Quote:
Better don't take that topic into consideration here.

so why do You resurrect the issue?

TS ==> Topic Starter

to make code work You need to tell what issues You have.
the request as posted has the same value as ... write the code for me!

as far as the hallo world here it is ... icon_evil.gif
Code:
/* rexx */
say "Hallo world from Rexx!"
exit
Back to top
View user's profile Send private message
Ivan P

New User


Joined: 08 Jun 2009
Posts: 63
Location: Europe

PostPosted: Tue Feb 09, 2010 3:53 pm    Post subject: Re: Reply to: REXX for sending e-mail
Reply with quote

enrico-sorichetti wrote:
if the requirement isn' t a continuation of the other topic , then tell the difference!

Logical requirement is, implementation of it isn't.
It's a simple REXX script here, there was an attempt to do it with a job and starting a task..
It turned out that it's not possible that way:
enrico-sorichetti wrote:
You cannot do it!
variable substitution takes place only on the jcl statements, not on the data statements

Also...
enrico-sorichetti wrote:
do not use it, submit a job, maybe writing a REXX script to build the eMail content
Isn't a REXX script to build the e-mail content what this topic is about?

enrico-sorichetti wrote:
to make code work You need to tell what issues You have.
the request as posted has the same value as ... write the code for me!
The script is rather simple, I'm looking for comments/suggestions. I doubt it will work the way it is posted previously.
I'm not expecting that someone writes the code for me, but another example of a similar script would be very useful.

enrico-sorichetti wrote:
as far as the hallo world here it is ... icon_evil.gif
353.gif --> I'm under the impression You don't like when unexperienced people post/ask here.. Wouldn't it be simpler to make a sticky/rule/policy - "Post here only if you know: ........."?
It would keep the smile on Your and others faces... imho.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10274
Location: italy

PostPosted: Tue Feb 09, 2010 4:02 pm    Post subject: Reply to: REXX for sending e-mail
Reply with quote

what happened when You tried to run the rexx You posted ?
please tell, and we can start from there!

I did the searching on Your behalf, and here are some hints of file tailoring
http://ibmmainframes.com/viewtopic.php?t=25499
http://ibmmainframes.com/viewtopic.php?t=25810
http://ibmmainframes.com/viewtopic.php?t=42154

also a simple forum search with FTOPEN would have given lots of samples!

also here a different approach withou the need for the ispf environment
http://ibmmainframes.com/viewtopic.php?t=24978&highlight=rexx+queue
( my code snippet was TESTED )

by the way You remark is <choose a derogatory adjective of Your liking>
I have replied to lots of people withe less experience than Yours,
the only difference which made me willing to help was a much better attitude!

Yo asked for a hallo thing.. that what you got, no reason at all to complain!
if You/Your organization are not satisfied with the no charge consultancy You get here,
well... that's Your problem!
Back to top
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 401
Location: Mumbai

PostPosted: Tue Feb 09, 2010 8:50 pm    Post subject:
Reply with quote

Not sure why you want to do this with a batch job. Why not just call XMITIP directly from TSO? IKJEFT01 is TSO so if you are in TSO you are already running IKJEFT01. If you don't have XMITIP.LOAD in your load module search order then you can use LIBDEF ISPLLIB and call the command with an ISPEXEC SELECT CMD(...) ... command which will establish a tasklib environment so that the load module is found. if the EXEC is not in your SYSPROC or SYSEXEC dd names, you can call it with the EXEC command from TSO (there is no LIBDEF for SYSPROC or SYSEXEC, though there is an ALTLIB command in TSO - not recommended within ISPF though).See the ISPF books for details on LIBDEF and SELECT.
Back to top
View user's profile Send private message
Ivan P

New User


Joined: 08 Jun 2009
Posts: 63
Location: Europe

PostPosted: Fri Feb 12, 2010 9:04 pm    Post subject: Re: Reply to: REXX for sending e-mail
Reply with quote

superk wrote:
It almost seems as if the OP is referring to SysREXX, or a proprietary console automation product REXX, but I don't know.
SysREXX was what I needed, but I wasn't aware of how it functions..
If someone is reading this with a similar problem and needs SysREXX:
* make sure there's an "AXR" started task
* place your REXX in (by default) SYS1.SAXREXEC
and then you can call your REXX with a system command:
F AXR,REXXNAME

enrico-sorichetti wrote:
I did the searching on Your behalf, and here are some hints of file tailoring
Thank You for searching on My behalf. icon_smile.gif

enrico-sorichetti wrote:
I feel in a very very good mood today,
here is a WORKING and when I say WORKING it means that I have tested it,
solution ( just sketched )
This was nice of You in that topic. I wish You more very very good mood days. icon_rolleyes.gif

enrico-sorichetti wrote:
by the way You remark is <choose a derogatory adjective of Your liking>
I have replied to lots of people withe less experience than Yours,
the only difference which made me willing to help was a much better attitude!
My remark wasn't written with degradation in mind, rather to remind you that this is only textual communication, where the other side can't detect emotions involved or a intention of sarcastic humour.
If You look at Your posts, objectly, they are far more derogatory to people You reply to, than my remark.
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 -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts REXX to get the all datasets name parasmalik20 CLIST & REXX 5 Tue Jul 18, 2017 9:10 pm
No new posts How system know which REXX to excute? jackzhang75 CLIST & REXX 14 Thu Jul 06, 2017 1:09 am
No new posts REXX - Dynamic file Creation d_sarlie CLIST & REXX 7 Tue Jun 27, 2017 7:30 pm
No new posts REXX WTO for console message bipinpeter CLIST & REXX 6 Tue Jun 27, 2017 3:56 pm
No new posts Convert CLIST to REXX cvnlynn CLIST & REXX 12 Tue Jun 27, 2017 2:06 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us