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
 

 

Sending emails to dynamic email addresses

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Sending emails to dynamic email addresses
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

Site Director


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

PostPosted: Sat Nov 08, 2008 4:22 am    Post subject:
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    Post subject:
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: 7936
Location: Bellevue, IA

PostPosted: Mon Nov 10, 2008 9:59 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Tue Nov 11, 2008 2:52 am    Post subject:
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    Post subject:
Reply with quote

Works like a charm, thanks for all the help!
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: Tue Nov 11, 2008 3:18 am    Post subject: Reply to: Sending emails to dynamic email addresses
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    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 Dynamic array request/response contai... Suja.Sai CICS 2 Tue Jan 24, 2017 11:37 am
No new posts REXX DB2: Dynamic allocation of DB2.D... BHAS CLIST & REXX 3 Mon Dec 19, 2016 8:26 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 Reading data from PS file and send it... rajatbagga All Other Mainframe Topics 18 Fri Sep 23, 2016 12:51 pm
No new posts Creating a dynamic sort card in JCL u... ChitraChhabra DFSORT/ICETOOL 4 Wed Aug 03, 2016 6:15 pm


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