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 » WebSphere Message Broker (ACE) Support » COBOL CopyBook Redefines Problem

Post new topic  Reply to topic
 COBOL CopyBook Redefines Problem « View previous topic :: View next topic » 
Author Message
kiran26
PostPosted: Wed Nov 27, 2002 10:22 am    Post subject: COBOL CopyBook Redefines Problem Reply with quote

Acolyte

Joined: 06 Feb 2002
Posts: 69

Hi,
Can any one let me know how to work with Cobol CopyBook's with REDEFINES. I have imported the CopyBook into MQSI V2.1 , but i am not sure how the REDEFINES will be implemented on the message set. If any one can point me on that, it will be helpful to me.

Thanks
Kiran
Back to top
View user's profile Send private message
kirani
PostPosted: Wed Nov 27, 2002 9:21 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

After you import your Copybook with REDEFINES, WMQI will create Compound Type element for that REDEFINE and it will set the Type Composition property to CHOICE. Using ESQL code you could refer to any one of these REDEFINED elements while building output message.

Pl have a look at Working with Messages manual for more information.
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
lung
PostPosted: Thu Nov 28, 2002 10:23 pm    Post subject: Reply with quote

Master

Joined: 27 Aug 2002
Posts: 291
Location: Malaysia

What if I'm defining the MRM myself? (not imporing from copybook)
The Type Composition property doesn't appear...
_________________
lung
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
kirani
PostPosted: Sat Nov 30, 2002 6:30 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Lung,
If you are creating MRM message by hand then also you could set these properties yourself. You could see the Type Composition property (in Right Pane) by clicking on the Compound Type Element in Types folder. Another property Type Content is also used with Type Cpmposition.
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
lung
PostPosted: Sun Dec 01, 2002 4:36 pm    Post subject: Reply with quote

Master

Joined: 27 Aug 2002
Posts: 291
Location: Malaysia

Got it. Thanks, Kiran! I need to take a look at this when I'm free...

_________________
lung
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
psmurthy
PostPosted: Tue Dec 03, 2002 10:12 am    Post subject: Redefines Reply with quote

Newbie

Joined: 03 Dec 2002
Posts: 3

I imported a Cobol Copybook having REDEFINES clause in it.
If I am getting a BLOB message(Format as of COBOL copy book) and need to move it to MRM, will this effect positioning of elements?
Do I need to setup any properties.
Back to top
View user's profile Send private message
kirani
PostPosted: Tue Dec 03, 2002 12:29 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

You will have to create a message definition in MRM-CWF format first, which maps to your Cobol copybook format, then parse your input message using this message defn. Once you refer to any element in REDEFINIES part, WMQI will parse this part of the tree with the Choice definition for this element, until then the choice remains unresolved.
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
psmurthy
PostPosted: Sat Dec 07, 2002 10:01 am    Post subject: Reply with quote

Newbie

Joined: 03 Dec 2002
Posts: 3

Some one please help me resolve this.

1)My cobol copybook has fields like below.

field-1 pic x(5).
field-2 redefines field-1 pic 9(9) comp-3.

In the above case how can I know if I am getting the numeric value or character(Field-1 is character).

2) My cobol copy book has occurs clause it. I need to map individual elements to AS400(Linear) structure using compute node before I send it to AS400. How can I distinguish the individual elements.
Back to top
View user's profile Send private message
kirani
PostPosted: Sat Dec 07, 2002 7:26 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Generally speaking there should be a field in your copybook, which will tell you whether to use PIC X(5) or PIC 9(9) COMP-3, both of these definitions occupies 5 bytes only.

Here is an example,

Code:

field-0 pic x(1).
field-1 pic x(5).
field-2 redefines field-1 PIC 9(9) COMP-3.

In your code first check for the value in field-0 before parsing

if (field-0 = 'C') then
  -- refer to field-1 ....
  -- AS400 field = field-1
else
if ( field-0 = 'N') then
  -- refer to field-2 ...
  -- AS400 field = field-2
end if;
end if;


I hope this helps.
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
psmurthy
PostPosted: Mon Dec 09, 2002 3:48 pm    Post subject: Reply with quote

Newbie

Joined: 03 Dec 2002
Posts: 3

Hi Kiran,

Thanks for your answers. Neither the cobol copy book provided to us nor the data coming from Mainframe does not contain the field-0. That means there is no information saying if if the data is related to field-1 or field-2. Is there any facilty available with MQSI or ESQL to check if the value is a string value or Numeric/Float value.

I appreciate if you could let me know how to handle Occurs in MQSI.

Thanks
Vasu
Back to top
View user's profile Send private message
kirani
PostPosted: Mon Dec 09, 2002 7:06 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Hi Vasu,

Without any indicator I don't think you can handle this in MQSI.

not sure if this will work ..
Read your message as BLOB and then check for sign nibble in a COMP-3 field, if it contains value equal to C, F or D, this means your data is COMP-3 data.
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » COBOL CopyBook Redefines Problem
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.