getting wrong data in the attachments



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

getting wrong data in the attachments

Postby HolaDVinchi » Wed Jun 19, 2019 3:43 pm

Hi,

I am trying to send two attachments using the below JCL, i'm able to get the attachments but i'm not getting correct data in the attachmnets . I'm getting DD statement of data files in the attachmnets instead of data from data files .


//MAILPROC EXEC PGM=IEBGENER
//SYSABEND DD SYSOUT=*
//SYSTOTAL DD SYSOUT=*
//SYSLIST DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUT2 DD SYSOUT=(B,SMTP)
//SYSIN DD DUMMY
//SYSUT1 DD DISP=SHR,DSN=MAIL.TEST(CTL.CARD)


contents of CTL.CARD

HELO MAINFRAME.XXX.COM
MAIL FROM: <MAINFRAME@XXX.COM>
RCPT TO: <HOLADVINCHI@XXX.COM>
DATA
TO: <HOLADVINCHI@XXX.COM>
SUBJECT: TEST ATTACHMENT
MIME-VERSION: 1.0
CONTENT-TYPE: MULTIPART/MIXED; BOUNDARY="SIMPLE BOUNDARY"
--SIMPLE BOUNDARY
CONTENT-TYPE: TEXT/PLAIN
CONTENT-DISPOSITION: INLINE

mail body

CONTENT-TYPE: TEXT/PLAIN
CONTENT-DISPOSITION: ATTACHMENT; FILENAME=FILE1.CSV

// DD DISP=SHR,DSN=MAIL.TEST(DATA1)
// DD *
--SIMPLE BOUNDARY
CONTENT-TYPE: TEXT/PLAIN
CONTENT-DISPOSITION: ATTACHMENT; FILENAME=FILE2.CSV

// DD DISP=SHR,DSN=MAIL.TEST(DATA2)
// DD *
--SIMPLE BOUNDARY--
// DD DISP=SHR,DSN=MAIL.TEST(QUIT)



contents of DATA1

123456789146521541,ZENNY,HOLA,1234566788999

instead of getting the output as
123456789146521541 ZENNY HOLA 1234566788999

i'm getting output as
// DD DISP=SHR DSN=MAIL.TEST(DATA1)
// DD *


Please help me to get the correct data.

Thanks in advance,
Hola
HolaDVinchi
 
Posts: 3
Joined: Wed Jun 19, 2019 12:36 pm
Has thanked: 0 time
Been thanked: 0 time

Re: getting wrong data in the attachments

Postby Robert Sample » Wed Jun 19, 2019 6:33 pm

Try this:
//MAILPROC EXEC PGM=IEBGENER
//SYSABEND DD SYSOUT=*
//SYSTOTAL DD SYSOUT=*
//SYSLIST DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUT2 DD SYSOUT=(B,SMTP)
//SYSIN DD DUMMY
//SYSUT1 DD DISP=SHR,DSN=MAIL.TEST(CTLCARD)
// DD DISP=SHR,DSN=MAIL.TEST(DATA1)
// DD *
--SIMPLE BOUNDARY
CONTENT-TYPE: TEXT/PLAIN
CONTENT-DISPOSITION: ATTACHMENT; FILENAME=FILE2.CSV

// DD DISP=SHR,DSN=MAIL.TEST(DATA2)
// DD *
--SIMPLE BOUNDARY--
// DD DISP=SHR,DSN=MAIL.TEST(QUIT)

 
where MAIL.TEST(CTLCARD) contains
HELO MAINFRAME.XXX.COM
MAIL FROM: <MAINFRAME@XXX.COM>
RCPT TO: <HOLADVINCHI@XXX.COM>
DATA
TO: <HOLADVINCHI@XXX.COM>
SUBJECT: TEST ATTACHMENT
MIME-VERSION: 1.0
CONTENT-TYPE: MULTIPART/MIXED; BOUNDARY="SIMPLE BOUNDARY"
--SIMPLE BOUNDARY
CONTENT-TYPE: TEXT/PLAIN
CONTENT-DISPOSITION: INLINE

mail body

CONTENT-TYPE: TEXT/PLAIN
CONTENT-DISPOSITION: ATTACHMENT; FILENAME=FILE1.CSV

 
And post exact code, please (using the CODE tag since spaces can be significant here) -- do NOT paraphrase what you're doing in your post since most people do not realize how sensitive SMTP with attachments is to the precise characters coded. And I know you've paraphrased because CTL.CARD is not a valid member name for a PDS, yet that is what your post has. Since you included JCL in your CTL.CARD (sic) member, that JCL is what became your attachment.

Fortunately, this type of issue won't stay around much longer (hopefully). IBM stopped releasing and supporting SMTP as of the 2.2 version of z/OS. Starting from z/OS 2.3, you MUST use CSSMTP instead of SMTP. I have not investigated CSSMTP enough to know how it handles attachments as my site is still running 2.2 (although we're starting to install 2.3).
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: getting wrong data in the attachments

Postby HolaDVinchi » Thu Jun 20, 2019 10:33 am

Thanks Robert for the quick reponse. I'll try this code. Hope this will solve my issue.

Thanks,
Hola
HolaDVinchi
 
Posts: 3
Joined: Wed Jun 19, 2019 12:36 pm
Has thanked: 0 time
Been thanked: 0 time


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post