Email w/ attachment error



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

Email w/ attachment error

Postby newjb » Sun Feb 24, 2013 7:22 pm

This is my second try at this...I am trying to setup an email that includes a text file attachment. With the attachment being a data file that I am including.


//JS40     EXEC PGM=IEBGENER
//SYSPRINT DD  SYSOUT=*
//SYSIN    DD  DUMMY
//SYSUT1   DD  *
HELO XXX.XXX.XXX
MAIL FROM:<XXXX@XXX.XXX>
RCPT TO:<XXXX@XXX.XXX>
DATA
FROM: XXXX@XXX.XXX
SUBJECT:  TEST
TO: XXXX@XXX.XXX

 DAILY UPDATES
 THIS SHOULD CONTAIN A TEXT FILE ATTACHMENT
CONTENT-TYPE: TEXT/PLAIN
CONTENT-DISPOSITION: ATTACHMENT; FILENAME=FILE.TXT
//         DD   DISP=SHR,DSN=BTEST.I.XXX.XXX.XXX.SORT
//         DD   *
.
QUIT
/*
//SYSUT2   DD  SYSOUT=(,),
//         OUTPUT=(*.OUTGRP02),
//         DEST=(XXXXXXXX,SMTP)
/*



==============================
OUTGRP02 is setup like this:

//OUTGRP02 OUTPUT CLASS=M



==============================
I keep getting this error message:

DATA SET UTILITY - GENERATE
IEB352I WARNING: ONE OR MORE OF THE OUTPUT DCB PARMS COPIED FROM INPUT,
IEB311I CONFLICTING DCB PARAMETERS,
IEB311I CONFLICTING DCB PARAMETERS,


Here are the setting of my data file:

DCB=(RECFM=FB,LRECL=180,BLKSIZE=27900),
SPACE=(TRK,(2000,2000),RLSE),
UNIT=DISK


Thank you in advance!!

One additional question about this: Is there a way to include the current date and time in either the email message or subject?
newjb
 
Posts: 20
Joined: Fri Sep 07, 2012 11:25 pm
Has thanked: 3 times
Been thanked: 0 time

Re: Email w/ attachment error

Postby Robert Sample » Sun Feb 24, 2013 9:04 pm

SYSIN files are 80 bytes. You are concatenating a 180-byte record to this, hence, the error. You need to move the SYSIN data items into PDS members or separate files that have LRECL 180 and concatenate files of equal length.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Email w/ attachment error

Postby newjb » Sun Feb 24, 2013 10:30 pm

Would you mind helping me with an example?
newjb
 
Posts: 20
Joined: Fri Sep 07, 2012 11:25 pm
Has thanked: 3 times
Been thanked: 0 time

Re: Email w/ attachment error

Postby newjb » Sun Feb 24, 2013 10:45 pm

If used a different output format other than a text file would that make a difference?
newjb
 
Posts: 20
Joined: Fri Sep 07, 2012 11:25 pm
Has thanked: 3 times
Been thanked: 0 time

Re: Email w/ attachment error

Postby BillyBoyo » Sun Feb 24, 2013 10:47 pm

//somename DD *


Wherever you see that, it is representing "card images". "Cards" or old punched-cards, which were fixed in width, 80 characters.

You have

//SYSUT1 DD *
stuff
// DD DSN=something
// DD *
other stuff


The first part of your "concatenation" is 80 bytes, then you have 180 bytes on your file, then 80 bytes again. This will not work, as you cannot mix LRECLs for fixed-length records on a concatenation.

If you take what you currently have as DD * (both of them) and put them on datasets (PS, PDS member, PDSE member) which are Fixed and have an LRECL of 180, then change your concatenation

//SYSUT1 DD DSN=new dataset with first set of data
// DD DSN=your original dataset
// DD DSN=new dataset with second set of data

Then you'll be able to concatenate the data successfully.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Email w/ attachment error

Postby newjb » Mon Feb 25, 2013 1:23 am

So....the contents of my jcl will actually be included in the 2 new data files instead of within my actual job step right? (All 180)

If I just revised my 180 file and make it 80, would my existing original code then work as is?

Thanks again!
newjb
 
Posts: 20
Joined: Fri Sep 07, 2012 11:25 pm
Has thanked: 3 times
Been thanked: 0 time

Re: Email w/ attachment error

Postby NicC » Mon Feb 25, 2013 5:06 am

Why not try?
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

Re: Email w/ attachment error

Postby Robert Sample » Mon Feb 25, 2013 7:07 pm

Have you looked at the Communications Server bookshelf to see what z/OS supports in SMTP? If not, why not? You are coming across as the rankest of rank beginners since it does not appear that you do any research on your own. Experienced professionals know how to test things on their own and see what is possible without having to be told on a forum.

For the date / time question you asked, have you tried this?
HELO XXX.XXX.XXX
MAIL FROM:<XXXX@XXX.XXX>
RCPT TO:<XXXX@XXX.XXX>
DATA
FROM: XXXX@XXX.XXX
SUBJECT:  TEST
TO: XXXX@XXX.XXX
DATE
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Email w/ attachment error

Postby newjb » Tue Mar 05, 2013 11:13 pm

You are correct... :shock: :( , I am the king of the beginners.... I have done a TON of research on my own.... it is just this is so different from PC / SQL Server development...taking some time for me even know the best places to research and even what to search for. Anyways, here is what I have figured out. This works great except for one issue. I don't know where the --SIMPLE BOUNDARY are needed. The below way will work (email is sent, w/ attachment) however, drops the first record. I've tried enclosing the --SIMPLE BOUNDARY around each section and attachment ends up being named: "ATT00001.txt" and within my attachment is all of my records (doesn't drop the first record) plus.... part of my code:
CONTENT-TYPE: TEXT/PLAIN
CONTENT-DISPOSITION: ATTACHMENT; FILENAME=DETAILS.TXT

So I am getting an actual email, w/ attachment, & almost correct data. I think if I can figure out the rules on the boundaries...I will be good?

(my attached file is now LRECL=80) Thank you again!


//JS50     EXEC PGM=IEBGENER
//SYSPRINT DD  SYSOUT=*
//SYSIN    DD  DUMMY
//SYSUT1   DD  *
HELO XXX.XXX.XXXX
MAIL FROM:<XXXX@XXX.XXXX>
RCPT TO:<XXXX@XXX.XXXX>
DATA
FROM: XXXX@XXX.XXXX
SUBJECT: XXXXXX DETAILS
TO: XXXX@XXX.XXXX
MIME-VERSION: 1.0
CONTENT-TYPE: MULTIPART/MIXED; BOUNDARY="SIMPLE BOUNDARY"

--SIMPLE BOUNDARY
CONTENT-TYPE: TEXT/PLAIN;

 XXEMAIL MESSAGE TEXTXXXXX
 XXXXXXXXXXXXXXXXXXXXXXXXXXX

--SIMPLE BOUNDARY
CONTENT-TYPE: TEXT/PLAIN
CONTENT-DISPOSITION: ATTACHMENT; FILENAME=DETAILS.TXT
//         DD   DISP=SHR,DSN=BTEST.I.XXXXX.XXXXX.UPD.SHRT
//         DD   *
.
QUIT
/*
//SYSUT2   DD  SYSOUT=(,),
//         OUTPUT=(*.OUTGRP02),
//         DEST=(XXXXXXXX,SMTP)
/*


newjb
 
Posts: 20
Joined: Fri Sep 07, 2012 11:25 pm
Has thanked: 3 times
Been thanked: 0 time

Re: Email w/ attachment error

Postby Robert Sample » Tue Mar 05, 2013 11:29 pm

Try this:
--SIMPLE BOUNDARY
CONTENT-TYPE: TEXT/PLAIN
CONTENT-DISPOSITION: ATTACHMENT; FILENAME=DETAILS.TXT

//         DD   DISP=SHR,DSN=BTEST.I.XXXXX.XXXXX.UPD.SHRT
//         DD   *
.
I don't recall seeing anything in the RFC (but I might have just missed it) but a blank line right after the CONTENT-DISPOSITION seems to get the entire attachment across.

These users thanked the author Robert Sample for the post:
newjb (Wed Mar 06, 2013 12:48 am)
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Next

Return to JCL

 


  • Related topics
    Replies
    Views
    Last post