How to use symbolic parameter (date) in EMAIL filename



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

How to use symbolic parameter (date) in EMAIL filename

Postby D9988 » Tue Feb 09, 2010 1:16 am

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'   

David
D9988
 
Posts: 34
Joined: Fri Nov 09, 2007 10:55 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How to use symbolic parameter (date) in EMAIL filename

Postby dick scherrer » Tue Feb 09, 2010 2:02 am

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?
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: How to use symbolic parameter (date) in EMAIL filename

Postby MrSpock » Tue Feb 09, 2010 2:07 am

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.
User avatar
MrSpock
Global moderator
 
Posts: 807
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 4 times

Re: How to use symbolic parameter (date) in EMAIL filename

Postby D9988 » Tue Feb 09, 2010 2:09 am

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!
David
D9988
 
Posts: 34
Joined: Fri Nov 09, 2007 10:55 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How to use symbolic parameter (date) in EMAIL filename

Postby MrSpock » Tue Feb 09, 2010 2:13 am

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.
User avatar
MrSpock
Global moderator
 
Posts: 807
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 4 times

Re: How to use symbolic parameter (date) in EMAIL filename

Postby dick scherrer » Tue Feb 09, 2010 2:50 am

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. . . :?
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: How to use symbolic parameter (date) in EMAIL filename

Postby D9988 » Tue Feb 09, 2010 4:16 am

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?
David
D9988
 
Posts: 34
Joined: Fri Nov 09, 2007 10:55 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How to use symbolic parameter (date) in EMAIL filename

Postby D9988 » Thu Apr 15, 2010 10:22 pm

I've come across this subject again :D . Any ideas on how I could get this to work?
D9988
 
Posts: 34
Joined: Fri Nov 09, 2007 10:55 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How to use symbolic parameter (date) in EMAIL filename

Postby MrSpock » Thu Apr 15, 2010 11:13 pm

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?
User avatar
MrSpock
Global moderator
 
Posts: 807
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 4 times

Re: How to use symbolic parameter (date) in EMAIL filename

Postby D9988 » Thu Apr 22, 2010 2:33 am

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!
David
D9988
 
Posts: 34
Joined: Fri Nov 09, 2007 10:55 pm
Has thanked: 0 time
Been thanked: 0 time


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post