Author |
Message
|
saini |
Posted: Wed Jul 21, 2004 6:02 pm Post subject: Problems Importing Cobol Copy Book... |
|
|
Novice
Joined: 28 Feb 2002 Posts: 24
|
Hello Everyone,
When I import the following line in a cobol copy book I get a syntax error :
000032 10 OUT-TOTAL-PREM PIC S9(11)V99.
However, when I drop the "V99" I am able to successfully import the copy book. I could always change the definition to "S9(13)" however, I will have to take care of the decimal place when changing to XML from CWF. Are there any workarounds?
On the other side, I am converting a XML format to a CWF format; Is there a easy way to build the CWF output message (I don't like to import the XML schema and then use the mapping node! - so I am using esql SET command). I only really need about 3 or 4 fields in the output CWF structure, is there a way to only define those 3 or 4 fields using the SET esql and leave the rest out (undefined)?
I am using WBIMB 5.0 with CSD03.
Any comments? Suggestions?
Thanks.
NS |
|
Back to top |
|
 |
kirani |
Posted: Wed Jul 21, 2004 8:00 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
saini wrote: |
I only really need about 3 or 4 fields in the output CWF structure, is there a way to only define those 3 or 4 fields using the SET esql and leave the rest out (undefined)?
|
Yes. You can read your input XML message as Generic XML. Then using some ESQL code you can transform it into CWF format.
I believe your line is exceeding the allowed column number. I don't know whats the column number but I guess its 72 or something like that. _________________ 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 |
|
 |
mqsidude |
Posted: Thu Jul 22, 2004 12:17 am Post subject: |
|
|
 Centurion
Joined: 22 Jan 2004 Posts: 148
|
Try replacing the line
Code: |
10 OUT-TOTAL-PREM PIC S9(11)V99. |
with
Code: |
10 OUT-TOTAL-PREM PIC S9(11) V9(2). |
 |
|
Back to top |
|
 |
saini |
Posted: Thu Jul 22, 2004 2:18 am Post subject: |
|
|
Novice
Joined: 28 Feb 2002 Posts: 24
|
Thanks for your replies, I will try your suggestions. My second question was the following:
Lets assume a I have 4 fields in my CWF structure; FIELDA, FIELDB, FIELDC, and FIELDD. Currently only FIELDB and FIELDD are being used so can I simply do the following :
Set OutputRoot.MRM.FIELDB = 'B';
Set OutputRoot.MRM.FIELDD = 'D';
and not define the other fields FIELDA, and FIELDC? Is there a way to set the default values for the other fields at a global level (because if your structure is big you don't want to go field by field to define those default values?).
Thanks again. I will try your suggestions.
NS |
|
Back to top |
|
 |
mqsidude |
Posted: Thu Jul 22, 2004 3:51 am Post subject: |
|
|
 Centurion
Joined: 22 Jan 2004 Posts: 148
|
One way is to assign default values to all elements at message set level. This will assure that the unmapped elements are assigned with default values when the message is written to the output queue.
The other obvious way is to set default values via code using a loop if you dont want to assign them element by element.
-crony |
|
Back to top |
|
 |
saini |
Posted: Thu Jul 22, 2004 4:18 am Post subject: |
|
|
Novice
Joined: 28 Feb 2002 Posts: 24
|
That is exactly what I am looking for? What field do I set on the CWF layer properties? I couldn't find any field at the message set level.
Thx. again.
NS |
|
Back to top |
|
 |
mqsidude |
Posted: Thu Jul 22, 2004 4:47 am Post subject: |
|
|
 Centurion
Joined: 22 Jan 2004 Posts: 148
|
You have to create an element value and then assign it to an element.
For your sample, where you are not mapping the elements FIELDA and FIELDC and assuming that these are string fields of same length say 4, here are the steps:
1. Right click FIELDA -> Create -> Value Constraint -> Default Value.
2. Enter appropriate values in the popup window, for example,
Name = Stringvalue4
Value = 4 spaces (Hit spacebar 4 times, if spaces are the required defaults. You can also enter any string value of length 4 depending on requirement)
Identifier = Stringvalue4
Type = String.
3. For FIELDC, you will be adding the created field value instead of creating a new one using the similar sequence of steps given in 1.
-crony |
|
Back to top |
|
 |
kirani |
Posted: Thu Jul 22, 2004 9:00 am Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
If using WBIMB 5.0 you need to set default value in [b]Default[b] section in Value group on properties tab. _________________ 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 |
|
 |
|