Send text file from Mainframe to IBM MQ

1.4k views Asked by At

I want my JAVA application to communicate with Mainframe. I want mainframe to send the data in a text file to MQ and from MQ I can read it.

Currently our Mainframe developer is able to send everything in a single line. He sends it like a big message and I want the content to be sent in a text file. Is that possible? Does Mainframe support file sending to MQ?

2

There are 2 answers

0
Roger On BEST ANSWER

This is no big deal - I've been doing this for 20 years.

Clearly, you have limited knowledge of MQ and z/OS (mainframe). A file is a file is a file whether it is on a PC or Unix/Linux or the mainframe.

As other people have pointed out, MQ deals with messages and not files but you can put a file as a message. MQ treats the message data (aka payload) as a blob. The message data can be an XML file or PNG or PDF or simple text, etc.

The difference between a file on a given platform is the termination of a line (aka record). On a PC it is CRLF, on Unix/Linux it is LF and Mac OS X it is CR. The mainframe does not have that concept. On the mainframe, you have either fixed record length or variable record length files (aka datasets).

If the mainframe program is loading a fixed record length file then life is very straight forward. Simply ask the mainframe developer what the record length is (i.e. 80) then parse the message data in chunks. If it is variable length record then ask the mainframe developer to insert a CR (x'0D') after each record then when your application receives it, you will know where the termination of a line is.

0
Tim McCormick On

As of MQ 7.5, MQ contains 'Managed File Transfer' (MFT) function, which will allow the transmission of files from Mainframe to other platforms and back again.

Essentially you create a Managed File Transfer agent on each host which you would like to send/receive files.

There's a good introduction to MFT in the knowledge center here if you wish to read further on the subject: http://www.ibm.com/support/knowledgecenter/SSFKSJ_9.0.0/com.ibm.wmqfte.doc/wmqfte_intro.htm