IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

email attachment with Unicode Text


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Amrish Raje

New User


Joined: 21 Mar 2013
Posts: 3
Location: India

PostPosted: Thu Mar 21, 2013 4:49 pm
Reply with quote

Hello, I have a requirement to send a notification email which may have unicode content. e.g. Country name like México - please note the accent over 'e'.

The country names are stored in a DB2 table in Unicode. Cobol is also equipped to handle unicode characters. I am creating an email with the Unicode message as an attachment. The email is getting generated with an *.RTF attachment. However, when I open the attachment the unicode based text becomes garbled. I have tried using every avaialble encoding option in word to open the attachmemnt but I always see garbage.

I am using IEBGENER to create email with attachment. I have tried out every possible option of content type, charset and content transfer encoding to no avail. Please help...

JCL:

//JS020 EXEC PGM=IEBGENER
//SYSIN DD DUMMY
//SYSPRINT DD SYSOUT=*
//SYSUT2 DD SYSOUT=(M,SMTP)
//*
//SYSUT1 DD DSN=xxxx.EMAIL.INITIAL,
// DISP=SHR
// DD DSN=xxxx.EMAIL.TEXT1,
// DISP=SHR
//*

xxxx.EMAIL.INITIAL contains:

HELO ADC1
MAIL FROM: <ABCD@XXXX.COM>
RCPT TO: <ABCD@XXXX.COM>
DATA
TO: <ABCD@XXXX.COM>
SUBJECT: TEST : TEST FILE
MIME-VERSION: 1.0
CONTENT-TYPE: MULTIPART/MIXED;CHARSET=UTF-8
CONTENT-TRANSFER-ENCODING: 7BIT
CONTENT-DISPOSITION: ATTACHMENT;FILENAME=TEST.RTF

xxxx.EMAIL.TEXT1 contains

Hello This is Amrish
<== Line in unicode containing word "México"
I work for ABC INC
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Thu Mar 21, 2013 5:19 pm
Reply with quote

Did you look at the file on whatever other platform you're sending it to with a hex editor?

Seems like a problem with the crapware of MacroShaft, and has abso-flucking-ly nothing to do with JCL.
Back to top
View user's profile Send private message
Amrish Raje

New User


Joined: 21 Mar 2013
Posts: 3
Location: India

PostPosted: Thu Mar 21, 2013 5:26 pm
Reply with quote

yes, looked at the output with a hex editor. Surprisingly the attachment is in ASCII. e.g. The word "Hello" was in EBCDIC, which I was able to confim by looking at the input PS with HEX ON. Then the attachement in the email, still has the word "Hello" in a readable format. In a HEX editor, the word "Hello" is represented in ASCII. But the word "México" is also getting translated into something that is garbage...
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Thu Mar 21, 2013 5:35 pm
Reply with quote

Clarify "garbage", in other words show us the hexadecimal representation.

FWIW, transferring just plain text to an .RTF file doesn't make it an RTF file...
Back to top
View user's profile Send private message
Amrish Raje

New User


Joined: 21 Mar 2013
Posts: 3
Location: India

PostPosted: Thu Mar 21, 2013 5:40 pm
Reply with quote

hex representation is:
4D A9 78 69 63 6F 0D
M ?? E X I C O
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Thu Mar 21, 2013 5:41 pm
Reply with quote

Quote:
In a HEX editor, the word "Hello" is represented in ASCII. But the word "México" is also getting translated into something that is garbage
The timing might be difficult to get right, but when you send an email via SMTP on the mainframe, SMTP makes a copy of the message until it gets sent. The HLQ of the data sets depends upon your site standards, but the low-level qualifiers will be ADDRBLOK and NOTE for the address information and the actual SMTP text. Submit your job, then look at the NOTE to see what z/OS is actually sending. If you have trouble seeing the files on your system, send the email to a non-existent address so SMTP will keep the data around (the files are only deleted when the mail server indicates the mail has been transmitted). Contact your site support group to find out the HLQ for the data sets.

How are you creating your EMAIL.TEXT1 file? Unless it is entirely created by your COBOL program, you may have a mix of EBCDIC and UTF-8 data in the file.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to save SYSLOG as text data via P... All Other Mainframe Topics 4
No new posts TEXT-TO-PDF Compuware & Other Tools 1
No new posts mail attachment with excel format All Other Mainframe Topics 2
No new posts REXX to send an email in Mainframe wi... CLIST & REXX 3
No new posts REXX to send an email in Mainframe CLIST & REXX 4
Search our Forums:

Back to Top