DSXchange: DataStage and IBM Websphere Data Integration Forum
View next topic
View previous topic
Add To Favorites
Author Message
shiva459



Group memberships:
Premium Members

Joined: 11 Jun 2003
Posts: 100
Location: Bangalore
Points: 693

Post Posted: Sat Jun 21, 2014 2:59 pm Reply with quote    Back to top    

DataStage® Release: 8x
Job Type: Parallel
OS: Unix
I am processing a xml file using XML Pack stage. The hierarchy in the input tab in XML parser step looks like below.

Code:
Application(List)
<Elements>
    Credit Application(Group)
          <Elements>
         Credit Request(Group)
             <Elements>
              Credit Details(Group)
                  <Elements>
                  Balance Transfer(List)
                   <Elements>
              Offer(List)         
                <Elements>
              Decision(Group)
                <Elements>

I picked Applications as the root and when I check the mappings tab, I did not see Balance Transfer and Offer in the source list. If I make these two lists into groups using 'List to Group', they show up in the source and I am able to map to the output link. I am not well familiar with XML but is there an undesirable result because of converting list into group? If so, what is the alternative. If one of you dealt with it in the past, please advise.
eostic

Premium Poster



Group memberships:
Premium Members

Joined: 17 Oct 2005
Posts: 3821

Points: 30806

Post Posted: Sat Jun 21, 2014 8:41 pm Reply with quote    Back to top    

It depends. There are a variety of reasons for usiing list to group....the most common is when you have a list that is "unbounded" in the xsd but in real life never occurs more than once. Har ...

_________________
Ernie Ostic

blogit!
Open IGC is Here!
Rate this response:  
Not yet rated
kurics40



Group memberships:
Premium Members

Joined: 18 Nov 2009
Posts: 61

Points: 968

Post Posted: Fri Apr 12, 2019 7:28 pm Reply with quote    Back to top    

Hi Shiva,

The same stuff stole 5 hours of my life...
Than I pissed off and I tried to made everything what possible this "Group To List" option.

It gives no error finaly.

Somehow I liked more when I needed to add the XPATH descriptions, than this fency stuff. This on just prepare and prepare and after you come back with a coke and popcorn and you have it.

I was doing this for the same purpose like you. For the flatted row(s) from the XML. Order join step after this:
Left:one of the sublist. I think I chose with minoccurs=1.
right: InputLinks

I am developing this right now. I ll update you.
Rate this response:  
Not yet rated
kurics40



Group memberships:
Premium Members

Joined: 18 Nov 2009
Posts: 61

Points: 968

Post Posted: Fri Apr 12, 2019 10:29 pm Reply with quote    Back to top    

Hi Shiva,

I did ..something again.

1. Group To List everything in the begining. Why? Because I dont understand but now it doesnt give any error message.
2. switch with all relevant lists
3. Order join step: Right : which has value all the time (parent) Left : child
both of them from switch

What did I get from this one to many XML?

many lines, where the one row source had only once a row.

If we have 1 row from parent, 3 rows from child:
Parent will be filled only once. BUT! The xml keys can be multiplied! So we are safe. Smile


Parent , child, version, concent,sysdate, key1,key2
---------------------------------------------------------------
PID1,CID1,34,DarwinPrice,2019-04-13...., realkey1,realkey2
NULL, CID2,34,DarwinPrice,2019-04-13...., realkey1,realkey2
NULL, CID3,34,DarwinPrice,2019-04-13...., realkey1,realkey2
Rate this response:  
Not yet rated
chulett

Premium Poster


since January 2006

Group memberships:
Premium Members, Inner Circle, Server to Parallel Transition Group

Joined: 12 Nov 2002
Posts: 42960
Location: Denver, CO
Points: 221541

Post Posted: Sat Apr 13, 2019 9:31 pm Reply with quote    Back to top    

Good to know, thanks for posting that.

Just for grins, you do realize that you replied to a five year old post and that Shiva hasn't posted for three, yes? May just split you out to your own informational post and link it back to this one. We'll see. Wink

_________________
-craig

Now I've got that feeling once again, I can't explain; you would not understand
this is now who I am. I have become comfortably numb.
Rate this response:  
Not yet rated
kurics40



Group memberships:
Premium Members

Joined: 18 Nov 2009
Posts: 61

Points: 968

Post Posted: Mon Apr 15, 2019 4:24 am Reply with quote    Back to top    

That is ok. What can stop Shivra to pay attention to this post a after 3 years.

I have been asked in the job to do the same with more complex xsd. Well. I can not make it. I create switches where minocccurs=0. I don't know why but if one elemnt is null than the complete group is unavailable. I make list of those groups what I want to separate with swithces.

I try to sort join all of the lists with each other where I minoccurs=0 and maxoccurs = onbounded


Sometimes I receive error message with cursor error. I have the XML Pack but it seems like I had luck with simple xsd.

What is the rule what I need to follow?
Rate this response:  
Not yet rated
eostic

Premium Poster



Group memberships:
Premium Members

Joined: 17 Oct 2005
Posts: 3821

Points: 30806

Post Posted: Mon Apr 15, 2019 7:28 pm Reply with quote    Back to top    

There are MANY nuances for the hierarchical stage. Critical best practice one is to always map your bottom list first, to your output link, before you do ANYTHING else. Second....one repeating path ...

_________________
Ernie Ostic

blogit!
Open IGC is Here!
Rate this response:  
Not yet rated
chulett

Premium Poster


since January 2006

Group memberships:
Premium Members, Inner Circle, Server to Parallel Transition Group

Joined: 12 Nov 2002
Posts: 42960
Location: Denver, CO
Points: 221541

Post Posted: Mon Apr 15, 2019 7:28 pm Reply with quote    Back to top    

The rule you need to follow? Basically, when you have a problem you would like help on, you start a new post.

_________________
-craig

Now I've got that feeling once again, I can't explain; you would not understand
this is now who I am. I have become comfortably numb.
Rate this response:  
Not yet rated
Display posts from previous:       

Add To Favorites
View next topic
View previous topic
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



Powered by phpBB © 2001, 2002 phpBB Group
Theme & Graphics by Daz :: Portal by Smartor
All times are GMT - 6 Hours