|
View previous topic :: View next topic
|
| Author |
Message |
Manju_savi
New User
Joined: 19 Mar 2010 Posts: 5 Location: Bangalore
|
|
|
|
I have to send an email from JCL with an attachment. The attachment has nearly 40,000 records with record length 60.
When the mail is received, the records in the attachment will be truncated and will get maximum of 2500 records only.
So any one suggest what should be changed in the below process so that all the records can be send in the attachment?
The JCL step is as below.
| Code: |
//*****************************************************************
//* EMAIL THE EXTRACT FROM FIRST STEP TO THE CUSTOMER
//*****************************************************************
//STEP1 EXEC PGM=LINKABND,PARM=(UCANDU,12)
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=STEP1.EMAIL.CONTROL.LIB(EMAILST),
// DISP=SHR
// DD DSN=STEP1.INPUT.FILE1,DISP=SHR
//SYSUT2 DD SYSOUT=(B,SMTP)
//SYSIN DD *
COPY,ALL
//*
|
Where STEP1.INPUT.FILE1 is the file to be attached and STEP1.EMAIL.CONTROL.LIB(EMAILST)contains
Hence we zipped the input file using the below jcl steps and used the same email as above to email. We received the email and attachment as zipped file. But had problem in opening it and got the error something like “Downloaded zip file not archived properly”
| Code: |
//********************************************************************
//QD30025 EXEC PGM=PKZIP,REGION=6M
//SYSPRINT DD SYSOUT=*
//ZIPCUR DD DSN=STEP1.INPUT.FILE1,DISP=SHR
//OUTARCH DD DSN=STEP1.INPUT.FILE1.ZIP,
// DISP=(,CATLG,DELETE),
// UNIT=SCRTCH,SPACE=(TRK,(500,50),RLSE),
// DCB=(LRECL=1000,RECFM=F,BLKSIZE=22800)
//SYSIN DD *
-ECHO
-ADD -NOPATH
-ARCHOUTDD(OUTARCH)
-INDD(ZIPCUR)
//
//* |
Hence the ZIP file was then converted to BASE 64 using the below jcl step and emailed using the next step.
| Code: |
//*-----------------------------------------------------
//*ENCODE THE ZIP FILE USING THE ENBASE64 REXX EXEC
//*-----------------------------------------------------
//JVSREX01 EXEC PGM=IKJEFT01,PARM='ENBASE64'
//SYSEXEC DD DSN=TSJV.A9ZMM.SMBCR.JCLLIB,DISP=SHR
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSIN DD DUMMY
//SYSTSIN DD DUMMY
//SYSUT1 DD DSN=STEP1.INPUT.FILE1.ZIP,DISP=SHR
//SYSUT2 DD DSN=STEP1.INPUT.FILE1.BASE,
// DISP=(,PASS),UNIT=SYSDA,
// DCB=(LRECL=133,BLKSIZE=27930,RECFM=FB),
// SPACE=(CYL,(5,0),RLSE)
//***************************************************************
//*SEND THE EMAIL
//***************************************************************
//JVSREX02 EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=STEP2.EMAIL.CONTROL.LIB(emaillst1),
// DISP=SHR
// DD DSN= STEP1.INPUT.FILE1.BASE,DISP=(OLD,PASS)
// DD DSN= STEP2.EMAIL.CONTROL.LIB(emaillst2),DISP=SHR
//SYSUT2 DD SYSOUT=(B,SMTP)
//SYSIN DD DUMMY
// |
Where STEP2.EMAIL.CONTROL.LIB(emaillst1) contains
| Code: |
HELO TORGPC
MAIL FROM:<[email protected]>
RCPT TO:<[email protected]>
DATA
FROM: SMB RA - ONTARIO - JVH019
TO: [email protected]
SUBJECT: SMB RA - ONTARIO - ADHOC ORDER ACTIVITY EXTRACT
MIME-VERSION: 1.0
CONTENT-TYPE: MULTIPART/MIXED; BOUNDARY="---- =_NEXTPART_000_01BD3BAF.A7
THIS MESSAGE IS IN MIME FORMAT. SINCE YOUR MAIL READER DOES NOT UNDERSTA
THIS FORMAT, SOME OR ALL OF THIS MESSAGE MAY NOT BE LEGIBLE.
------ =_NEXTPART_000_01BD3BAF.A762FD80
CONTENT-TYPE: TEXT/PLAIN; CHARSET="US-ASCII"
CONTENT-TRANSFER-ENCODING: 7BIT
ATTACHED IS A ZIP FILE
------ =_NEXTPART_000_01BD3BAF.A762FD80
CONTENT-TYPE:APPLICATION/OCTET-STREAM; NAME=WAGNERC.ZIP
CONTENT-TRANSFER-ENCODING: BASE64
CONTENT-DISPOSITION: ATTACHMENT; FILENAME=WAGNERC.ZIP
|
And STEP2.EMAIL.CONTROL.LIB(emaillst2) contains
| Code: |
| ------ =_NEXTPART_000_01BD3BAF.A762FD80-- |
code' d and reformatted for readability |
|
| Back to top |
|
 |
Robert Sample
Global Moderator

Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
| Contact your site support group, explain the problem to them, and get their help in resolving it. When the TCP/IP stack is installed for z/OS, there is a default size limit on SMTP emails. If you have exceeded this limit, nothing you can do in your job will allow you to get around that limit -- only your site support group can change the limit, issue an OBEYFILE against TCP/IP, and allow your complete email to be sent. If the issue is something else, your site support group is again the place to start as they have the tools to diagnose the problem and help you resolve it. |
|
| Back to top |
|
 |
Manju_savi
New User
Joined: 19 Mar 2010 Posts: 5 Location: Bangalore
|
|
|
|
Thank you for guiding. But In order avoid that we ZIPed the file uisng PKZIP as below and then sent an email. But had problem in opening it and got the error something like “Downloaded zip file not archived properly”
//********************************************************************
//QD30025 EXEC PGM=PKZIP,REGION=6M
//SYSPRINT DD SYSOUT=*
//ZIPCUR DD DSN=STEP1.INPUT.FILE1,DISP=SHR
//OUTARCH DD DSN=STEP1.INPUT.FILE1.ZIP,
// DISP=(,CATLG,DELETE),
// UNIT=SCRTCH,SPACE=(TRK,(500,50),RLSE),
// DCB=(LRECL=1000,RECFM=F,BLKSIZE=22800)
//SYSIN DD *
-ECHO
-ADD -NOPATH
-ARCHOUTDD(OUTARCH)
-INDD(ZIPCUR)
//
//*
Hence the ZIP file was then converted to BASE 64 using the below jcl step and emailed using the next step. But not able to send the ZIP file properly through email.
//*-----------------------------------------------------
//*ENCODE THE ZIP FILE USING THE ENBASE64 REXX EXEC
//*-----------------------------------------------------
//JVSREX01 EXEC PGM=IKJEFT01,PARM='ENBASE64'
//SYSEXEC DD DSN=TSJV.A9ZMM.SMBCR.JCLLIB,DISP=SHR
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSIN DD DUMMY
//SYSTSIN DD DUMMY
//SYSUT1 DD DSN=STEP1.INPUT.FILE1.ZIP,DISP=SHR
//SYSUT2 DD DSN=STEP1.INPUT.FILE1.BASE,
// DISP=(,PASS),UNIT=SYSDA,
// DCB=(LRECL=133,BLKSIZE=27930,RECFM=FB),
// SPACE=(CYL,(5,0),RLSE)
//***************************************************************
//*SEND THE EMAIL
//***************************************************************
//JVSREX02 EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=STEP2.EMAIL.CONTROL.LIB(emaillst1),
// DISP=SHR
// DD DSN= STEP1.INPUT.FILE1.BASE,DISP=(OLD,PASS)
// DD DSN= STEP2.EMAIL.CONTROL.LIB(emaillst2),DISP=SHR
//SYSUT2 DD SYSOUT=(B,SMTP)
//SYSIN DD DUMMY
//
Where STEP2.EMAIL.CONTROL.LIB(emaillst1) contains
HELO TORGPC
MAIL FROM:<[email protected]>
RCPT TO:<[email protected]>
DATA
FROM: SMB RA - ONTARIO - JVH019
TO: [email protected]
SUBJECT: SMB RA - ONTARIO - ADHOC ORDER ACTIVITY EXTRACT
MIME-VERSION: 1.0
CONTENT-TYPE: MULTIPART/MIXED; BOUNDARY="---- =_NEXTPART_000_01BD3BAF.A7
THIS MESSAGE IS IN MIME FORMAT. SINCE YOUR MAIL READER DOES NOT UNDERSTA
THIS FORMAT, SOME OR ALL OF THIS MESSAGE MAY NOT BE LEGIBLE.
------ =_NEXTPART_000_01BD3BAF.A762FD80
CONTENT-TYPE: TEXT/PLAIN; CHARSET="US-ASCII"
CONTENT-TRANSFER-ENCODING: 7BIT
ATTACHED IS A ZIP FILE
------ =_NEXTPART_000_01BD3BAF.A762FD80
CONTENT-TYPE:APPLICATION/OCTET-STREAM; NAME=WAGNERC.ZIP
CONTENT-TRANSFER-ENCODING: BASE64
CONTENT-DISPOSITION: ATTACHMENT; FILENAME=WAGNERC.ZIP
And STEP2.EMAIL.CONTROL.LIB(emaillst2) contains
------ =_NEXTPART_000_01BD3BAF.A762FD80-- |
|
| Back to top |
|
 |
Manju_savi
New User
Joined: 19 Mar 2010 Posts: 5 Location: Bangalore
|
|
|
|
| So can you please send me the proper steps to email the file Ziped in mainframe through JCL? |
|
| Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Pull the file manually from the mainframe to your pc and see if it will open.
If it will not open, the problem is not the email/jcl, but rather the file itself. |
|
| Back to top |
|
 |
Manju_savi
New User
Joined: 19 Mar 2010 Posts: 5 Location: Bangalore
|
|
|
|
Yes, I pulled the Ziped file from mainframe to PC and tried opening but it gave below error message.
"End-of-central-directory signature not found. Either this file is not a Zip file, or it constitutes one disk of a multi-part Zip file"
Means in the mainframe file is not Ziped properly. Or it might ziped in EBSIDC format and in PC it is ASCI format. This could be the probelm. If yes how this can be solved. |
|
| Back to top |
|
 |
Robert Sample
Global Moderator

Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
The problem will not be that the data file is EBCDIC and the PC is ASCII -- zip file control bytes are in binary, not EBCDIC or ASCII.
Your problem indicates a PKZIP issue. Contact the vendor and get their help -- only the vendor can tell you why this problem is occurring and how to fix it. |
|
| Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
When you manually downloaded the file, hopefully BINARY was specified for the transfer . . . |
|
| Back to top |
|
 |
Manju_savi
New User
Joined: 19 Mar 2010 Posts: 5 Location: Bangalore
|
|
|
|
| Thank you for the reply, I will contact the vendor and will update here accordingly |
|
| Back to top |
|
 |
ajithajt
New User
Joined: 21 Mar 2016 Posts: 10
|
|
|
|
Hi,
I also used the same code to send a zip file as attachment in mail. When performing FTP from mainframe I am able to open the ZIP file, but when I try to open the file which I received through mail its showing the error message “This is not a valid ZIP archive”. Also the zip file should have a size of 6mb, but the file which I received through mail has only 260 B. Please help me to resolve this.
Thanks,
Ajith. |
|
| Back to top |
|
 |
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1248 Location: Richfield, MN, USA
|
|
|
|
| Did you read Robert's post on Mar 20, 2010 at 2:01 pm? |
|
| Back to top |
|
 |
Robert Sample
Global Moderator

Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
An attachment of 260 bytes indicates to me that your MIME is not working. You need to review your JCL, paying particular attention to the MIME definitions since a single byte mistake can cause the email attachment to fail. Since you didn't post any JCL there's not much we can do to help you.
And when you have an issue, start a new topic -- don't append to the end of a 6-year-old thread. |
|
| Back to top |
|
 |
ajithajt
New User
Joined: 21 Mar 2016 Posts: 10
|
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|