How to use symbolic parameter (date) in EMAIL filename
Posted:
Tue Feb 09, 2010 1:16 am
by D9988
Hello. I am trying to add the date variable to the filename of Email attachment.
I am able to add date variables to the subject of my email. When I try this with the filename, it actually displays the text "&DATE" instead of the date.
Can someone please help with the syntax required to add the date to a filename? Here is the JCL:
//TJOB01 EXEC PGM=IKJEFT1B,COND=(0,NE)
//SYSEXEC DD DSN=T.CLIST,DISP=SHR
//SYSPRINT DD SYSOUT=(,)
//SYSTSPRT DD SYSOUT=(,)
//EMAILFLE DD DSN=RPT.OUTPUT(+0),
// DISP=SHR
//EMAILMSG DD *
/*
//SYSTSIN DD *
%XMITIP 'TEST'<TEST@TEST.COM> -
FROM 'TEST'<TEST@TEST.COM> -
REPLYTO 'TEST '<TEST@TEST.COM> -
FILEDD EMAILFLE -
FILENAME &UDATE-TEST.XLS -
FORMAT XLS -
MSGDD EMAILMSG -
SUBJECT 'TEST REPORT &DATE'
Re: How to use symbolic parameter (date) in EMAIL filename
Posted:
Tue Feb 09, 2010 2:02 am
by dick scherrer
Hello,
Is &UDATE a typo?
Is your release of XMITIP current or is this possibly an old copy that does not have the needed functionality?
Re: How to use symbolic parameter (date) in EMAIL filename
Posted:
Tue Feb 09, 2010 2:07 am
by MrSpock
I was perusing a copy I have of the XMITIP User's Guide, and it shows the date variable &UDATE (date as mmddyy) and it's supposed to be valid for the FILENAME keyword.
Re: How to use symbolic parameter (date) in EMAIL filename
Posted:
Tue Feb 09, 2010 2:09 am
by D9988
The guide says it's possible to use symbolic parameters for filenames. In one of the JCL examples, it shows the filename as I have used it below. I have tried &DATE and other parameters too. It's possible that maybe I do have an older version of XMITIP that doesn't support this. Adding the date is not critical, I just thought it would be nice to include it. I will try some other parameters to see if they work. If not, I think I will just leave the date out. Thanks for both of your input!
Re: How to use symbolic parameter (date) in EMAIL filename
Posted:
Tue Feb 09, 2010 2:13 am
by MrSpock
D9988 wrote:I will try some other parameters to see if they work. If not, I think I will just leave the date out. Thanks for both of your input!
Or try some other way. You could certainly build the single record " FILENAME mmddyy-TEST.XLS - " in a utility/program step, with the value for &UDATE provided, and pass it to this job step.
Re: How to use symbolic parameter (date) in EMAIL filename
Posted:
Tue Feb 09, 2010 2:50 am
by dick scherrer
Hello,
I was perusing a copy I have of the XMITIP User's Guide, and it shows the date variable &UDATE (date as mmddyy) and it's supposed to be valid for the FILENAME keyword.
There's one of my "new things" for today
Thanks!
Seems like there are quite a few folks who get/have current XMITIP documentation but the current code is not installed. . . Bummer. . .
Re: How to use symbolic parameter (date) in EMAIL filename
Posted:
Tue Feb 09, 2010 4:16 am
by D9988
Thanks again. I tried to do it the alternate way - to pass the filename from an earlier step.
In my natural program, I added the write of a 2nd work file, which I write date + filename + ".XLS" to (compressed leaving no space) ). I gave the workfile the following attributes:
DD DSN=&&TEMP1,
DISP=(NEW,PASS),
SPACE=(TRK,(5,5),RLSE),
DCB=(RECFM=FB,BLKSIZE=0,LRECL=55)
In my email step, I try to reference it like this:
FILENAME &&TEMP1 -
I also tried many variations similar to:
FILENAME DD DSN=&&TEMP1,
DISP=SHR -
But when I run it I get a return code of 4, and the SYSTSPRT indicates "INVALID COMMAND NAME SYNTAX". Any ideas?
Re: How to use symbolic parameter (date) in EMAIL filename
Posted:
Thu Apr 15, 2010 10:22 pm
by D9988
I've come across this subject again
. Any ideas on how I could get this to work?
Re: How to use symbolic parameter (date) in EMAIL filename
Posted:
Thu Apr 15, 2010 11:13 pm
by MrSpock
MrSpock wrote:Or try some other way. You could certainly build the single record " FILENAME mmddyy-TEST.XLS - " in a utility/program step, with the value for mmddyy provided, and pass it to this job step.
Did you ever try my suggestion, or update your XMITIP product?
Re: How to use symbolic parameter (date) in EMAIL filename
Posted:
Thu Apr 22, 2010 2:33 am
by D9988
Sorry for the late reply. I tried your suggestion today and got it to work that way. I used a program step to write out all the SYSTSIN info to a dataset (TEST.EMAIL.DATA).
The dataset looks like this:
-IPT- VIEW TEST.EMAIL.DATA
Command ===>
****** ***************************** Top of Data ******
000001 %XMITIP 'DK'<TEST@TEST.COM> -
000002 FROM 'TEST'<TEST@TEST.COM> -
000003 SUBJECT 'TEST REPORT &DATE' - (symbolic parameters work for Subject)
000004 MSGDD EMAILMSG -
000005 FILEDD EMAILFLE -
000006 FILENAME TEST-20100421.XLS - (this is where I inserted the date)
000007 FORMAT XLS
Then, I referenced it in my email JCL step:
//SYSTSIN DD DSN=TEST.EMAIL.DATA(+1),
// DISP=SHR
//EMAILFLE DD DSN=TEST.RPT.DATA(+1),
// DISP=SHR
//EMAILMSG DD DSN=TEST.EMAIL.MSG.DATA(+1),
// DISP=SHR
Thanks for the help!