IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Cobol COMP-2 fields getting scrambled by MQ?


IBM Mainframe Forums -> Java & MQSeries
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
David Vancelette

New User


Joined: 03 Feb 2012
Posts: 3
Location: USA

PostPosted: Fri Jan 07, 2022 10:18 pm
Reply with quote

I have an MQ msg coming from a Java platform that triggers a cobol program on our mainframe. The cobol program simply reads a VSAM file with a key supplied in the message, then returns the record via MQ to the Java program. But the returned record contains 4 COMP-2 (floating point) hex fields that apparently are getting scrambled by MQ when it converts EBCDIC to ASCII.

Any ideas on how to correctly convert these 4 COMP-2 fields during the transit from mainframe to Java platform? Is there a way to stop MQ from doing a conversion of EBCDIC to ASCII on only these fields in the message?
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 1614

PostPosted: Fri Jan 07, 2022 11:53 pm
Reply with quote

Mixture of character fields and binary ones in the same record, when transmitting from one environment to another one, is a bad idea.
Even if you are able to find a non-trivial way how to do this...
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2945
Location: NYC,USA

PostPosted: Sat Jan 08, 2022 4:02 am
Reply with quote

Try MQGMO_CONVERT- www.ibm.com/docs/en/ibm-mq/7.5?topic=queue-application-data-conversion
But is there a reason you can't send it as readable or char format ?

This might help but you also need help from MQ admin at your site to opine.
www.ibm.com/docs/en/ibm-mq/8.0?topic=objects-data-conversion
Back to top
View user's profile Send private message
David Vancelette

New User


Joined: 03 Feb 2012
Posts: 3
Location: USA

PostPosted: Sat Jan 08, 2022 6:01 am
Reply with quote

No real reason to not convert to character. I just thought there would be a simple way to keep specified columns of the message from being translated from EBCDIC to ASCII. Then the hex fields could have been converted by a Java routine on the return message.

Since the data has already been corrupted by the time Java does the MQGET, looks like doing the conversion in the cobol program is the best bet.

Anyway, does anyone have a preferred PICTURE string to handle the move of COMP-2 to zoned decimal?

Thanks for the advice!
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Java & MQSeries

 


Similar Topics
Topic Forum Replies
No new posts Converting ASCII values to COMP-3 (ZD... JCL & VSAM 2
No new posts Cobol prog to put an indicator on the... JCL & VSAM 1
No new posts COBOL Ascending and descending sort n... COBOL Programming 5
No new posts COBOL program logic for comparisipn o... COBOL Programming 2
No new posts COBOL - create and write to output fi... COBOL Programming 0
Search our Forums:

Back to Top