Author |
Message
|
kiran26 |
Posted: Wed Nov 27, 2002 10:22 am Post subject: COBOL CopyBook Redefines Problem |
|
|
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 |
|
 |
kirani |
Posted: Wed Nov 27, 2002 9:21 pm Post subject: |
|
|
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 |
|
 |
lung |
Posted: Thu Nov 28, 2002 10:23 pm Post subject: |
|
|
 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 |
|
 |
kirani |
Posted: Sat Nov 30, 2002 6:30 pm Post subject: |
|
|
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 |
|
 |
lung |
Posted: Sun Dec 01, 2002 4:36 pm Post subject: |
|
|
 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 |
|
 |
psmurthy |
Posted: Tue Dec 03, 2002 10:12 am Post subject: Redefines |
|
|
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 |
|
 |
kirani |
Posted: Tue Dec 03, 2002 12:29 pm Post subject: |
|
|
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 |
|
 |
psmurthy |
Posted: Sat Dec 07, 2002 10:01 am Post subject: |
|
|
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 |
|
 |
kirani |
Posted: Sat Dec 07, 2002 7:26 pm Post subject: |
|
|
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 |
|
 |
psmurthy |
Posted: Mon Dec 09, 2002 3:48 pm Post subject: |
|
|
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 |
|
 |
kirani |
Posted: Mon Dec 09, 2002 7:06 pm Post subject: |
|
|
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 |
|
 |
|