ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » Mainframe, CICS, TXSeries » Putting pdf from Mainframe

Post new topic  Reply to topic
 Putting pdf from Mainframe « View previous topic :: View next topic » 
Author Message
RNStanich
PostPosted: Fri Apr 16, 2010 5:32 am    Post subject: Putting pdf from Mainframe Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Fri Apr 16, 2010 6:11 am    Post subject: Reply with quote

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
View user's profile Send private message
bruce2359
PostPosted: Fri Apr 16, 2010 6:27 am    Post subject: Reply with quote

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
View user's profile Send private message
zpat
PostPosted: Fri Apr 16, 2010 6:39 am    Post subject: Reply with quote

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
View user's profile Send private message
RNStanich
PostPosted: Fri Apr 16, 2010 7:53 am    Post subject: Reply with quote

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
View user's profile Send private message
zpat
PostPosted: Fri Apr 16, 2010 9:49 am    Post subject: Reply with quote

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
View user's profile Send private message
RNStanich
PostPosted: Fri Apr 16, 2010 9:58 am    Post subject: Reply with quote

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
View user's profile Send private message
mqjeff
PostPosted: Fri Apr 16, 2010 10:59 am    Post subject: Reply with quote

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
View user's profile Send private message
zpat
PostPosted: Fri Apr 16, 2010 12:53 pm    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

Some here:

http://www.redversconsulting.com/tools.php

http://www.cicsworld.com/node/22

http://www-01.ibm.com/support/docview.wss?rs=1083&context=SSGMGV&dc=D400&uid=swg24013953&loc=en_US&cs=UTF-8&lang=en&rss=ct1083other

Don't forget that BASE64 encoding increases the size of the data by around 35% in byte terms, so allow for this in the message length.
Back to top
View user's profile Send private message
bruce2359
PostPosted: Fri Apr 16, 2010 4:30 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » Mainframe, CICS, TXSeries » Putting pdf from Mainframe
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.