I have searched the forum and tried more options and code than I could explain.
I was finally successful in getting an attachment but it is empty.
here is my JCL:
//EMAIL9 EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
//SYSUT2 DD SYSOUT=(B,SMTP),DCB=(RECFM=FB,LRECL=110,BLKSIZE=110)
//SYSUT1 DD DISP=SHR,DSN=DB2011.DAXXJ09D.EMAIL.HEADER
// DD DISP=SHR,DSN=DB2011.DAXXJ09D.DYWK.GRAPHS
// DD DISP=SHR,DSN=DB2011.DAXXJ09D.DYWK.REPORT
// DD DISP=SHR,DSN=DB2011.DAXXJ09D.EMAIL.ATTATCH
// DD DISP=SHR,DSN=DB2011.DAXXJ09D.DYWK.REPCSV
// DD DISP=SHR,DSN=DB2011.DAXXJ09D.EMAIL.FOOTER
all datasets match lrecl & blksz so the email is successful
here are the contents of HEADER - masks are ##
HELO ##
MAIL FROM:<MF_MAIL@##>
RCPT TO:<FNTSDBSUPPORT@##>
DATA
TO: "## yesterday Db2 Stats"
FROM: SMTP@##
SUBJECT: Db2 Yesterday's I/O, CPU & SQL Stats
MIME-VERSION: 1.0
CONTENT-TYPE: MULTIPART/MIXED; BOUNDARY="@NextSection"
--@NextSection
CONTENT-TYPE: text/plain;
REPCSV does have data in it and another 13 lines below this snippet:
BEGDATE,AVG_IOSEC,CPU_SQL,ELAP_SQL,SQLCNT,ELAPHR,CPUHR,IOCNT,IOSEC,PFETCH
2024-03-12,0.000254943, 0.000034, 0.000078, 635322985, 13.730507, 6.047882, 70105869, 17873,18707580
FOOTER:
--@NextSection
.
QUIT
The email gets to me and has two attachments - both empty and I have exhausted all I know, so I hope someone can spot my mistake.
TIA
I have searched the forum and tried more options and code than I could explain.
I was finally successful in getting an attachment but it is empty.
here is my JCL:
@sergeyken
I absolutely took your advice and used SYSUT2 output for further testing but everything looked perfect until I later found the article from IBM which said you need a blank line after the content headers.