JCL MIME email attachment filename with date



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

JCL MIME email attachment filename with date

Postby coll65 » Tue May 03, 2011 10:32 am

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
//*
coll65
 
Posts: 1
Joined: Tue May 03, 2011 10:20 am
Has thanked: 0 time
Been thanked: 0 time

Re: JCL MIME email attachment filename with date

Postby MrSpock » Tue May 03, 2011 10:41 am

Simple. Put a date on it. (What am I missing about this question?).
User avatar
MrSpock
Global moderator
 
Posts: 809
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 4 times

Re: JCL MIME email attachment filename with date

Postby NicC » Tue May 03, 2011 10:44 am

(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
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post