Author |
Message
|
chaitu |
Posted: Tue Mar 15, 2016 3:20 am Post subject: DFDL for cobol copy book |
|
|
Voyager
Joined: 15 Apr 2014 Posts: 89
|
Hi All,
My requirement is create a DFDL for a Cobol copy book and parse it against the source input file.
I created a DFDL by importing the copy book.
DFDL is like
Common area(sequence)
(choice)
Filler
header
tailer
redefine1
redefine2
redefine3
.
.
.
redefine..n
now I need to parse it against a I/p file like
common area redefine1
common area redefine3
common area redefinen
.
.
header
tailor
and redefine depends up on the field type which is present in common area
from my understanding we can set xpath expression in initiator if it is a xsd
but here it is copy book.
could anyone please guide me in this.
Regards,
Chaitu. |
|
Back to top |
|
 |
maurito |
Posted: Tue Mar 15, 2016 3:37 am Post subject: Re: DFDL for cobol copy book |
|
|
Partisan
Joined: 17 Apr 2014 Posts: 358
|
chaitu wrote: |
Hi All,
My requirement is create a DFDL for a Cobol copy book and parse it against the source input file.
|
You can create your DFDL, but you CANNOT parse it against an input file. What you can do, is to test the DFDL model by test parsing the input file.
chaitu wrote: |
and redefine depends up on the field type which is present in common area
Chaitu. |
So, you created the DFDL, now you need to add the initiators/discriminators to the DFDL ( the xsd ) using xpath expressions, so the parser knows which of the choices to pick. |
|
Back to top |
|
 |
chaitu |
Posted: Tue Mar 15, 2016 3:47 am Post subject: |
|
|
Voyager
Joined: 15 Apr 2014 Posts: 89
|
Hi maurito,
Thanks for prompt reply.
Yes I created the DFDL, and added the initiators to the DFDL using xpath expressions (/__01NAME/ECI_CONSUMER_INDEX_COMMON_AREA[1]/ECI_RECORD_TYP eq 100)
and tested by parsing input file and error is
CTDP3085E: Cannot resolve expression '{/__01NAME/ECI_CONSUMER_INDEX_COMMON_AREA[1]/ECI_RECORD_TYP eq 100}' for DFDL property 'initiator' defined on object 'ECI_DEMOGRAPHIC_REC'.
could anyone help me to figure it out.
Regards.
Chaitu |
|
Back to top |
|
 |
maurito |
Posted: Tue Mar 15, 2016 3:51 am Post subject: |
|
|
Partisan
Joined: 17 Apr 2014 Posts: 358
|
chaitu wrote: |
Hi maurito,
Thanks for prompt reply.
Yes I created the DFDL, and added the initiators to the DFDL using xpath expressions (/__01NAME/ECI_CONSUMER_INDEX_COMMON_AREA[1]/ECI_RECORD_TYP eq 100)
and tested by parsing input file and error is
CTDP3085E: Cannot resolve expression '{/__01NAME/ECI_CONSUMER_INDEX_COMMON_AREA[1]/ECI_RECORD_TYP eq 100}' for DFDL property 'initiator' defined on object 'ECI_DEMOGRAPHIC_REC'.
could anyone help me to figure it out.
Regards.
Chaitu |
Only you can see what your model definition looks like. And using that, fix the xpath expression. But from that, it looks like you probably need a discriminator rather than initiator. |
|
Back to top |
|
 |
chaitu |
Posted: Tue Mar 15, 2016 4:31 am Post subject: |
|
|
Voyager
Joined: 15 Apr 2014 Posts: 89
|
Hi Maurito,
Could you tell me where the discriminator is present in DFDL. I searched but could not find.  |
|
Back to top |
|
 |
maurito |
Posted: Tue Mar 15, 2016 4:36 am Post subject: |
|
|
Partisan
Joined: 17 Apr 2014 Posts: 358
|
chaitu wrote: |
Hi Maurito,
Could you tell me where the discriminator is present in DFDL. I searched but could not find.  |
If you have not added one, then it is not present anywhere. Now, if you are trying to ask how to add one, then in the integration Toolkit, Development perspective, where you see your dfdl model, in the right pane there are two tabs, the first is for Representation Properties, the other is for Asserts and Discriminators |
|
Back to top |
|
 |
chaitu |
Posted: Tue Mar 15, 2016 5:41 am Post subject: |
|
|
Voyager
Joined: 15 Apr 2014 Posts: 89
|
Hi Maurito,
Thanks for the reply.
I added the Discriminators to all redefines but thing is only redefine 1 is populating every time no other redefine is populating.
Could any one please guide me on this. |
|
Back to top |
|
 |
maurito |
Posted: Tue Mar 15, 2016 5:44 am Post subject: |
|
|
Partisan
Joined: 17 Apr 2014 Posts: 358
|
chaitu wrote: |
Hi Maurito,
Thanks for the reply.
I added the Discriminators to all redefines but thing is only redefine 1 is populating every time no other redefine is populating.
Could any one please guide me on this. |
Use the DFDL test parse and look at the trace, that is the best guidance you can have.
And No, you have not added discriminators to the redefines. DFDL does not have the concept of redefine, so you should start by getting the terminology right. |
|
Back to top |
|
 |
chaitu |
Posted: Tue Mar 15, 2016 5:50 am Post subject: |
|
|
Voyager
Joined: 15 Apr 2014 Posts: 89
|
Hi Maurito,
Redefine is a example name here
Common area(sequence)
(choice)
Filler
header
tailer
redefine1
redefine2
redefine3
.
.
.
redefine..n |
|
Back to top |
|
 |
maurito |
Posted: Tue Mar 15, 2016 5:54 am Post subject: |
|
|
Partisan
Joined: 17 Apr 2014 Posts: 358
|
chaitu wrote: |
Hi Maurito,
Redefine is a example name here
Common area(sequence)
(choice)
Filler
header
tailer
redefine1
redefine2
redefine3
.
.
.
redefine..n |
Use the DFDL test parse and look at the trace. |
|
Back to top |
|
 |
chaitu |
Posted: Wed Mar 16, 2016 12:24 am Post subject: |
|
|
Voyager
Joined: 15 Apr 2014 Posts: 89
|
Hi All,
I am trying to figure out the belowone
this is my DFDL
Common area(sequence)
(choice)
Filler
header
tailer
redefine1
redefine2
redefine3
.
.
.
redefine..n
now I want to the below
Common area redefine1
common area redefine5
common area redefine2
can anyone tell me how to repeat the common area
 |
|
Back to top |
|
 |
timber |
Posted: Wed Mar 16, 2016 12:31 am Post subject: |
|
|
 Grand Master
Joined: 25 Aug 2015 Posts: 1292
|
Two things. Both are important.
1. Please edit your last post and add [C o d e] tags ( use the button at the top of the editing window). We cannot work out the structure of your model unless you show the indentation correctly.
2. You were asking about discriminators. A couple of people have spent their time helping you with that problem. Don't ignore their answers and ask a different question - that is not respectful.
Your next post should explain clearly what your current problems are, and should be easy to read. If you want help. |
|
Back to top |
|
 |
chaitu |
Posted: Wed Mar 16, 2016 2:27 am Post subject: |
|
|
Voyager
Joined: 15 Apr 2014 Posts: 89
|
[
Hi All,
I beg your pardon. I was missed to say that discriminator is working now.
And I want to repeat the Commonarea field like
Commonarea redefine1
commonarea redefine5
commonarea redefine2
I set the commonarea to 1to unbounded
now I am able to generate only first line
Commonarea redefine1
could any one help me to figure it out.
Thanks in advance.
][/code] |
|
Back to top |
|
 |
maurito |
Posted: Wed Mar 16, 2016 2:38 am Post subject: |
|
|
Partisan
Joined: 17 Apr 2014 Posts: 358
|
chaitu wrote: |
[
Hi All,
I beg your pardon. I was missed to say that discriminator is working now.
And I want to repeat the Commonarea field like
Commonarea redefine1
commonarea redefine5
commonarea redefine2
I set the commonarea to 1to unbounded
now I am able to generate only first line
Commonarea redefine1
could any one help me to figure it out.
Thanks in advance.
][/code] |
Not until you follow timber's advice and format your code properly and explain exactly what you want to do. We are only having guesses.
For example,
are you trying to say that you want your model to be something like:
Code: |
sequence
Commonarea
choice
redefine1
redefine2
etc
end choice
Commonarea
choice
redefine1
redefine2
etc
end choice
etc
end sequence
|
i.e. an unbound array of commonareas, and each element containing the choice of several redefines ?
Take your time and explain properly want you want, that will help yourself to understand the problem YOU are facing , because, it is your problem, not ours.
HINT: there is a preview button at the bottom of your window, press it to see how your post is going to look like, if you don't like it, correct it and try again. |
|
Back to top |
|
 |
chaitu |
Posted: Wed Mar 16, 2016 3:45 am Post subject: |
|
|
Voyager
Joined: 15 Apr 2014 Posts: 89
|
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. |
|
Back to top |
|
 |
|