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?
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.