ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » DFDL for cobol copy book

Post new topic  Reply to topic Goto page Previous  1, 2, 3  Next
 DFDL for cobol copy book « View previous topic :: View next topic » 
Author Message
maurito
PostPosted: Wed Mar 16, 2016 3:53 am    Post subject: Reply with quote

Partisan

Joined: 17 Apr 2014
Posts: 358

chaitu wrote:
Hi maurito,

Thanks for the Hint,
And my DFDL is like
Code:

-01name
..sequence
Commonarea
..sequence
   element1
   element2
   element3
Choice
Redefine1
Redefine2
Redefine3
.
.
.
Redefinen



I want my model to be like
Code:

Commonarea         redefine2
commonarea          redefine5
commonarea          redefine10
 


where I need to repeat the same commonarea in each new line.
And redefine changes based on the field which is on element present in commonarea which I set it using discriminator.
Now I need to set commonarea in each line like above
could you please take a look and tell me any info needed and give a hint to figure it out.

Thanks in advance to all.

are you trying to say that you want a commonarea for each redefine , so that after the input is parsed you get
Code:

Commonarea
..sequence
   element1
   element2
   element3
   redefineX
Commonarea
..sequence
   element1
   element2
   element3
   redefineY

As I said before, you need to take your time to understand the structure of your data. If you cannot explain that clearly, you will not be able to solve the problem, and so far, you have failed to explain to us what your data looks like.
for example:
each of my records is like below:
Code:

Commonarea                      |   redefine
element1|element2|elementn      | one of the redefines based on values in the commonarea

meaning that you have a commonarea followed by a redefine. The common area consists of several fields, and the redefine will depend on values in the commonarea. Then that structure repeated an unbound number of times.
That is my guess from what you have said, if incorrect, then attempt to describe your record in an understandable way.
Back to top
View user's profile Send private message
chaitu
PostPosted: Wed Mar 16, 2016 5:22 am    Post subject: Reply with quote

Voyager

Joined: 15 Apr 2014
Posts: 89

are you trying to say that you want a commonarea for each redefine , so that after the input is parsed you get
Code:

Commonarea
..sequence
   element1
   element2
   element3
   redefineX
Commonarea
..sequence
   element1
   element2
   element3
   redefineY


you are near to my requirement.

yes I want commonarea with each redifene like

Code:

Commonarea
..sequence
  element1
  element2
  element3
redefine2
..sequence
   element1
  element2
  element3
Commonarea
..sequence
  element1
  element2
  element3
redefine5
..sequence
   element1
  element2
  element3
Commonarea
..sequence
  element1
  element2
  element3
redefine1
..sequence
   element1
  element2
  element3
.
.
.



my question is how to repeat this commonarea.
Back to top
View user's profile Send private message
maurito
PostPosted: Wed Mar 16, 2016 5:29 am    Post subject: Reply with quote

Partisan

Joined: 17 Apr 2014
Posts: 358

chaitu wrote:
are you trying to say that you want a commonarea for each redefine , so that after the input is parsed you get
Code:

Commonarea
..sequence
   element1
   element2
   element3
   redefineX
Commonarea
..sequence
   element1
   element2
   element3
   redefineY


you are near to my requirement.

yes I want commonarea with each redifene like

Code:

Commonarea(element1) Commonarea(element2) Commonarea(element3)         redefine2
Commonarea(element1) Commonarea(element2) Commonarea (element3)         redefine5
Commonarea(element1) Commonarea(element2) Commonarea(element3)          redefine10



my question is how to repeat this commonarea.


so, you want to define a dfdl like this:
Code:

rootElement
sequence
    record minOccurs = 1 , maxOccurs = unbound
           sequence
                  commonarea  min=1 , max=1
                          sequence
                              record1
                              etc
                          end sequence
                  oneRedefine min=1 , max=1
                          choice
                               refdefine1
                               redefine2
                          end choice
             end sequence
end sequence

or similar. You probably have most of the types from the cobol import, all you need to do is to put them together. Start with a simple case, for example commonarea and one redefine ( without the choices ) and test parse it. Then add complexity, test parsing it every time. That will teach you a lot.
Back to top
View user's profile Send private message
timber
PostPosted: Wed Mar 16, 2016 6:02 am    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1292

OK - more advice.

You *must* explain clearly all of the following things:
1. The structure of your DFDL model
2. The structure of the message tree that you are getting now
3. The structure of the message tree that you want to get

If we have that information, we should be able to suggest a change to your DFDL model. If you miss out any of those 3 items, we will have to guess. Or ask for it again.

btw, please note that the model and the message tree are not the same thing.
- The model is the (DFDL) schema in your case.
- The message tree is the data structure that your message flow works with.
Be careful to use the correct words when discussing those concepts.
Back to top
View user's profile Send private message
chaitu
PostPosted: Thu Mar 17, 2016 2:52 am    Post subject: Reply with quote

Voyager

Joined: 15 Apr 2014
Posts: 89

Hi All,

The structure of my DFDL is Cobol

Code:


01name
 sequence
    commonarea minOccurs = 1 , maxOccurs = unbound
           sequence
                  element1
                  element2
                  element3
             end sequence
 Choice
    Redefine1
      sequence
        element1
         element2
         element3
        end sequence
    Redefine2
      sequence
        element1
         element2
         element3
        end sequence
   Redefine1
      sequence
        element1
         element2
         element3
        end sequence

end sequence
 


And I have to parse the test with

Code:

CS00698460005125594200001        1322016-01-25-07.40.30.000000           
CS00698460005125594200001        1322016-01-25-07.40.30.000000   
CS00698460005125594200001        1322016-01-25-07.40.30.000000     
OS00698460005125594200001        1322016-01-25-07.40.30.000000                                         


Mean first elements are from Commanarea and after space Redefine elements start, like that every line starts with Commanarea.

Code:


Commanarea
  element1
  element2
  element3
Redefine1
  element1
  element2
  element3
Commanarea
  element1
  element2
  element3
Redefine5
  element1
  element2
  element3
Commanarea
  element1
  element2
  element3
Redefine7
  element1
  element2
  element3
.
.
.

For Redefine I set the terminator %NL;
And I just started designing the DFDL which I am going to use it in Mapping node after completing it.

Now I am not able to repeat the commanarea, even I put it to undounded
Code:

01name
 sequence
    commonarea minOccurs = 1 , maxOccurs = unbound


I tried with initiators also but didn't work. I am able to pass only first line in second line it's throwing error.
[/code]
Unexpected end of input document at byte offset '13984' while parsing choice group '#xscd(/type::__01NAME/model::sequence/model::choice)'.
Code:

Any suggestions to figure it out.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Thu Mar 17, 2016 4:24 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20767
Location: LI,NY

First get your hands on the COBOL copy book that defines the data.
Second use the DFDL Wizard to ingest the COBOL copy book
Third augment the generated DFDL model to allow it to determine which branch of the choice to take. This is called setting the discriminators.
Fourth get hold of a sample file and try to parse it in the test view of the DFDL perspective.

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
maurito
PostPosted: Thu Mar 17, 2016 4:49 am    Post subject: Reply with quote

Partisan

Joined: 17 Apr 2014
Posts: 358

Yes, I have already told you how to model your dfdl.
You don't have to repeat your commonarea, you have to repeat the WHOLE RECORD. That includes common area AND redefines.
You seem to ask for advice, and then ignore it completely.
Back to top
View user's profile Send private message
timber
PostPosted: Thu Mar 17, 2016 8:19 am    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1292

You have also ignored the best piece of advice in the entire thread.
Maurito said:
Quote:
Use the DFDL test parse and look at the trace.
Your next steps should be
1. Use the DFDL Test perspective to test your DFDL schema against some sample input data
2. Read the DFDL trace. The trace will probably make it obvious what is wrong with your DFDL schema.

Do not post again without including some DFDL trace.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Thu Mar 17, 2016 8:36 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

timber wrote:
Do not post again without including some DFDL trace.


Or at least, don't expect an answer if you do post without including DFDL trace.
_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
maurito
PostPosted: Thu Mar 17, 2016 10:28 am    Post subject: Reply with quote

Partisan

Joined: 17 Apr 2014
Posts: 358

timber wrote:
Do not post again without including some DFDL trace.

And what conclusions have you arrived to after looking at the trace. Do not expect to post the trace in this forum for us to tell you what is wrong, without you having had a go.
Back to top
View user's profile Send private message
chaitu
PostPosted: Wed Mar 30, 2016 2:25 am    Post subject: Reply with quote

Voyager

Joined: 15 Apr 2014
Posts: 89

Hi All,

Sorry for the late reply.
As per maurito advice I designed my DFDL like
Code:


Rootelement (unbounded)
..sequence
  commonarea minOccurs = 1 , maxOccurs = 1
           sequence
                  element1
                  element2
                  element3
             end sequence
 Choice
    Redefine1
      sequence
        element1
         element2
         element3
        end sequence
    Redefine2
      sequence
        element1
         element2
         element3
        end sequence
   Redefine1
      sequence
        element1
         element2
         element3
        end sequence

end sequence



I am repeating the Rootelement which has commonarea and redefines and tested here is the DFDL trace
Code:

Mar 30, 2016, 3:24:18 PM   info: Offset: 1500. Found nil literal value for element 'ECI_DEMO_EX_FILLER'. The value of the element will be reported as nil.
                            [dfdl = /2ref/Cobol_Occurs.xsd, scd = #xscd(/type::__01NAME100/model::sequence/schemaElement::ECI_CONSUMER/type::0/model::sequence/model::choice/schemaElement::ECI_DEMOGRAPHIC_REC/type::0/model::sequence/schemaElement::ECI_DEMO_EX_FILLER), 129]

Mar 30, 2016, 3:24:18 PM   info: Offset: 1500. Finished processing element 'ECI_DEMO_EX_FILLER'.
                            [dfdl = /2ref/Cobol_Occurs.xsd, scd = #xscd(/type::__01NAME100/model::sequence/schemaElement::ECI_CONSUMER/type::0/model::sequence/model::choice/schemaElement::ECI_DEMOGRAPHIC_REC/type::0/model::sequence/schemaElement::ECI_DEMO_EX_FILLER), 71]

Mar 30, 2016, 3:24:18 PM   info: Offset: 1500. Found terminator '%NL;' for 'ECI_DEMOGRAPHIC_REC'.
                            [dfdl = /2ref/Cobol_Occurs.xsd, scd = #xscd(/type::__01NAME100/model::sequence/schemaElement::ECI_CONSUMER/type::0/model::sequence/model::choice/schemaElement::ECI_DEMOGRAPHIC_REC), 72]

Mar 30, 2016, 3:24:18 PM   info: Offset: 1502. Finished processing element 'ECI_DEMOGRAPHIC_REC'.
                            [dfdl = /2ref/Cobol_Occurs.xsd, scd = #xscd(/type::__01NAME100/model::sequence/schemaElement::ECI_CONSUMER/type::0/model::sequence/model::choice/schemaElement::ECI_DEMOGRAPHIC_REC), 72]

Mar 30, 2016, 3:24:18 PM   info: Offset: 1502. Skipped remaining bytes of fixed-length choice element '#xscd(/type::__01NAME100/model::sequence/schemaElement::ECI_CONSUMER/type::0/model::sequence/model::choice)', actual content was shorter than the length
                            [dfdl = /2ref/Cobol_Occurs.xsd, scd = #xscd(/type::__01NAME100/model::sequence/schemaElement::ECI_CONSUMER/type::0/model::sequence/model::choice), 230]

Mar 30, 2016, 3:24:18 PM   error: CTDP3144E: Unexpected end of input document at byte offset '16,288' while parsing choice group '#xscd(/type::__01NAME100/model::sequence/schemaElement::ECI_CONSUMER/type::0/model::sequence/model::choice)'.

Mar 30, 2016, 3:24:18 PM   fatal: CTDP3144E: Unexpected end of input document at byte offset '16288' while parsing choice group '#xscd(/type::__01NAME100/model::sequence/schemaElement::ECI_CONSUMER/type::0/model::sequence/model::choice)'.

As per my understanding after parsing the first record of I/p file its failing instead of going to read next record because some fields which I am passing is shorter then the length defined in DFDL.
Code:

Mar 30, 2016, 3:24:18 PM   info: Offset: 1502. Skipped remaining bytes of fixed-length choice element '#xscd(/type::__01NAME100/model::sequence/schemaElement::ECI_CONSUMER/type::0/model::sequence/model::choice)', actual content was shorter than the length
                            [dfdl = /2ref/Cobol_Occurs.xsd, scd = #xscd(/type::__01NAME100/model::sequence/schemaElement::ECI_CONSUMER/type::0/model::sequence/model::choice), 230]


So if my assumptions are correct then I set the nillable property to 'true' also. But same issue

Can anyone guide me weather I am in right direction or not.

Back to top
View user's profile Send private message
maurito
PostPosted: Wed Mar 30, 2016 4:41 am    Post subject: Reply with quote

Partisan

Joined: 17 Apr 2014
Posts: 358

I don't think the rootElement should be unbounded. Look at the example I gave you, there is another level. Then you need to figure out why the 1st record is not parsing, maybe the wrong choice ?
Back to top
View user's profile Send private message
chaitu
PostPosted: Wed Mar 30, 2016 6:04 am    Post subject: Reply with quote

Voyager

Joined: 15 Apr 2014
Posts: 89

maurito wrote:
I don't think the rootElement should be unbounded. Look at the example I gave you, there is another level. Then you need to figure out why the 1st record is not parsing, maybe the wrong choice ?


Sorry maurito I missed one level. Actually its their but I missed in posting.
Code:


Rootelement (unbounded)
..sequence
  commonarea minOccurs = 1 , maxOccurs = 1
           sequence
                  element1
                  element2
                  element3
             end sequence
 Choice
    Redefine1
      sequence
        element1
         element2
         element3
        end sequence
    Redefine2
      sequence
        element1
         element2
         element3
        end sequence
   Redefine1
      sequence
        element1
         element2
         element3
        end sequence

end sequence



I will try by adding one more element for redefines but as per my understanding their would not be much deference. like
Code:

Rootelement (unbounded)
..sequence
  commonarea minOccurs = 1 , maxOccurs = 1
           sequence
                  element1
                  element2
                  element3
             end sequence
 REDEFINES min= 1, max=1
    Choice
      Redefine1
         sequence
          element1
          element2
          element3
        end sequence
     Redefine2
      sequence
        element1
         element2
         element3
        end sequence
   Redefine1
      sequence
        element1
         element2
         element3
        end sequence
  end choice
 end sequence
end sequence

Back to top
View user's profile Send private message
maurito
PostPosted: Wed Mar 30, 2016 9:17 am    Post subject: Reply with quote

Partisan

Joined: 17 Apr 2014
Posts: 358

I will say it again, and read carefully:

I don't think rootelement should be unbounded.
Back to top
View user's profile Send private message
chaitu
PostPosted: Thu Mar 31, 2016 5:01 am    Post subject: Reply with quote

Voyager

Joined: 15 Apr 2014
Posts: 89

Hi,

I tried with

Code:

RootElement
sequence
    record( unbound)
           sequence
                  commonarea  min=1 , max=1
                          sequence
                              record1
                              record2

                          end sequence
                 
                         choice
                               refdefine1
                               redefine2
                          end choice
             end sequence
end sequence
 


and also with
Code:

RootElement
sequence
    record ( unbound )
           sequence
                  commonarea  min=1 , max=1
                          sequence
                              record1
                              etc
                          end sequence
                  Redefines min=1 , max=1
                          choice
                               refdefine1
                               redefine2
                          end choice
             end sequence
end sequence


but both are throwing same error that is
Code:

Mar 31, 2016, 5:28:33 PM   info: Offset: 1500. Skipped remaining bytes of fixed-length choice element '#xscd(/type::__01NAME100/model::sequence/schemaElement::ECI_CONSUMER/type::0/model::sequence/model::choice)', actual content was shorter than the length
                            [dfdl = /Coppy_LIB/COBOL.xsd, scd = #xscd(/type::__01NAME100/model::sequence/schemaElement::ECI_CONSUMER/type::0/model::sequence/model::choice), 230]

Mar 31, 2016, 5:28:33 PM   error: CTDP3144E: Unexpected end of input document at byte offset '16,288' while parsing choice group '#xscd(/type::__01NAME100/model::sequence/schemaElement::ECI_CONSUMER/type::0/model::sequence/model::choice)'.

Mar 31, 2016, 5:28:33 PM   fatal: CTDP3144E: Unexpected end of input document at byte offset '16288' while parsing choice group '#xscd(/type::__01NAME100/model::sequence/schemaElement::ECI_CONSUMER/type::0/model::sequence/model::choice)'.

can I get a help to figure it out.
I am not understanding what it mean by
Code:

Mar 31, 2016, 5:28:33 PM   info: Offset: 1500. Skipped remaining bytes of fixed-length choice element '#xscd(/type::__01NAME100/model::sequence/schemaElement::ECI_CONSUMER/type::0/model::sequence/model::choice)', actual content was shorter than the length
 

any suggestion is more helpful.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page Previous  1, 2, 3  Next Page 2 of 3

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » DFDL for cobol copy book
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.