Send attachement in email using CICS.

Customer Information Control System. Middleware and MQ Series.
Previous topicNext topic

Topic Author
Dino
Registered Member
Posts: 33
Joined: Tue Jun 18, 2013 12:12 am
Zodiac: Sagittarius

Send attachement in email using CICS.

Post by Dino » Thu Feb 08, 2018 6:25 pm

hi,

I know that we can send an email using mainframe in batch but can we send an email with an attachment using a CICS transaction? If we can do that, how can we do that? Please share your suggestion.



User avatar

Robert Sample
Global Moderator
Global Moderator
Posts: 1379
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
Zodiac: Virgo

Re: Send attachement in email using CICS.

Post by Robert Sample » Thu Feb 08, 2018 9:12 pm

You need a TDQ in the CICS region that points to the internal reader (or use the CICS SPOOL interface commands). Your CICS program copies the batch JCL to the spool (or TDQ) and closes it (for TDQ) or uses SPOOLCLOSE. The batch JCL includes the usual copy to SMTP with the correct format for the attachment and boundaries and the rest of the email. The batch JCL could be hard-coded in the program or it could be read from a VSAM data set. Note that the manuals indicate putting more than 1000 lines of JCL into the spool could cause performance issues for the region (which would include all other users of that region).




Topic Author
Dino
Registered Member
Posts: 33
Joined: Tue Jun 18, 2013 12:12 am
Zodiac: Sagittarius

Re: Send attachement in email using CICS.

Post by Dino » Mon Feb 12, 2018 12:13 pm

Robert Sample wrote:
Thu Feb 08, 2018 9:12 pm
You need a TDQ in the CICS region that points to the internal reader (or use the CICS SPOOL interface commands). Your CICS program copies the batch JCL to the spool (or TDQ) and closes it (for TDQ) or uses SPOOLCLOSE. The batch JCL includes the usual copy to SMTP with the correct format for the attachment and boundaries and the rest of the email. The batch JCL could be hard-coded in the program or it could be read from a VSAM data set. Note that the manuals indicate putting more than 1000 lines of JCL into the spool could cause performance issues for the region (which would include all other users of that region).
Thanks. So I shall have a COBOL CICS program having the entire JCL in it which it will copy to TDQ?



User avatar

Robert Sample
Global Moderator
Global Moderator
Posts: 1379
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
Zodiac: Virgo

Re: Send attachement in email using CICS.

Post by Robert Sample » Mon Feb 12, 2018 6:11 pm

So I shall have a COBOL CICS program having the entire JCL in it which it will copy to TDQ?
Not necessarily -- reread my response. Your COBOL program could read a VSAM data set that has the JCL stored in it and copy that JCL to the TDQ. Or, you could use the EXEC CICS SPOOLOPEN, SPOOLWRITE, SPOOLCLOSE commands from the API.



Previous topicNext topic

Return to “CICS, Middleware and MQ Series.”