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 » Help with copybooks having REDEFINES

Post new topic  Reply to topic
 Help with copybooks having REDEFINES « View previous topic :: View next topic » 
Author Message
prasadpav
PostPosted: Thu Sep 13, 2007 3:18 am    Post subject: Help with copybooks having REDEFINES Reply with quote

Centurion

Joined: 03 Oct 2004
Posts: 142

Hi,
I created message defintiion by importing COBOL copybook definition, into message set project (WBIMB V6) - there are few REDEFINES within copybook. Then I coded ESQL to create a CWF format message using this message set. But when creating the BITSTREAM during MQOutput, I get an error that choice is not allowed. I've gone through the posts related to REDEFINES, but most of the posts says that both the choice elements should of same type & size but the redefines within this copybook looks bit different (This is distributed by a third party vendor):

Code:

       01  SAM-TEST-DATA.
           05  SAM-TEST-HEADER.
               10  REQUEST-CODE            PIC X(03).
               10  BUILDING              PIC X(16).
               10  PROPERTY-SITE                          REDEFINES
                   BUILDING.
                   15  FLOOR1          PIC X(08).
                   15  FLOOR2         PIC X(01).
                   15  FLOOR3         PIC X(07).
               10  DUMMY-VAR                     PIC X(05).
               10  VERSION-SHORT                 PIC 9(02).
               10  VERSION-STRING REDEFINES
                   VERSION-SHORT                 PIC X(02).
               10  END-FILLER                          PIC X(06).


Within ESQL code:

Quote:

SET OutputRoot.MRM.SAM_TEST_HEADER.REQUEST_CODE = '777';
SET OutputRoot.MRM.SAM_TEST_HEADER.BUILDING = 'OAKWOOD APTS';
SET OutputRoot.MRM.SAM_TEST_HEADER.END_FILLER = 'DF';


Part of the exception list is:
Code:

ParserException
   File = /build/S600_P/src/cpi/pwf/cwf/cwfcontext.cpp
   Line = 1112
   Function = CContext::writeChoice
   Type =
   Name =
   Label =
   Catalog = BIPv600
   Severity = 3
   Number = 5345
   Text = CWF Choice Element Not Allowed
   Insert
      Type = 5
      Text = msg_SAMTESTDATA
   Insert
      Type = 5
      Text = UNDEFINED


As you can see from the copybook, element BUILDING is REDEFINED as 3 different elements. And also VERSION-SHORT is REDEFINED as VERSION-STRING.

Any suggestions or ideas on how to model this in MRM and create a CWF message.

Thanks alot

Regards,
Prasad
Back to top
View user's profile Send private message
Bill.Matthews
PostPosted: Thu Sep 13, 2007 8:23 am    Post subject: Reply with quote

Master

Joined: 23 Sep 2003
Posts: 232
Location: IBM (Retired)

Where is the ESQL code to set information for these two fields?

10 DUMMY-VAR PIC X(05).
10 VERSION-SHORT PIC 9(02).

You have set the fields above these and the field below.. When using CWF, every field must either be set or have a default value specified in the msg set.
_________________
Bill Matthews
Back to top
View user's profile Send private message
prasadpav
PostPosted: Thu Sep 13, 2007 1:04 pm    Post subject: Reply with quote

Centurion

Joined: 03 Oct 2004
Posts: 142

I've default values for the rest of the elements. I want to prove that I can assign elements around choice element and some within.

In case if I haven't made it clear, i'm running my message broker V6 on solaris and it is patched to the latest fix packs.

Regards,
Prasad
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Sep 13, 2007 1:18 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

REDEFINES turn into Choices in Broker, usually.

Choices are either resolved because the parser knows how to resolve them (on input) or because your code sets particular fields and not other particular fields.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
prasadpav
PostPosted: Thu Sep 13, 2007 3:55 pm    Post subject: Reply with quote

Centurion

Joined: 03 Oct 2004
Posts: 142

I think I know what is going wrong within my ESQL. There are 2 choice elements - BUILDING & VERSION_SHORT and within ESQL I'm setting only one element BUILDING taking care of first choice. But for second choice - VERSION_SHORT, broker doesn't know which default value to use - VERSION_SHORT or VERSION_STRING while converting to bitstream. The error in exception list was not quite clear enough. I'll test this tomorrow and update this post.

Thanks Bill
Back to top
View user's profile Send private message
prasadpav
PostPosted: Fri Sep 14, 2007 1:04 am    Post subject: Reply with quote

Centurion

Joined: 03 Oct 2004
Posts: 142

Yes, that is exactly what it is. It is working now. Thanks.

Regards,
Prasad
Back to top
View user's profile Send private message
sandy vish
PostPosted: Tue Dec 11, 2012 11:30 pm    Post subject: Reply with quote

Apprentice

Joined: 18 Nov 2012
Posts: 27

prasad pav


can you let me know what you did for this error ,As you said that its working for you ,Because i am getting the same error .
Back to top
View user's profile Send private message
smdavies99
PostPosted: Wed Dec 12, 2012 12:06 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

It is considered best practice NOT to reopen 5yr old posts like this and especially when the last post to the old thread might be someone who no longer frequents this forum.

It is far better to open a NEW Thread and reference the old one via a URL.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Help with copybooks having REDEFINES
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.