Page 1 of 1

JCL MIME email attachment filename with date

PostPosted: Tue May 03, 2011 10:32 am
by coll65
I am trying to create JCL which will send an email with an attachment. This JCL currently works and emails report to me but when run every day will clobber the previous day report. I want the atatchment name to contain a date - how do I do this?
This is my JCL so far:
//TRANSMIT EXEC PGM=IKJEFT01,DYNAMNBR=25,REGION=1280K,TIME=1
//SYSTSPRT DD SYSOUT=*
//*
//TRANSMIT DD *
helo PR.OS390.MAILSERVER
mail from:<OPDAILY@workplace.au>
rcpt to:<anne.smith@workplace.au>
data
Date: (generated by system)
From: OPDAILY@workplace.au
To: anne.smith@workplace.au
Subject: Extract Report
MIME-version: 1.0
Content-type: MULTIPART/MIXED; BOUNDARY=StartOfNextPart
--StartOfNextPart
Content-type: text/plain: charset=us-ascii

The Extract Reports are attached.
Double-click, and click on Launch button, to view in Notepad.

--StartOfNextPart
Content-type: text/plain: charset=us-ascii; name=extract.txt
Content-disposition: attachment; filename=extract.txt
// DD DSN=DEV.EXTR.REPORT.DAILY,DISP=SHR
// DD *
--StartOfNextPart

NOTE : This email is machine-generated. DO NOT REPLY.
//*
//SYSTSIN DD *
TRANSMIT PR.SMTP DDNAME(TRANSMIT) NOEPILOG NOLOG NOPROLOG
//*

Re: JCL MIME email attachment filename with date

PostPosted: Tue May 03, 2011 10:41 am
by MrSpock
Simple. Put a date on it. (What am I missing about this question?).

Re: JCL MIME email attachment filename with date

PostPosted: Tue May 03, 2011 10:44 am
by NicC
(What am I missing about this question?)

probably the fact that she wants it done automatically which would mean preprocessing the TRANSMIT DD * data through sort or another program to stick the date into extract.txt to give something like extract.20110503.txt