Author |
Message
|
RadhamaniRamadoss |
Posted: Tue Nov 01, 2011 1:38 am Post subject: Using Cobol copy book to define a message set |
|
|
Apprentice
Joined: 08 Oct 2009 Posts: 42
|
I created a message set by importing a simple cobol copy book.
The message set is been created without any errors.I am not able to get the output in a simple design of MQINPUT->COMPUTE->MQOUTPUT nodes.
As I checked the message set,I am seeing that the length field is not mentioned for xsd:string.Rather the Max field is set according to the cobol copy book's PIC X() field.Assume if its as 'PIC X(10)' ,then the message set has the element's xsd:string MAX field set as 10.This is not working out for any valid input to the message flow.
Instead if I set the element's length manually as Length '10' as we get in the creation of fixed length TDS message sets,its working as expected.The valid messages are passed and the invaled messages are throwing errors.
My question is ,do we have to manually set the length field for cobol copy book message set creations?If its a big one,the it wud be a tedious job.How can we resolve this issue?
If we have to set the length field manually,then why is this MAX field for?
Please clarify .... |
|
Back to top |
|
 |
kimbert |
Posted: Tue Nov 01, 2011 3:58 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
As I checked the message set,I am seeing that the length field is not mentioned for xsd:string.Rather the Max field is set according to the cobol copy book's PIC X() field. |
The COBOL importer is a very reliable component of the product, and usually works very well. I'm not saying that it is perfect, but it is not likely to make a mistake with simple scenario like this.
Note that the COBOL importer does not create TDS message definitions. It only creates CWF definitions. So you should not expect to see the TDS properties populated by the COBOL importer.
Quote: |
My question is ,do we have to manually set the length field for cobol copy book message set creations? |
No. As you say, the COBOL importer would not be very useful if that was necessary
Quote: |
why is this MAX field for? |
The maxLength is in the logical properties. Under the covers, it is an XML schema xs:maxLength facet. It plays no part at all in the parsing of your COBOL message unless you set Validation to 'Content and Value'. Even then, your fixed-length format is not likely to exceed the maxLength facet value. If you tried to *write* a message tree using your message set, you could switch on validation and trap strings that were too long before they even got to the CWF writer. |
|
Back to top |
|
 |
RadhamaniRamadoss |
Posted: Tue Nov 01, 2011 8:53 pm Post subject: |
|
|
Apprentice
Joined: 08 Oct 2009 Posts: 42
|
Thank you very much for the reply ...
But ...I set the validation as "Content and Value" .Still my messageset is validated against the input message as far as I keep the CWF message set as "MAX length" alone without modifying the length property.
Could you please throw some light on this...?I want the CWF to be validated against the message set.
For eg:I am able to parse the input message NAME of "10" characters in spite of the MAX field set as "5" characters.I have kept the Validation of MQInput node as "Content and value". |
|
Back to top |
|
 |
kimbert |
Posted: Wed Nov 02, 2011 3:51 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
In your first post you said:
Quote: |
This is not working out for any valid input to the message flow. |
Now you are saying:
Quote: |
I am able to parse the input message NAME of "10" characters in spite of the MAX field set as "5" characters. |
Are you asking one question, or two? Did my first response solve the first problem, and now you are asking another, different question?
Either way, I am struggling to understand what the problem is. Either
a) you are getting an error from the parser ( so no message tree gets produced )
or
b) you are getting a message tree, but you are not getting the validation errors that you were expecting.
Please explain whether it is a) or b).
Please explain what you have done to diagnose the problem. |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Nov 02, 2011 4:12 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
I think he or she is concerned that the COBOL importer is not creating the correct CWF facet to represent a field length constraint, so that the field length constraint will get validated at runtime.
It might also be that he or she is confused about which facet CWF uses to represent a constraint on the maximum number of characters that a string field can hold.... expecting it to be the Max field rather than the Length or vice versa. |
|
Back to top |
|
 |
RadhamaniRamadoss |
Posted: Wed Nov 02, 2011 8:43 pm Post subject: |
|
|
Apprentice
Joined: 08 Oct 2009 Posts: 42
|
This is what I have done.
When I create a message set defn. by importing a cobol copy book,only the "MAX" field is set against xstring of Name.
Now for xstring of element "Name" ---> "Max" field is 3.
I am passing a message "ROSES" for "Name PIC X(3)".I am expecting an error because the input message has an invalid length.
Instead ,I am receiving the output for whatever input I pass without any errors.
So,I tried to set the "Length" field of element "Name" in the message set as "3".
I am passing a message "ROSES" for "Name PIC X(3)".I am receiving error in the MQInput end.I am passing a message "ROS".I am getting the output.
Please let me know whether I shud mandatarily set the Length facet to get the CWF work well.If not required,then please let me know where I am doing the mistake. |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Nov 03, 2011 7:44 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Hard to tell you where you are doing the mistake as you are not telling us how you are importing the cobol copy book... after all there are 3 pannels where you can make mistakes on the import wizard...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
kimbert |
Posted: Fri Nov 04, 2011 1:46 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Try this:
- Put a Trace node after the MQInput node and before the MQOutput node
- set the pattern to '${Root}"
- leave the Destination property as 'User Trace'
- Take a user trace
- READ IT carefully.
I cannot work out exactly what is going wrong, but those steps will probably help you to find the answer for yourself. |
|
Back to top |
|
 |
|