Author |
Message
|
sandy vish |
Posted: Sun Nov 18, 2012 4:14 am Post subject: option to make copy book fields as optional |
|
|
Apprentice
Joined: 18 Nov 2012 Posts: 27
|
hi all,
Is there any way of making the Cobal Copy book (CPY) fields as 'Optional' in Websphere Message Broker (WMB v7.1) |
|
Back to top |
|
 |
Vitor |
Posted: Sun Nov 18, 2012 5:03 am Post subject: Re: option to make copy book fields as optional |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
sandy vish wrote: |
Is there any way of making the Cobal Copy book (CPY) fields as 'Optional' in Websphere Message Broker (WMB v7.1) |
No, because a Cobol copybook can't have optional fields. It's a positional structure so if an optional field is omitted even Cobol can't correctly parse it.
The closest legal structure in Cobol is an OCCURS DEPENDING ON which isn't optional, but does allow for parts of the structure to be limited to below their maximum size. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
kimbert |
Posted: Mon Nov 19, 2012 5:26 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Vitor is correct. Why do you need/want to do this? |
|
Back to top |
|
 |
sandy vish |
Posted: Mon Dec 10, 2012 10:20 pm Post subject: |
|
|
Apprentice
Joined: 18 Nov 2012 Posts: 27
|
we have more than 100 fields, in which most of them are optional so inorder to handle this we have enabled Create Null values for all fields and NullCharacter to "NUL" when creating MessageDefiantion file from cobol copy file ,so is this approach correct way of handling this situation or else do we need to explicitly change in each field as 1)Nillable enable 2)NullLitralFil 3)encoding Value 'Nul'. Please suggest |
|
Back to top |
|
 |
kimbert |
Posted: Tue Dec 11, 2012 1:13 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Thanks - that was a lot more useful than your first question.
Your fields are not 'optional'. The fields are always present in the COBOL data, but they sometimes have a special value. Treating the fields as nulls is the normal way to handle this.
Quote: |
or else do we need to explicitly change in each field as 1)Nillable enable 2)NullLitralFil 3)encoding Value 'Nul'. Please suggest |
OK - I will assume that your 'optional' fields are being filled with low-values ( nulls ). In which case the COBOL importer is probably doing the right thing for you.
Just wondering, though...if all of your acceptance tests are passing, then why are you asking for advice? Are you still getting unexplained errors? |
|
Back to top |
|
 |
|