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
//*