Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
email attachment with Unicode Text

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: email attachment with Unicode Text
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: 1060
Location: Oostende, Belgium

PostPosted: Thu Mar 21, 2013 5:19 pm    Post subject:
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    Post subject:
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: 1060
Location: Oostende, Belgium

PostPosted: Thu Mar 21, 2013 5:35 pm    Post subject:
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    Post subject:
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: 8165
Location: East Dubuque, Illinois, USA

PostPosted: Thu Mar 21, 2013 5:41 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts sending email from jcl using the mail... niloyarp JCL & VSAM 5 Tue Oct 10, 2017 12:32 pm
No new posts Table(Unicode(Graphic) table) loading... muralikrishnan_new DB2 0 Thu Oct 05, 2017 5:10 pm
No new posts Sorting on text - but in non-alphabet... Roy Ware SYNCSORT 5 Wed Aug 23, 2017 9:15 pm
No new posts EMAIL using IEBGENER - SMTP parasmalik20 JCL & VSAM 4 Tue May 23, 2017 12:19 am
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us