Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Rexx and send message to cell phone or pager

73 views
Skip to first unread message

Johnson, Daryl

unread,
Jul 25, 2002, 4:38:09 PM7/25/02
to
Has anyone seen/written a rexx routine that will send messages to a cell
phone or pager from mvs?

Thanks,

Daryl (DJ) Johnson
DBA
Work Phone: 503.813.5451
Cell Phone: 503.706.6391
Pager: 503.202.4775
Home Phone: 503.632.4719

------------------------------------------------------------------------------


This email is confidential and may be legally privileged.

It is intended solely for the addressee. Access to this email by anyone else, unless expressly approved by the sender or an authorized addressee, is unauthorized.

If you are not the intended recipient, any disclosure, copying, distribution or any action omitted or taken in reliance on it, is prohibited and may be unlawful. If you believe that you have received this email in error, please contact the sender, delete this e-mail and destroy all copies.


==============================================================================

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to LIST...@VM.MARIST.EDU with the message: INFO TSO-REXX

Steve Neeland

unread,
Jul 25, 2002, 4:56:38 PM7/25/02
to
Would Mr. Dyck's SMTP routine XMITIP do what you need? We use it to email
messages to other mail addresses all the time. If the pager or cell phone
has an email address, it would seem to me that it would accomplish what you
want. You can find the info at http://www.lbdsoftware.com/tcpip.html.

Steve

Ron MacRae

unread,
Jul 25, 2002, 5:23:22 PM7/25/02
to
"Johnson, Daryl" <Daryl....@PACIFICORP.COM> wrote in message
news:35E7A49967CD1E42BAD...@pdxexu01.pacificorp.com...

> Has anyone seen/written a rexx routine that will send messages to a cell
> phone or pager from mvs?
>
I wrote one that sends emails. My pager & phone can receive emails.
If that's any good I can send you a copy.

Ron MacRae.


Bob Richards

unread,
Jul 25, 2002, 5:57:38 PM7/25/02
to
Steve,

XMITIP will indeed do it. BTDTGTTS! :-)

Bob


=====
Bob Richards
SunTrust Bank
Atlanta, Georgia
Internet: bob.ri...@suntrust.com
richa...@yahoo.com

__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com

Robert Zenuk

unread,
Jul 25, 2002, 6:06:29 PM7/25/02
to
Basic SMTP can handle this. Most Pagers and message-capable cell phones
these days have an Internet address you can send to. Usually the format is
phone_number@pager_co.com like:

60255...@skytel.com

If you have SMTP set up on your machine this can be as simple as coding an
IEBGENER.

//JOBCARD ........
//EMAIL EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD *
HELO SYS1
MAIL FROM:<robz...@aol.com>
RCPT TO:<60255...@skytel.com>
DATA
FROM:<robz...@aol.com>
subject: Emergency!
Call the Data Center immediately 888-333-4444
QUIT
//SYSUT2 DD SYSOUT=(B,SMTP)
//SYSIN DD DUMMY

This is a very simple technique that can be incorporated in batch jobs and
REXX EXEC's. It is easily wrapped into a whole lot of administrative tools
using all the existing REXX and ISPF techniques for tons of utilities (I've
done a few of these).

In REXX you can simply EXECIO the correctly formatted SMTP message (SMTP is
documented in the IP User's Guide) from a STEM into an allocated SYSOUT using
WRITER(SMTP) to send a message from inside a REXX EXEC.

A simple, bare bones example useful in batch abends would look something like
(untested code):

/* REXX - PAGER */
parse arg oncall
mail.1 = 'HELO' MVSVAR('SYSNAME')
mail.2 = 'MAIL FROM:<robz...@aol.com>'
mail.3 = 'RCPT TO:<'oncall'>'
mail.4 = 'DATA'
mail.5 = 'FROM:<robz...@aol.com>'
mail.6 = 'Subject:' MVSVAR('SYMDEF','JOBNAME') 'failed' date() time()
mail.7 = 'Call the Data Center immediately 888-333-4444'
mail.8 = 'QUIT'
"ALLOC F(MAIL) SYSOUT(B) WRITER(SMTP)"
if RC <> 0 then say 'ALLOC error on MAIL'
"EXECIO * DISKW MAIL (STEM MAIL. FINIS"
if RC <> 0 then say 'EXECIO error on MAIL'

This would be used in a separate step of a job using JCL IF logic or COND
logic to trigger the PAGER step in the event of a problem.

// IF (ABEND) THEN
//PAGER EXEC PGM=IKJEFT01,PARM='PAGER 60255...@SKYTEL.COM'
//SYSEXEC DD DSN=your rexx.pds,DISP=SHR
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD DUMMY
// ENDIF

Hope This Helps,
Robert Zenuk
robz...@aol.com

Ben Cowan

unread,
Jul 25, 2002, 6:22:33 PM7/25/02
to
We configured sendmail for outgoing mail only.

Here's a sendmail rexx our Automation product uses when the
Operator enters: PAGE BEN

/* Rexx */
x=msg('OFF') ; trace('o')

parse upper arg sysprog


center_id = substr(mvsvar(sysname),1,2)
if (center_id == 'US') then from = 'Southern Operations'
if (center_id == 'UN') then from = 'Northern Operations'

select
when (sysprog == 'BEN') then
email = '70255...@mobile.mycingular.com'
otherwise
do
say "Nobody by the name of" sysprog
"found...."
say " "
exit 0
end
end

sendmail = 'echo "Call"' from '| /usr/local/bin/sendmail' email
BPXBATCH SH sendmail

exit 0

Johnson, Daryl

unread,
Jul 26, 2002, 10:20:10 AM7/26/02
to
Thanks for the feedback....

I have not used BPXBATCH, this should be interesting.

Thanks,

Daryl (DJ) Johnson
DBA
Work Phone: 503.813.5451
Cell Phone: 503.706.6391
Pager: 503.202.4775
Home Phone: 503.632.4719


-----Original Message-----
From: Ben Cowan [mailto:bco...@NEVADA.EDU]
Sent: Thursday, July 25, 2002 3:33 PM
To: TSO-...@VM.MARIST.EDU
Subject: Re: Rexx and send message to cell phone or
pager

<< File: ATT95414.txt >> We configured sendmail for
outgoing mail only.

parse upper arg sysprog

exit 0

------------------------------------------------------------------------------


This email is confidential and may be legally privileged.

It is intended solely for the addressee. Access to this email by anyone else, unless expressly approved by the sender or an authorized addressee, is unauthorized.

If you are not the intended recipient, any disclosure, copying, distribution or any action omitted or taken in reliance on it, is prohibited and may be unlawful. If you believe that you have received this email in error, please contact the sender, delete this e-mail and destroy all copies.


==============================================================================

----------------------------------------------------------------------

Robert Bridges

unread,
Jul 26, 2002, 2:52:51 PM7/26/02
to
Yeah, but I assume BPXBATCH or possible the SH option isn't universally available? You have to have SMTP installed on your mainframe, right?

---
Robert_...@labcorp.com, 336 436-8066, fax -0518
(Bob Bridges, rhb...@attglobal.net)

>>> Daryl....@PACIFICORP.COM 2002-07-26 10:00:01 >>>


I have not used BPXBATCH, this should be interesting.

Robert Zenuk

unread,
Jul 26, 2002, 3:44:24 PM7/26/02
to
Any recent release of OS/390 will have the BPXBATCH command available. The only issue is an OMVS segment in your security package that allows you to use it. Then, if SENDMAIL is configured, this approach will work.

I tested my sample SMTP code I sent yesterday and found a small error when you try to run it a second time (no FREE). Here are two barebones working examples of SMTP from REXX. The first one (like yesterday) can be used in batch jobs. It simply sets the subject line to the JOBNAME with a DATE and TIME and provides static text in the body. The second allows you to add your own text to the email using a static subject. These can be used with any email address (not just pagers).

/* REXX - PAGER */
parse arg oncall
mail.1 = 'HELO' MVSVAR('SYSNAME')
mail.2 = 'MAIL FROM:<robz...@aol.com>'
mail.3 = 'RCPT TO:<'oncall'>'
mail.4 = 'DATA'
mail.5 = 'FROM:<robz...@aol.com>'
mail.6 = 'Subject:' MVSVAR('SYMDEF','JOBNAME') 'failed' date() time()
mail.7 = 'Call the Data Center immediately 888-333-4444'
mail.8 = 'QUIT'
"ALLOC F(MAIL) SYSOUT(B) WRITER(SMTP)"
if RC <> 0 then say 'ALLOC error on MAIL'
"EXECIO * DISKW MAIL (STEM MAIL. FINIS"
if RC <> 0 then say 'EXECIO error on MAIL'

"FREE F(MAIL)"

/* REXX - MSG */
parse arg id msg


mail.1 = 'HELO' MVSVAR('SYSNAME')
mail.2 = 'MAIL FROM:<robz...@aol.com>'

mail.3 = 'RCPT TO:<'id'>'


mail.4 = 'DATA'
mail.5 = 'FROM:<robz...@aol.com>'

mail.6 = 'Subject: Call the Data Center: 888-333-4444'
mail.7 = msg
mail.8 = 'QUIT'
"ALLOC F(MAIL) SYSOUT(B) WRITER(SMTP) REU"


if RC <> 0 then say 'ALLOC error on MAIL'
"EXECIO * DISKW MAIL (STEM MAIL. FINIS"
if RC <> 0 then say 'EXECIO error on MAIL'

"FREE F(MAIL)"


Hope This Helps,


Rob

Robert Bridges

unread,
Jul 30, 2002, 5:07:56 PM7/30/02
to
Very cool! Is there documentation on the commands, like "HELO", "MAIL", "DATA" etc? What manual should I look in?

>>> Robz...@AOL.COM 2002-07-26 15:28:28 >>>

----------------------------------------------------------------------

Don Poitras

unread,
Jul 30, 2002, 5:31:38 PM7/30/02
to
http://www.faqs.org/rfcs/rfc821.html


Robert Bridges wrote:
>
> Very cool! Is there documentation on the commands, like "HELO", "MAIL", "DATA" etc? What manual should I look in?
>
> ---
> Robert_...@labcorp.com, 336 436-8066, fax -0518
> (Bob Bridges, rhb...@attglobal.net)

--
Don Poitras - SAS/C Development - SAS Institute Inc. - SAS Campus Drive
mailto:sas...@sas.com (919)531-5637 Fax:677-4444 Cary, NC 27513

Harrington, Mark

unread,
Jul 30, 2002, 6:33:17 PM7/30/02
to
i just tried this also. it works good !!

-----Original Message-----
From: Robert Bridges [mailto:Robert_...@LABCORP.COM]
Sent: Tuesday, July 30, 2002 11:38 AM
To: TSO-...@VM.MARIST.EDU
Subject: Rexx and send message to cell phone or pager


Very cool! Is there documentation on the commands, like "HELO", "MAIL",
"DATA" etc? What manual should I look in?

>>> Robz...@AOL.COM 2002-07-26 15:28:28 >>>

----------------------------------------------------------------------

Hobart Spitz

unread,
Jul 30, 2002, 7:21:21 PM7/30/02
to
I liked this too.

If you are looking for something less of the "roll-your-own" flavor, you
might consider the TSO command SMTPNOTE. In my current installation, I had
to search out the SMTP server to get Robert's code to work. (I was very
pleased when it did. Kudo's to Robert.)

Another advantage is that you can send to a mixture of TSO users and
internet addresses with the same command. SMTPNOTE uses XMIT and/or SMTP as
appropriate.

SMTPNOTE [ To ( recipients ) ] [ Cc ( recipients ) | NOCc ] [ Subject (
subject ) ] [ [Dataset ( data_set_name ) | Batch ] | Reuse ]

I cut and pasted the format from the manual, but it didn't maintain its
form, so I edited it. Some of the details may have gotten messed up. See
the manual for more info:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/f1a1b910/6.2?SHEL
F=EZ2MZ201&DT=20010621083253&FS=FALSE

If you are a real glutton for punishment, can read pipelines, and want to do
attachments, I posted a REXX EXEC to send STMP mail with MIME attachments
about 18 months ago on the CMS-PIPELINES list. I can't take credit for the
STMP details: I had some very gracious help. Nevertheless, it should be
enough to get attachments working. (I hope to do so if I can just find my
round tuit.)

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-...@VM.MARIST.EDU] On Behalf Of
Harrington, Mark
Sent: Tuesday, July 30, 2002 6:31 PM
To: TSO-...@VM.MARIST.EDU

Frank Clarke

unread,
Jul 30, 2002, 8:15:27 PM7/30/02
to
On 26 Jul 2002 12:44:24 -0700, Robz...@AOL.COM (Robert Zenuk) wrote:

>"EXECIO * DISKW MAIL (STEM MAIL. FINIS"

I think you will also have to set mail.0 = 8 or write it as
"EXECIO 8 DISKW MAIL (STEM MAIL. FINIS"

Karlheinz Wittemann

unread,
Jul 31, 2002, 1:49:50 AM7/31/02
to
the mail.0 is unimportend because it will not be interpreted at a diskw-operation. execio will close the file at the first unassigned stem variable.

if you do something in a loop, jest drop the stem at the beginning.

Heinz

______________________________________________________________________________
WEB.DE MyPage - Ultimatives Kommunikationstool! Ihre Message sofort
online! Domain aenderbar! http://www.das.ist.aber.ne.lustige.sache.ms/

Robert Zenuk

unread,
Jul 31, 2002, 4:25:19 AM7/31/02
to
In a message dated 07/30/2002 11:39:01 AM US Mountain Standard Time,
Robert_...@LABCORP.COM writes:


> Very cool! Is there documentation on the commands, like "HELO", "MAIL",
> "DATA" etc? What manual should I look in?

This is all in the CS IP User's Guide in Chapter 6 under Sending Electronic
Mail Using SMTP Commands.

Thanks,
Robert Zenuk

(480) 632-7230 (Home)
robz...@aol.com

Stephen E. Bacher

unread,
Jul 31, 2002, 11:30:26 AM7/31/02
to
Karlheinz Wittemann <K...@spgmbh.de> schrieb:

>> On 26 Jul 2002 12:44:24 -0700, Robz...@AOL.COM (Robert Zenuk) wrote:
>>
>> >"EXECIO * DISKW MAIL (STEM MAIL. FINIS"
>>
>> I think you will also have to set mail.0 = 8 or write it as
>> "EXECIO 8 DISKW MAIL (STEM MAIL. FINIS"

>the mail.0 is unimportend because it will not be interpreted at a


>diskw-operation. execio will close the file at the first unassigned
>stem variable.

True - actually, it stops writing at the first stem variable which has
a null string as a value. But you may not want to allow that to
happen, for obvious reasons. Therefore, the best approach is to
set mail.0 and code:

"EXECIO" mail.0 "DISKW MAIL (STEM MAIL. FINIS"

or do it Robert's way as above - but you will have to capture the
total number of lines somehow, rather than hard-coding it.

If you are writing from the data stack rather than from a stem
variable, you could code:

"EXECIO" queued() "DISKW MAIL (FINIS"

The number of lines written, in this case, is implicitly defined by
the number of data lines queued.

- seb

Robert Zenuk

unread,
Aug 2, 2002, 4:25:35 PM8/2/02
to
In a message dated 07/30/2002 5:43:51 PM US Mountain Standard Time,
ni...@MINDSPRING.COM writes:


> I think you will also have to set mail.0 = 8 or write it as
> "EXECIO 8 DISKW MAIL (STEM MAIL. FINIS"

I used to always put the total lines in the stem.0 variable during EXECIO *
DISKW commands. Just recently, I discovered (by accident) this is not needed
if your stems are all consecutive numbers. I found this made my maintenance
issues a little easier so I have stopped coding the stem.0 on EXECIO *
DISKW...

Thanks,
Robert Zenuk

robz...@aol.com

0 new messages