Author |
Message
|
suraj |
Posted: Tue Mar 04, 2008 3:17 pm Post subject: variable length string in CWF fromat |
|
|
Acolyte
Joined: 31 Jul 2007 Posts: 56
|
hi..
I am using the CWF to model a messge. The input message has its last field which is variable in length. So how do i handle this?? |
|
Back to top |
|
 |
kimbert |
Posted: Tue Mar 04, 2008 3:47 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Use TDS instead of CWF. You need to use Variable Length Elements Delimited, and don't set the Length property on the last field. |
|
Back to top |
|
 |
suraj |
Posted: Tue Mar 04, 2008 7:40 pm Post subject: |
|
|
Acolyte
Joined: 31 Jul 2007 Posts: 56
|
the messages that i am dealing with are cobol, which hv copybook definitions for them.. so they should be modeled in cwf format |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Mar 04, 2008 9:37 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
suraj wrote: |
the messages that i am dealing with are cobol, which hv copybook definitions for them.. so they should be modeled in cwf format |
If the last field is of variable length I suspect an occurs depending clause.
You NEED to have that number and field passed before the 1st occurence of the field...
 _________________ MQ & Broker admin |
|
Back to top |
|
 |
AkankshA |
Posted: Tue Mar 04, 2008 10:03 pm Post subject: Re: variable length string in CWF fromat |
|
|
 Grand Master
Joined: 12 Jan 2006 Posts: 1494 Location: Singapore
|
suraj wrote: |
hi..
I am using the CWF to model a messge. The input message has its last field which is variable in length. So how do i handle this?? |
i remember using some property for last element something which says till the end of field... _________________ Cheers |
|
Back to top |
|
 |
kimbert |
Posted: Wed Mar 05, 2008 4:06 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
You can specify Length Units = End of Bitstream if you want to do it that way. |
|
Back to top |
|
 |
suraj |
Posted: Wed Mar 05, 2008 7:43 am Post subject: |
|
|
Acolyte
Joined: 31 Jul 2007 Posts: 56
|
thanks for the replies...
i have tried all options...but its still not working. any other suggestions ?? |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Mar 05, 2008 7:48 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Clearly you haven't tried all options, as one of the options was "Use TDS instead".
Also, copybook does not require that you use CWF, in fact some copy books may require that you use TDS.
The only feature of copybooks that require CWF are packed decimals... and that may even be handleable in TDS with binary fields (in 6.1).
Otherwise, please be very specific about a) what you've tried, b) what "not working" means. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
grammer |
Posted: Wed Mar 05, 2008 7:51 am Post subject: |
|
|
 Novice
Joined: 08 Feb 2008 Posts: 16 Location: Canada
|
kimbert wrote: |
You can specify Length Units = End of Bitstream if you want to do it that way. |
that way should work since that how i did it for one of mine messages |
|
Back to top |
|
 |
suraj |
Posted: Wed Mar 05, 2008 7:56 am Post subject: |
|
|
Acolyte
Joined: 31 Jul 2007 Posts: 56
|
i have'nt tried using TDS... I will try that out...
But i just want to know whether there is no way to handle variable length feilds in CWF format... |
|
Back to top |
|
 |
grammer |
Posted: Wed Mar 05, 2008 8:19 am Post subject: |
|
|
 Novice
Joined: 08 Feb 2008 Posts: 16 Location: Canada
|
in your msg set under msg definiton
-> open it adn expand the tree for messages _
-> keep going till you hiot the elemnts and go to properties under CWF set Length of units to End of bit stream
I think thats all i did, took me a while to figure it out for the first time |
|
Back to top |
|
 |
suraj |
Posted: Wed Mar 05, 2008 8:19 am Post subject: |
|
|
Acolyte
Joined: 31 Jul 2007 Posts: 56
|
as i hv specified earlier.. only the last fiels of the mesasge is of variable lenght.
this is how the copybook looks like..
01 DATA
03 DATA-AREA
05 ID PIC X(05)
05 TYPE PIC X(05)
05 NBR PIC 9(9)
05 NAME PIC X(30)
Now, the NAME field which is 30 bytes in length in copybook def, manytimes has length less than 30 bytes in the incoming msg.
So when i try to parse the i/p msg.. i get a parsing error saying that the length of that feild is too short.. |
|
Back to top |
|
 |
suraj |
Posted: Wed Mar 05, 2008 8:26 am Post subject: |
|
|
Acolyte
Joined: 31 Jul 2007 Posts: 56
|
the End of bitstream did work.... thanks for your help.. |
|
Back to top |
|
 |
grammer |
Posted: Wed Mar 05, 2008 9:04 am Post subject: |
|
|
 Novice
Joined: 08 Feb 2008 Posts: 16 Location: Canada
|
nice  |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Mar 05, 2008 2:50 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
suraj wrote: |
as i hv specified earlier.. only the last fiels of the mesasge is of variable lenght.
this is how the copybook looks like..
01 DATA
03 DATA-AREA
05 ID PIC X(05)
05 TYPE PIC X(05)
05 NBR PIC 9(9)
05 NAME PIC X(30)
Now, the NAME field which is 30 bytes in length in copybook def, manytimes has length less than 30 bytes in the incoming msg.
So when i try to parse the i/p msg.. i get a parsing error saying that the length of that feild is too short.. |
Would that be because your FTP cuts trailing spaces?
Use MQ and the trailing spaces should be there.
 _________________ MQ & Broker admin |
|
Back to top |
|
 |
|