Author |
Message
|
deepak_paul |
Posted: Mon Jun 28, 2010 4:04 pm Post subject: Assigning Default values for Numeric and Character in COBOL |
|
|
Centurion
Joined: 04 Oct 2008 Posts: 147 Location: US
|
All,
While we are generating COBOL based message, we need to set zeros for numerics (int/long/short) and SPACES for character fields as default. We went through all the possible options in importing the COBOL message(SPACES/x'00'/x'FF'/NUL) but nothing really serve both cases.
SPACES - > Puts spaces for all types of fields(including numerics)
NUL - > puts zeros in all types of fields(including Characters)
Is there any solution for this other than going into each field and change its NULLliteralvalue to its respective value (SPACE for character; NUL for numeric)?
Thanks
Paul _________________ Regards
Paul |
|
Back to top |
|
 |
kimbert |
Posted: Tue Jun 29, 2010 1:11 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
I don't think the COBOL importer can do that.
Quote: |
Is there any solution for this other than going into each field and change its NULLliteralvalue to its respective value (SPACE for character; NUL for numeric)? |
There is no supported way to do that. However, a message definition file is just an xsd with annotations. Some brave people have found that it is possible to quickly change a lot of properties by modifying the mxsd file using a text editor or even a script.
Don't do this unless you are competent with text editors and/or scripting languages. |
|
Back to top |
|
 |
Gralgrathor |
Posted: Tue Jun 29, 2010 3:20 am Post subject: |
|
|
Master
Joined: 23 Jul 2009 Posts: 297
|
kimbert wrote: |
Some brave people |
Ah. I just posted a thread with a similar question. The choices are as follows:
A) I go through each field in the message type (in excess of 100 fields) and change the properties,
B) I do a search and replace on the MXSD file.
I really want an option C that allows somebody to quickly import a new copybook without having to retrace my steps. Otherwise message types can quickly become unmanageable. (Not that I don't document everything I do, but reading somebody else's documentation can be more of a bitch than reading somebody else's code.) |
|
Back to top |
|
 |
kimbert |
Posted: Tue Jun 29, 2010 3:28 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Fair comment - the requirement sounds very reasonable, and it has been noted. That comment does not imply anything about the content of future releases of WMB. |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Jun 29, 2010 1:39 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Paul,
Looks to me like you try to have the COBOL structure at "initial" value.
We use spaces for NULL value all across and have no compressed fields (i.e text message). This way all our values are either valid or null.
In COBOL it is easy to initialize a structure to spaces.... however I agree it is not the same as "initial" value.
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|