Author |
Message
|
RNStanich |
Posted: Fri Apr 16, 2010 5:32 am Post subject: Putting pdf from Mainframe |
|
|
Acolyte
Joined: 23 Apr 2002 Posts: 64
|
Hi all, looking for some opinions on a direction/solution.
We have an integration that is putting an MQ message from a mainframe (WMQ for z/OS) to a Windows qmgr. The message is comprised of some XML elements. Within one of the elements is a pdf document.
As I understand the developer's problem; the XML elements are sent in EBCDIC, the pdf has been generated as ASCII. So when the Windows application reads the message the EBCDIC gets converted (which is good) BUT so does the ASCII (which is bad).
Any thoughts on how to accomplish this?
We've considered two messages; one to be converted on the get; one not.
Can a user exit only convert parts of a message?
Does data embedded in an MQRFH2 header get converted?
Thoughts? _________________ Regards, Bob |
|
Back to top |
|
 |
Vitor |
Posted: Fri Apr 16, 2010 6:11 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Quote: |
We've considered two messages; one to be converted on the get; one not |
I'd do it this way if I had to do it. Put the PDF to one queue, retrieve the msg id from the put, set the correl id of the second message that value and put it. At the other end read the message with converted XML & get by msg id the PDF unmodified from the other queue using the correl id of the XML.
Other, possibly better, solutions are undoubtably possible
Quote: |
Can a user exit only convert parts of a message? |
By user exit, I assume you mean a data conversion exit? That can do anything you code it to do.
Quote: |
Does data embedded in an MQRFH2 header get converted? |
Yes. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
bruce2359 |
Posted: Fri Apr 16, 2010 6:27 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
Quote: |
...the pdf has been generated as ASCII. So when the Windows application reads the message the EBCDIC gets converted (which is good) BUT so does the ASCII (which is bad). |
It is the responsibility of the app developers (both sending and receiving) to understand the data portion of the message. What you have is mixed data formats.
Read the APR and APG regarding data conversion. I'd guess that the MQMD format field is set to MQFMT_STRING; but the data isn't really string data - for the purposes of data-conversion. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
zpat |
Posted: Fri Apr 16, 2010 6:39 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
I prefer to send binary data as BASE64 encoded data in the message.
This can survive conversion from EBCDIC to ASCII.
It can have the standard MQFMT_STRING format and MQGET with CONVERT.
This way you can have one message which is a lot easier generally.
Sample code snippets to encode and decode BASE64 data are widely available for most programming languages (if not already builtin). |
|
Back to top |
|
 |
RNStanich |
Posted: Fri Apr 16, 2010 7:53 am Post subject: |
|
|
Acolyte
Joined: 23 Apr 2002 Posts: 64
|
Thank you for your time on this.
zpat i'll hunt around but is there an easy explanation on how to accomplish the base64 switch on the mainframe? _________________ Regards, Bob |
|
Back to top |
|
 |
zpat |
Posted: Fri Apr 16, 2010 9:49 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
What programming language would be your preference?
(i.e. What language is the application written in and is it batch or CICS etc?).
You can find plenty of information about Base64 on the web -
http://en.wikipedia.org/wiki/Base64
I am no longer at a mainframe site (sigh) but I remember we used base64 routines in 390 assembler and Rexx. It's not that hard to write, but best copied from a sample. |
|
Back to top |
|
 |
RNStanich |
Posted: Fri Apr 16, 2010 9:58 am Post subject: |
|
|
Acolyte
Joined: 23 Apr 2002 Posts: 64
|
Actually the language could be Assembler or COBOL. This initial attempt is from a batch job although I wouldn't rule out CICS down the line. I'm hoping that would be the easy part - tweaking the env.
I'll look around - if anyone has anything they'd care to share I'm not above begging
In anycase, thank you all for your time... _________________ Regards, Bob |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Apr 16, 2010 10:59 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Either whatever you're calling to build the PDF or whatever you're calling to build the XML should likely be able to construct a base64 encoded datastream. |
|
Back to top |
|
 |
zpat |
Posted: Fri Apr 16, 2010 12:53 pm Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
|
Back to top |
|
 |
bruce2359 |
Posted: Fri Apr 16, 2010 4:30 pm Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
Moved to Mainframe and CICS. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
|