View previous topic :: View next topic
|
Author |
Message |
David Smith
New User
Joined: 28 Oct 2008 Posts: 9 Location: WA state
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
David Smith
New User
Joined: 28 Oct 2008 Posts: 9 Location: WA state
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
David Smith
New User
Joined: 28 Oct 2008 Posts: 9 Location: WA state
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
David Smith
New User
Joined: 28 Oct 2008 Posts: 9 Location: WA state
|
|
|
|
Works like a charm, thanks for all the help! |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
You're welcome - good to hear it is working
Thanks for letting us know
d |
|
Back to top |
|
|
|