-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mqput js string with NewLine #158
Comments
You need to make sure that the codepages are being converted as expected. And that the application is actually doing what you want it to do. It's impossible to say exactly what to change as it will depend hugely on configuration and what the receiving application is doing with the message body. The message that has been PUT will presumably have "0x0A" as the newline char; the EBCDIC equivalent would normally be "0x15". What the COBOL app does with that 0x15 would be something you need to check with the app source code. For example, it might print it as CR, not LF; or it might be ignoring it. Using raw message browsers like amqsbcg at various stages of the flow (eg disable the cobol app from starting) will tell you exactly what bytes are in the message body. |
Appreciate your reply, and some new hints ... I tried converting the message in the javascript application from utf-8 to cp278 (EBCIDIC Finland, Sweden) using codepages before doing the put. This results in a string which looks something like:
I used https://github.com/SheetJS/js-codepage for this and: I also set: However after doing the put the message ends up looking the same on the queue: I must be missing something crucial :) On the mainframe side and in the cobol application, a new line needs to be 0D 25. In utf-8 and on the pc side I think its |
You should be putting the message in ASCII and rely on the MQGET-with-conversion in the COBOL end. But I think you are mixing up the CR and LF characters. And possibly also getting confused with Windows conventions of CRLF being the line-end in text files, instead of the single LF. You might want to play with seeing what happens with using both "\r" and "\n" in the string that's put.
Exactly which combination of these characters constitutes an "end-of-line" delimiter might vary from application to application. |
I tried a few new things... Converting into ascii before put:
It also seems like Swedish characters do not work very well with ASCII, so seems like I have to find a way to convert correctly into cp278... I know of a JAVA application using the same queue / cobol application using something similar to:
it also uses prior to put:
To convert certain bytes because of this bug: Wish I could figure out how to do something similar in Javascript ... |
Hi,
I've managed to do mqput using this package... However I have a problem, after mqput the message triggers a cobol application which begins processing the message.
However it does not detect the newline characters from my javascript string (mq message) which I put on the queue.
Any suggestions on how to make a mq message EBSIDIC "friendly" before the put?
The text was updated successfully, but these errors were encountered: