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

Sending emails to dynamic email addresses


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

New User


Joined: 28 Oct 2008
Posts: 9
Location: WA state

PostPosted: Sat Nov 08, 2008 3:57 am
Reply with quote

I searched around but have not found an answer to my question. I am used to creating jobs that send emails to specific pre-defined email addresses. For example:
Code:

000007 //TESTJOB EXEC PGM=IKJEFT1B,COND=(0,NE)                   
000008 //SYSEXEC   DD DSN=MISC.LIST,DISP=SHR             
000009 //SYSPRINT  DD SYSOUT=(,)                                 
000010 //SYSTSPRT  DD SYSOUT=(,)                                 
000011 //EMAILFLE  DD DSN=TEST.RPT,         
000012 //          DISP=SHR                                       
000013 //EMAILMSG  DD *                                           
000014 /*                                                         
000015 //SYSTSIN   DD *                                           
000016 %XMITIP     ( 'J SMITH'<JS@EMAIL.COM> -         
000017                 'N SMITH'<NS@EMAIL.COM> -       
000018                 'C SMITH'<CS@EMAIL.COM>) -     
000019    FROM     'TEST JOB' <TEST@EMAIL.COM>       -
000020    REPLYTO  'IS'<HELP@IS.COM>  -
000021    FILEDD   EMAILFLE      -                               
000022    FILENAME TEST-REPORT.TXT -           
000023    FORMAT   XLS           -                               
000024    MSGDD    EMAILMSG      -     
000025    SUBJECT  'DAILY REPORT '
000026 //*                                                     
                       


I've been asked to send emails dynamically, depending on who requested the report. I've tried utilizing a Natural program to look up and compress the 'TO' email addresses and write them to a temp workfile. For example:
Code:

000016 //CMWKF01    DD DSN=&&TEMP,             
000017 //           DISP=(NEW,PASS,DELETE),     
000018 //           SPACE=(TRK,(5,5),RLSE),     
000019 //           DCB=(RECFM=FB,BLKSIZE=0),   
000020 //           UNIT=SYSDA                 


The workfile would contain the email addresses:

( 'J SMITH'<JS@EMAIL.COM> -
'N SMITH'<NS@EMAIL.COM> -
'C SMITH'<CS@EMAIL.COM>) -

Then in the %XMITIP line I substitute the &&TEMP for the addresses:
Code:

000016 %XMITIP    DD DSN=&&TEMP -   

I'm getting an error indicating my %XMITIP syntax is incorrect. I've tried several variations of the syntax with no luck.

Is it possible to do what I'm attempting? If so can anyone give me some tips to get it working correctly? Thanks for your time.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Sat Nov 08, 2008 4:22 am
Reply with quote

Hello David and welcome to the forum,

The way you have done this is to try to resolve a dd statement in the middle of instream data. The system does not support this (nothing to do with XMITIP).

Suggest you put all of the XMITIP statements into the file and run from there.
Back to top
View user's profile Send private message
David Smith

New User


Joined: 28 Oct 2008
Posts: 9
Location: WA state

PostPosted: Mon Nov 10, 2008 9:38 pm
Reply with quote

Thanks for the welcome. I've tried adding all the statements to the temp file, and referring to the temp file after %XMITIP. I still get a syntax error. What format should it be in? I've tried many variations including the following:

%XMITIP FILE DSN=&&TEMP
%XMITIP DSN=&&TEMP
%XMITIP &&TEMP
%XMITIP &&TEMPDD
%XMITIP *
%XMITIP DD *
%XMITIP FILE * &&TEMP
%XMITIP * DSN=&&TEMP
%XMITIP * &&TEMP
%XMITIP * DD DSN=&&TEMP
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: Mon Nov 10, 2008 9:59 pm
Reply with quote

To reiterate:
Quote:
The way you have done this is to try to resolve a dd statement in the middle of instream data. The system does not support this (nothing to do with XMITIP).
All of your listed attempts try to use this method, which is not supported by the system.

What you need to do is to generate a file that contains
Code:
 %XMITIP     ( 'J SMITH'<JS@EMAIL.COM> -         
                 'N SMITH'<NS@EMAIL.COM> -       
                'C SMITH'<CS@EMAIL.COM>) -     
    FROM     'TEST JOB' <TEST@EMAIL.COM>       -
    REPLYTO  'IS'<HELP@IS.COM>  -
    FILEDD   EMAILFLE      -                               
    FILENAME TEST-REPORT.TXT -           
    FORMAT   XLS           -                               
    MSGDD    EMAILMSG      -     
    SUBJECT  'DAILY REPORT '
and use that file as input. Your attempts to pass just the email addresses to XMITIP are doomed to failure, no matter what you try. You must pass the entire XMITIP data stream as one unit so all the commands must be in the file.
Back to top
View user's profile Send private message
David Smith

New User


Joined: 28 Oct 2008
Posts: 9
Location: WA state

PostPosted: Tue Nov 11, 2008 2:30 am
Reply with quote

Thanks I appreciate the feedback. I moved all the XMITIP data to the work file. Where do I reference the &&TEMP file? The SYSTSIN? Or do I need to add an addtional line(s) to accomplish this?

Can you give me an example of the syntax to use to reference my XMITIP data?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Tue Nov 11, 2008 2:52 am
Reply with quote

Hello,

You should be able to use the &&TEMP file as the SYSTSIN data:
Code:
//SYSTSIN   DD DSN=&&TEMP,DISP=(OLD,DELETE)

If you have any attribute problems, specify lrecl=80 and blksize=80 when the file is created. It may work with blksize=0, but if it doesn't, try the 80.

Someone will be here if there are questions/problems.
Back to top
View user's profile Send private message
David Smith

New User


Joined: 28 Oct 2008
Posts: 9
Location: WA state

PostPosted: Tue Nov 11, 2008 3:14 am
Reply with quote

Works like a charm, thanks for all the help!
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Tue Nov 11, 2008 3:18 am
Reply with quote

You're welcome - good to hear it is working icon_smile.gif

Thanks for letting us know icon_wink.gif

d
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 Using Dynamic file handler in the Fil... COBOL Programming 2
No new posts JCL Dynamic System Symbols JCL & VSAM 3
No new posts Synctool-dynamic split job for varyin... JCL & VSAM 7
No new posts REXX to send an email in Mainframe wi... CLIST & REXX 3
No new posts REXX to send an email in Mainframe CLIST & REXX 4
Search our Forums:

Back to Top