Author |
Message
|
prasadpav |
Posted: Thu Sep 13, 2007 3:18 am Post subject: Help with copybooks having REDEFINES |
|
|
 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 |
|
 |
Bill.Matthews |
Posted: Thu Sep 13, 2007 8:23 am Post subject: |
|
|
 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 |
|
 |
prasadpav |
Posted: Thu Sep 13, 2007 1:04 pm Post subject: |
|
|
 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 |
|
 |
jefflowrey |
Posted: Thu Sep 13, 2007 1:18 pm Post subject: |
|
|
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 |
|
 |
prasadpav |
Posted: Thu Sep 13, 2007 3:55 pm Post subject: |
|
|
 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 |
|
 |
prasadpav |
Posted: Fri Sep 14, 2007 1:04 am Post subject: |
|
|
 Centurion
Joined: 03 Oct 2004 Posts: 142
|
Yes, that is exactly what it is. It is working now. Thanks.
Regards,
Prasad |
|
Back to top |
|
 |
sandy vish |
Posted: Tue Dec 11, 2012 11:30 pm Post subject: |
|
|
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 |
|
 |
smdavies99 |
Posted: Wed Dec 12, 2012 12:06 am Post subject: |
|
|
 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 |
|
 |
|